编程介的小学生
2017-12-09 13:54Good 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条回答
为你推荐
- 将大数据存储在会话变量中是一种好习惯吗?
- mysql
- php
- session
- 2个回答
- 我需要在我的服务器上安装composer才能用laravel执行cron作业?
- laravel
- php
- cron
- 1个回答
- Yii还是ZendFramework? [+ ORM] [关闭]
- yii
- php
- orm
- 2个回答
- 在为多应用程序Kohana环境开发厚模块的同时保持数据库最新
- database
- kohana
- php
- 1个回答
- 保护服务器上的一个特定文件; .htaccess这样做的好方法?
- javascript
- html
- security
- php
- 2个回答