| 
 
 
 | Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
 
 
   Post OfficeNational Post office calculates 
the prices according to two criteria:
 | The distance of countries: 
In country: 0.5Neighboring countries: 1the countries in Europe: 1.5Asia, Africa: 2America: 3Other countries: 5 |  | Weight in grams 
1 - 50 gr: 151 - 100 gr: 1.5101 - 250 gr: 3251 - 500 gr: 6501 - 1000 gr: 12Above: 20 |  
The object sent to neighboring countries is called one 
unit price (p). Prices of other countries are multiplied 
with the given coefficients. For example, if a 200 grams 
box is sent to a neighboring country. The price is 3p. 
Or, if the same box is sent to Africa the price is 3*2*p. 
 
Question:
Write a program that gets the information for n postal 
objects and then prints the total amount of money 
collected.
 Input specification  In the first line, you will be given two integers: The 
number of postal objects(n) and the unit post price. 
Then, in the following n lines you will be given 
information for n postal objects.
 
where 0 ≤ n ≤ 20,000.The weight of object in grams, an integer between 
1 and 3,000 Country code: an integer between 1 and 6. Output specification: Show one number with two digits precision.
 
  | Sample Input I 
 
5 7015 4
 52 1
 174 1
 52 3
 12 2
 
 | Sample Output I 
 
525.00 
 |  Explanation: 
 
And the total is 525 lekeFirst box is 15 grams and it was sent to Asia or Africa: 
70 * 1 * 2 = 140The second box is 52 grams and was sent to in country: 
70 * 1.5 * 0.5 = 52.5 The third box is: 105 The fourth box is: 157.5The fifth box is: 70  
 Для отправки решений необходимо выполнить вход.
 
 
 |