24 hour archive: Problem
2348  Inbox Storage Capacity 2348  Inbox Storage Capacity 2348  Inbox Storage Capacity
Statistics  Sub: 306  AC: 52  AC%: 16,99  Score: 2,33 
Created by  Yosbel Lázaro Guirola Manresa 
Added by  ymondelo20 (20130409) 
Limits 
Total Time: 50000 MS

Test Time:
5000 MS
Memory: 62 MB  Output: 64 MB  Size:
29 KB

Enabled languages  
Available in 
Description
Robert uses Zimbra for managing mails. He has a list with information about the 1 <= N <= 10^4 mails, received in the last 10^9 days. For each mail, he know the arrival and delete days, A and B (1 <= A < B <= 10^9), and their weight 1 <= W <= 10^9 (used storage capacity in MBytes). He has 1 <= C <= 10^9 MBytes of storage capacity at Inbox folder. He also know that no mails arrives in the same day which others mails are deleted.
Then Robert wants to control the used storage capacity at Inbox folder, and you have been hired for that task.
Then Robert wants to control the used storage capacity at Inbox folder, and you have been hired for that task.
Robert uses Zimbra for managing mails. He has a list with information about the 1 <= N <= 10^4 mails, received in the last 10^9 days. For each mail, he know the arrival and delete days, A and B (1 <= A < B <= 10^9), and their weight 1 <= W <= 10^9 (used storage capacity in MBytes). He has 1 <= C <= 10^9 MBytes of storage capacity at Inbox folder. He also know that no mails arrives in the same day which others mails are deleted.
Then Robert wants to control the used storage capacity at Inbox folder, and you have been hired for that task.
Then Robert wants to control the used storage capacity at Inbox folder, and you have been hired for that task.
Robert uses Zimbra for managing mails. He has a list with information about the 1 <= N <= 10^4 mails, received in the last 10^9 days. For each mail, he know the arrival and delete days, A and B (1 <= A < B <= 10^9), and their weight 1 <= W <= 10^9 (used storage capacity in MBytes). He has 1 <= C <= 10^9 MBytes of storage capacity at Inbox folder. He also know that no mails arrives in the same day which others mails are deleted.
Then Robert wants to control the used storage capacity at Inbox folder, and you have been hired for that task.
Then Robert wants to control the used storage capacity at Inbox folder, and you have been hired for that task.
Input specification
In the first line, a integer number t <= 50, the number of tests cases. For each test case:
On line with two integer numbers, N and C. The following N lines contains three integer numbers A, B, W, which corresponds to the ith mail (1 <= i <= N).
On line with two integer numbers, N and C. The following N lines contains three integer numbers A, B, W, which corresponds to the ith mail (1 <= i <= N).
In the first line, a integer number t <= 50, the number of tests cases. For each test case:
On line with two integer numbers, N and C. The following N lines contains three integer numbers A, B, W, which corresponds to the ith mail (1 <= i <= N).
On line with two integer numbers, N and C. The following N lines contains three integer numbers A, B, W, which corresponds to the ith mail (1 <= i <= N).
In the first line, a integer number t <= 50, the number of tests cases. For each test case:
On line with two integer numbers, N and C. The following N lines contains three integer numbers A, B, W, which corresponds to the ith mail (1 <= i <= N).
On line with two integer numbers, N and C. The following N lines contains three integer numbers A, B, W, which corresponds to the ith mail (1 <= i <= N).
Output specification
For each test case, you must print one line:
 If the storage capacity at Inbox folder was exceeded at least one time, print "BLOCKED", one space, and the amount of storage capacity that the Inbox folder should has to avoid blocking.
 Else if the storage capacity at Inbox folder was over 90% at least one time, print "OVERLOAD", one space, and the amount of storage capacity that the Inbox folder should has to avoid overloading.
 Otherwise, print "OK".
For each test case, you must print one line:
 If the storage capacity at Inbox folder was exceeded at least one time, print "BLOCKED", one space, and the amount of storage capacity that the Inbox folder should has to avoid blocking.
 Else if the storage capacity at Inbox folder was over 90% at least one time, print "OVERLOAD", one space, and the amount of storage capacity that the Inbox folder should has to avoid overloading.
 Otherwise, print "OK".
In the first line, a integer number t <= 50, the number of tests cases. For each test case:
On line with two integer numbers, N and C. The following N lines contains three integer numbers A, B, W, which corresponds to the ith mail (1 <= i <= N).
On line with two integer numbers, N and C. The following N lines contains three integer numbers A, B, W, which corresponds to the ith mail (1 <= i <= N).
Sample input
3
3 10
1 5 5
2 6 3
7 9 9
3 10
1 5 5
2 6 6
7 9 7
3 10
1 5 5
2 6 5
7 9 5
Sample output
OK
BLOCKED 1
OVERLOAD 2