e-Vaccine
Time Limit: 2.0 s
Memory Limit: 256.0 MB
Description
The Government is planning to roll out the new vaccine to slow down the spread of the virus. But as the demand for vaccine is greater than the production, Government needs your help to distribute the vaccine.
Government has decided to prioritize the rollout of vaccine by Job and Age.
Age from \(1\) to \(125\) will be divided into \(G\) age groups.
Each age group may or may not have a different priority. There will be \(J\) jobs in the priority jobs list. Each job on the list may or may not have a different priority. Jobs not in the priority jobs list will have a priority of \(0\).
Priority of the person will the sum of the priority of their job and age. If two people have the same priority, one who was eligible first will have the vaccine.
The distribution program will run for \(D\) days, and each day \(N\) new people will be eligible for the vaccine and the Government will produce \(M\) vaccine.
End of the \(D\) days, let the Government know how many people remains unvaccinated.
Input
The first line of the input will have three integers, \(D (1 <= D <= 10^4), J (1 <= J <= 150), G (1 <= G <= 7)\).
Next \(J\) line will have the name of job and priority.
Next \(G\) will have \(3\) numbers, \(l\), \(u\), and \(p\). The lower and upper limit of the age group, and the priority. Next for each day, \(D\).
There will an integer, \(N (1 <= N <= 5 * 10^5)\), number of people that became eligible that day, and \(M (0 <= M <= 5 * 10^5)\), number of new vaccines produced by the Government.
Next, \(N\) line will have the name of the person and their job.
Sum of all \(N\) will be less then or equal to \(5 * 10^5\)
Output
For each of \(D\) days, print the name and job of the person receiving the vaccine.
After \(D\), also let the Government know, the number of unvaccinated people in the following format.
Still unvaccinated people: \(X\)
\(X\) here being the number of unvaccinated people.
Sample
Input | Output |
---|---|
|
|
Information
- ID
- 1148
- Difficulty
- 5
- Category
- (None)
- Tags
- (None)
- # Submissions
- 50
- Accepted
- 16
- Accepted Ratio
- 32%
- Uploaded By
Related
In following contests: