HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


027. 50548 - Albanian Airlines

Guest
• Review clarifications (2)

Volume problems

• 020. 50485 - Center of gravity of a ...
• 020. 50408 - Molecules
• 022. 50366 - Student Averages (2 G...
• 023. 50437 - Age Labeling
• 024. 50372 - Number Quadruplets
• 025- 2013-Nov-01. 50328 - How far ...
• 026. 50399 - Mobile Base Station
• 026. 50487 - Radius of Inscribed Circle
• 027. 50548 - Albanian Airlines
• 028. 50483 - Group Total
• 030. 50584 - Total invoice amount
• 033. 50588 - Processing the list of n...
• 035. 50573 - Count and Sum
• 040. 50335 - Five Math Operators
• 044. 50597 - Drawing Diamonds
• 045. 50462 - Class Average (3 Gra...
• 050. 50450 - Last Appereance of a ...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Albanian Airlines

Albanian Airlines applies the following discounts according to the age of the passengers.

  • Between the ages 0 and 2: 90%
  • Between the ages 3 and 9: 40%
  • Age of 10 and over: No discount

Question: Write a program which reads number of passengers (n) and price of one ticket (price). Then, ages of n people will be given. The program will then calculate the total amount of the money paid by all passengers.

Input specification
You will be first given two integers (n and price) where 0 ≤ n ≤ 5000 and 0 ≤ price ≤ 2000. Then, in the following n lines you will be given ages of n people where ages are between 0 and 100.

Output specification
Show one number with 2 digits double precision.

 Sample Input   
 5 250
 10
 2
 8
 24
 5
 Sample Output   
 825


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

www.contester.ru