2002 LSU Computer Science High School Programming Contest

Sponsored by Microsoft

Novice - Problem 2

Bandwidth of the Future

You think the bandwidth bill that you have to pay for a popular site nowadays is outrageous? The people of 2030 look at the prices we pay today with a deep touch of envy. Sure, data transmission is measured in pebibytes per second, but their streaming fully-immersive holograms and ten thousand channels of digital cable strain even the almost-infinite bounds of their technology.

Even our friend Sam is not immune to this inflationary cost of bandwidth. A page he put up years ago--"Sam's Ultimate Guide to Slack"--is only half-finished, in true Sam Slacker fashion, but as the Internet has grown by leaps and bounds people seem to have turned "Sam's Ultimate Guide" into a sort of countercultural touchstone. Too lazy to fix it up but too proud to take it down, Sam's bandwidth bills for the site are never cheap. He's managed to scrape the cash up to pay his dSP (data service provider) for it so far, but who knows how long it will last?

Description:

You are going to write the program that calculates just how much Sam Slacker's bill is for some number of different months of dSP service. From his service's payroll handbook:

Every customer pays a flat 2500 One World Credits for the dSP service.

If they consume less than 60 exbibytes during the billing cycle, they are not
charged any extra fees.

For each exbibyte over 60, they are charged an additional 5 One World Credits.

For each exbibyte over 120, they are charged an additional 10 One World Credits
(in addition to the 5 OWCs they are already being charged, for a total of 15
One World Credits per exbibyte over 120).

For each exbibyte over 400, they are charged an additional 25 One World Credits
(for a total of 40 OWCs per exbibyte over 400).

If they consume more than 1000 exbibytes per billing cycle, they are charged
a flat 32000 One World Credits.
The customer's consumption is represented by a series of blocks of data; their bandwidth consumption for the billing period is simply the sum of the sizes of all of the blocks of data that they received. The number of blocks of data, b, will satisfy the statement 0 <= b <= 100.

Input:

The first piece of data in the file is the number of months that we are determining the cost for, represented by a non-negative integer. For each month, the first piece of data, b, is the number of blocks of data downloaded from Sam's website that month. The next b lines of data each have a single positive integer on them representing the size of each block of data in exbibytes.

Output:

For each month, print

   Month n: t One World Credits

where n is the month number, starting from 1, and t is the total amount that Sam was charged that month.

Sample Input:

3		Number of months
4		Number of blocks of data in the first month
1		Size of block 1
2		Size of block 2
3		Size of block 3
4		Size of block 4
1		Number of blocks of data in the second month
400		Size of block 1
1		Number of blocks of data in the third month
2000		Size of block 1

Sample Output:

Month 1: 2500 One World Credits
Month 2: 7000 One World Credits
Month 3: 32000 One World Credits