Problem Author: | Hasan Saleh (MathModel) |
Prepared by: | Hasan Saleh (MathModel) |
Edited by: | Hasan Saleh (MathModel) |
There are testers, each of them can do interviews per day, and there are participants. Each interview requires testers and 1 participant to be present. Our goal is to minimize the number of days, so we should maximize performances as follows:-
testers interviews= interviews in total.
Maximum performance per day is \lfloor \frac{xy}{z} \rfloor interviews because we want to calculate the number of distinct participants tested. We divide by and perform floor to get rid of the decimal part.
Finally, we divide the number of participants by the maximum performance per day to get the minimum number of days , and we perform if there is a decimal part to do it the next day:
If x<z then it's impossible.
from math import *
for _ in range(int(input())):
p,x,y,z=map(int,input().split())
if(x<z):print(-1)
else:
print(ceil(p/((x*y)//z)))