Covid Vaccination Distribution Problem
As the Government ramps up vaccination drives to combat the second wave of Covid-19, you are tasked with helping plan an effective vaccination schedule. Your goal is to maximize the number of vaccines administered on a particular day, while adhering to certain rules.
Explanation:
Given two positive integers, n
and maxVaccines
, indicating the number of days for the vaccination drive and the total available vaccines respectively, you must find the number of vaccines distributed each day. Additionally, a specific day, dayNumber
, is provided, and you need to maximize the number of vaccines on this day.
Rules:
- A positive number of vaccines must be administered each day.
- The difference in the number of vaccines between any two consecutive days cannot exceed 1.
- The sum of vaccines distributed must not exceed
maxVaccines
. - The vaccines administered on
dayNumber
must be maximized.
Input:
The first line of input contains an integer 'T', the number of test cases. Each test case consists of one line with three integers: n
, dayNumber
, and maxVaccines
.
Output:
For each test case, output a single integer representing the maximum number of vaccines administered on the dayNumber
day. Each result should be on a new line.
Example:
Input:
T = 2
n = 3, dayNumber = 1, maxVaccines = 6
n = 4, dayNumber = 2, maxVaccines = 10
Output:
3
4
Constraints:
1 <= T <= 50
1 <= n <= maxVaccines <= 10^9
0 <= dayNumber < n
- Time Limit: 1 sec
Note:
No need to print output; just implement the function logic as needed.
This question asks for finding the maximum number of vaccines administered on a specific day during a vaccination drive, given the total number of days, total number of vaccines available, and the day...read more
Top Cisco Data Engineer interview questions & answers
Popular interview questions of Data Engineer
Top HR questions asked in Cisco Data Engineer
Reviews
Interviews
Salaries
Users/Month