Hi,

In a recent contest, I came across a problem in which the basic idea was:

"There are x coins of value a and y coins of value b, they must be distributed among N children in such a way that each child gets amount= number_of_coins_of_type_A*a+ number_of_coins_of_typeB*b , number of coins of each type>=0

Find the maximum amount of money that the child with minimum amount among the N can get? "

Any leads or hints regarding the approach would be very helpful.

Thanks in advance.

Please answer this guys.I wanna know .

My first intuition is to distribute uniformly. So that, we can maximize the minimum.

Hi, what exactly do you mean by uniformly? The value of both the coins and the number are different. So how can I approach with a uniform distribution in this problem? And is there a category of problems in which this problem lies?

Can you please provide the problem link? I want to check whether my idea is correct or not?

here is the link, the contest is closed now and there is no editorial :/

https://www.hackerrank.com/contests/uwbcode2020-qualification/challenges/d-compensation

I'm not sure about the exact solution to this problem, I'm still trying, but I've solved a similar one in the past.

The basic idea is to identify the range in which the answer lies and applying Binary Search on this range to arrive at the most feasible solution.

Go through this blog to find a detailed explanation for a similar problem. I hope it helps. Head to the example section of this blog