All submissions for this problem are available.
Burnout, a popular gaming arena in Manipal, has come up with new charging schemes for all the students that game there. Since there are different types of gamers, they are always seeking for packages that are best suited for them. To have an edge over their newly arising competitors, Burnout provides various packages. Two of the most popular packages are:
Respawn charges every 30 minutes at a rate of Rs.10. That means if you play for 29 minutes or less, you will be charged with Rs.10. If you play for 30 to 59 minutes, you will be charged with Rs.20 and so on.
Frag charges every 60 minutes at a rate of Rs.15. That means if you play for 59 minutes or less, you will be charged with Rs.15. Similarly, if you play for 60 minutes to 119 minutes, you will be charged with Rs.30 and so on.
Given a list of durations that students have played for, can you determine the package that is cheaper?
The first line of input is an integer T, denoting the total number of test cases. Each case starts with a line containing an integer N. followed by a list of N durations (In minutes) in next line. Each duration is an integer in the range [1, 2000] which will be separated by a single space character.
For each case, output the case number first. Then output the name of the cheaper package followed by the corresponding cost in Rupees. If both package gives the same total cost, then output both the names (Respawn preceding Frag) followed by the cost. Look at the output and sample input for details.
- 1 ≤ T ≤ 50
- 1 ≤ N ≤ 20
Input: 3 3 40 40 40 2 61 10 2 60 65 Output: Case 1: Frag 45 Case 2: Respawn 40 Case 3: Respawn Frag 60
Note : The reference for this problem has been taken from : UVa online Judge
|Time Limit:||0.2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions