编程介的小学生 2017-12-09 13:54 采纳率: 20.5%
浏览 811
已采纳

Good Plan

Problem Description
FJ has two same house for rant. Now he has n (1 ≤ n ≤ 1000) piece of order, the orders are given in the form:

s t v

means that someone want to rant a hours from the day s to t paying v yuan totally (including the day s and t, 0 ≤ s ≤ t ≤ 400, 0 ≤ v ≤ 100,0000).

A hours can be only rant to one person, and FJ should either accept an order totally or reject it.

Input
The first line of input file is a single integer T - The number of test cases. For each test case, the first line is a single integer n then there n lines, each line gives an order.

Output
For each data set, print a single line containing an integer, the maximum total income for the data set.

Sample Input
3
4
1 2 10
2 3 10
3 3 10
1 3 10
6
1 20 1000
3 25 10000
5 15 5000
22 300 5500
10 295 9000
7 7 6000
8
32 251 2261
123 281 1339
211 235 5641
162 217 7273
22 139 7851
194 198 9190
119 274 878
122 173 8640

Sample Output
30
25500
38595

  • 写回答

3条回答

  • threenewbee 2018-04-05 15:51
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的