ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN111 Homeworks 2013-2015 > задача:


15-FallHW-1. 50820 - Post Office

CEN111 Homeworks 2013-2015

Старт: 10.янв.2015 в 10:00:00
Финиш: 10.янв.2015 в 15:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 14-Fall2-50. 50534 - Top Trading C...
• 14-Fall2-60. 50487 - Radius of Inscr...
• 14-FallResit-20. 50407 - Missing Nu...
• 14-Spr2-10. 50426 - Calculating Sales
• 14-Spr2-20. 50425 - Calculating W...
• 14-Spr2-30. 50445 - Cryptography
• 14-Spr2-50. 50437 - Age Labeling
• 15-Fall-01. 50806 - TVSH
• 15-FallHW-1. 50820 - Post Office
• 15-FallHW-2. 50821 - Derivative of ...
• 15-FallHW-3. 50822 - Linked List
• 15-FallHW-4. 50823 - Secret Number
• 15-FallHW-5. 50824 - Sum of Group...
• 15-FallHW-6. 50825 - Drawing Polygon
• 15-FallPr-10. 50808 - Total Distance...
• 15-FallPr-30. 50810 - Print Office
• 15-FallPr-50. 50812 - Total Discount...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Post Office

National Post office calculates the prices according to two criteria:

The distance of countries:
  1. In country: 0.5
  2. Neighboring countries: 1
  3. the countries in Europe: 1.5
  4. Asia, Africa: 2
  5. America: 3
  6. Other countries: 5
          Weight in grams
  1. 1 - 50 gr: 1
  2. 51 - 100 gr: 1.5
  3. 101 - 250 gr: 3
  4. 251 - 500 gr: 6
  5. 501 - 1000 gr: 12
  6. Above: 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.

  • The weight of object in grams, an integer between 1 and 3,000
  • Country code: an integer between 1 and 6.
where 0 ≤ n ≤ 20,000.

Output specification:
Show one number with two digits precision.

Sample Input I
5 70
15 4
52 1
174 1
52 3
12 2
Sample Output I
525.00

Explanation:

  1. First box is 15 grams and it was sent to Asia or Africa: 70 * 1 * 2 = 140
  2. The second box is 52 grams and was sent to in country: 70 * 1.5 * 0.5 = 52.5
  3. The third box is: 105
  4. The fourth box is: 157.5
  5. The fifth box is: 70
And the total is 525 leke



Для отправки решений необходимо выполнить вход.

www.contester.ru