Problems
Hathai is proud that her catering service provides the freshest food in town. To accomplish
that, she gets fresh ingredients with no preservatives delivered constantly.
This brings about the challenge of preventing the ingredients from spoiling. Her current
special uses exactly
Hathai has the schedule of the deliveries of Thai basil. The
For example, suppose Hathai's schedule has the following
- Delivery time:
1 . Amount:10 . Time remaining until spoiled:2 . - Delivery time:
3 . Amount:4 . Time remaining until spoiled:2 . - Delivery time:
5 . Amount:1 . Time remaining until spoiled:4 . - Delivery time:
10 . Amount:6 . Time remaining until spoiled:3 .
The first delivery become spoiled at time
Given the delivery and order schedules, find out the maximum number of orders Hathai can fulfill if she optimizes the use of the Thai basil leaves.
Input
The first line of the input gives the number of test cases,
Output
For each test case, output one line containing Case #,
where
Example #1
2
2 4 5
20 8 1000000000
60 4 1000000000
10 30 50 70
3 5 5
20 8 1000000000
50 3 1000000000
60 100 1000000000
30 50 59 70 90
Case #1: 0
Case #2: 2
Example #2
1
4 4 2
1 10 2
3 4 2
5 1 4
10 6 3
3 4 6 10
Case #1: 2