Computer Science, asked by vikashdwd, 29 days ago

There is a large manufacturer of vaccine which produces M types of vaccines (whose formulas are derived from different pharma brands).
The manufacturer needs to divide all the vaccines between N dealers. It is acceptable if some dealers do not get any vaccine. However,
no dealer wants vaccines of different kinds which means that all vaccines that a dealer gets need to be of the same type.
The manufacturer also knows that dealers will be jealous if a dealer gets too many vaccines. As an approximation, the jealousy level
among the dealers is defined as the largest number of vaccines given to any dealer.
Task
Help the manufacturer to divide all the vaccines among the dealers such that the jealousy level is minimized.
Example
• N=5
• M= 2
arr= [7,4]
Approach
• There are 7 vaccines of pst type and 4 vaccines of 2nd type. Let the two types be defined by P and Q.
• So if the manufacturer divides the vaccines as PP, PP, PPP, QQ, QQ. This will be optimal distribution.
• Thus, the answer is 3.

Constraints
1< 1 M 1 < arr[i] < 10^9

Sample Input
7 5
7 1 7 4 4

Output
4​

Answers

Answered by crankybirds30
0

Answer:

It was a game of 'fastest finger first'," she says. "The slots filled up in three seconds." But the hospital cancelled her slot at the last minute: they had no vaccines. Ms Marathe went back to try for another appointment.

All 18-44 year-olds in India have to register on the government's CoWin platform to get vaccinated. With demand for jabs far outstripping supply, tech-savvy Indians are even writing c.o.d.e to corner elusive appointments.

Ms Marathe can't c.o.d.e, but she is among millions of Indians who are on the right side of the country's digital divide - unlike hundreds of millions of others who don't have access to smartphones or the internet, currently the only route to a jab.

Answered by ItzBangtansBird
2

Answer:

There is a large manufacturer of vaccine which produces M types of vaccines (whose formulas are derived from different pharma brands).

The manufacturer needs to divide all the vaccines between N dealers. It is acceptable if some dealers do not get any vaccine. However,

no dealer wants vaccines of different kinds which means that all vaccines that a dealer gets need to be of the same type.

The manufacturer also knows that dealers will be jealous if a dealer gets too many vaccines. As an approximation, the jealousy level

among the dealers is defined as the largest number of vaccines given to any dealer.

Similar questions