BlueBook
p108ex7 - Cost
Given an integer N (0 ≤ N ≤ 100,000) representing the mass of a letter in grams, print out the cost in cents to mail the letter.
The first line of input will be the number of test cases T (1 ≤ T ≤ 100). The following T lines will contain N. Output the cost in cents to mail the letter.
The pricing is as follows :
0 ≤ N ≤ 30 costs 38 cents
30 < N ≤ 50 costs 55 cents
50 < N ≤ 100 costs 73 cents
if N > 100 then the base cost is 73 cents, plus 24 cents for every additional 50 grams or part thereof.
Input
The first line of input will be the number of test cases T (1 ≤ T ≤ 100). The following T lines will contain N.
Output
Output the cost in cents to mail the letter.
Sample Input
2
5
101
Sample Output
38
97
All Submissions
Best Solutions
Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 21, 2008
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
You can output as you input, that's fine.
BTW you can edit your previous posts.
in the above ex:2, how do u do it so that it will only read lines 2 times, no more no less
like it the number is 5, the program will only read 5 values
how do u do that. help plz(in pascal) cause the rest of the programs that r left r usually based on that