Problem B
Association for Computing Machinery
ACM (Association for Computing Machinery) organizes the International Collegiate Programming Contest (ICPC) worldwide every year.
In the ICPC, a team of three students is presented with a
problem set that contains
However, when a contest has ‘First to Solve Problem
[‘A’/‘B’/.../‘A’
Input
The input describes a hypothetical scenario of a
The first line contains two non-negative integers
The next line contains
As an ACM ICPC duration is
In this problem, you can assume that all your team’s
estimations are perfectly accurate, i.e. if your team
estimates that your team needs
Output
Print two integers
For the example scenario above, if your team decides to
solve problem
Sample Input 1 | Sample Output 1 |
---|---|
7 0 30 270 995 996 997 998 999 |
2 330 |
Sample Input 2 | Sample Output 2 |
---|---|
7 1 30 270 995 996 997 998 999 |
2 570 |
Sample Input 3 | Sample Output 3 |
---|---|
7 2 30 270 995 996 997 998 999 |
0 0 |
Sample Input 4 | Sample Output 4 |
---|---|
3 0 1 300 299 |
2 301 |
Footnotes
- The largest number of problems in an
official ACM ICPC to date is probably the recent ACM ICPC
World Finals in Marrakesh, Morocco where
. - To simplify this problem a bit, we
ignore seconds although the last submission must be done at
hours, minutes, and seconds (or minute ) in order to be considered valid.