HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50743 - Total Scholarships Discount

Guest
• Review clarifications (1)

Volume problems

• 50927 - Health Expenses
• 50983 - Course Selection
• 50745 - Bitonic Sequence
• 50789 - Number of Cities
• 50987 - Very Looong Queue
• 50913 - Manhattan Distance
• 50981 - Top popular m-students
• 50729 - Max number in 2D array
• 50743 - Total Scholarships Disc...
• 51083 - Grades Histogram
• 51024 - Total Stock Price
• 51008 - Sum of Regional Maxes
• 51014 - Nine Men's Morris game
• Word Puzzle
• 50740 - Service Time - 1
• 50928 - War Of Battleships
• 50930 - Tom and Jerry

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.
Question by Ibrahim Mesecan.

Total Scholarships Discount

The university provides scholarship for the first three thousand students according to their graduation exam scores and registration dates. A student can grant

  • 100% scholarship, if she/he is among the first 1000 students
  • 75% scholarship, if she/he is among the second 1000 students
  • 50% scholarship, if she/he is among the third 1000 students
The list of the students who got scholarship is announced after the graduation exams according to their application dates. The student who applies first has priority before the other students if (s)he gets a score among the first 3000. If two students have applied on the same day, the student with the smaller id is before the other. The university announces the score limits after the graduation exams. Three floating point numbers. The students who have score above the first number are the students in the first 1000, etc.

Question: Write a program that reads student application information, then figures out the total amount of scholarships provided to the top k students.

Input specification
In the beginning, you will be given two integers: total number of students (n) the school fee (f) and the number of students who can get scholarships (k) where 5 ≤ n ≤ 50,000, 5 ≤ f ≤ 10,000 and 1 ≤ k ≤ 1,000. In the second line you are given three floating point numbers. The limit for the first 1000, the limit for the second 1000, etc. Then in the following n lines you will be given information for n students. Every line contains the following information:

  • Student ID: an integer between 1 and 1e8
  • Registration date: 3 integers - year, month and day
  • Student score: a floating point number between 1 and 10,000

Output specification
Show the total amount of scholarships provided to all k students with 2 digits precision.

Sample Input I
10 1000 4
5872 5578 5284.2
4 2015 3 12 5158.3
7 2015 4 21 5032
11 2015 3 2 5666
16 2014 12 3 6116
22 2015 2 1 5068.4
30 2015 3 14 4637
31 2015 1 16 6166.2
34 2014 12 3 5490
40 2014 11 19 3226.2
45 2015 5 29 5506
Sample Output I
3250

Explanation: The student with the ID 45 deserved to take scholarship but he couldn’t receive, because top k (4) students can take scholarship. The student with the ID 40 has registered first but he cannot take scholarship because his score is low.

 ID  Reg. DateScoreScholarshipDiscount
40 2014-11-19 3226.200
162014-12-36116 1001000
34 2014-12-3549050 500
312015-1-16 6166.21001000
222015-2-1  5068.4   00
112015-3-2566675750
4 2015-3-12 5158.300
302015-3-14463700
7 2015-4-21503200
45 2015-5-29 5506500



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

www.contester.ru