Hello everyone. I have recently joined joined codechef and am new to the forum. Please include in comments if I could improve my communication about my problem in any way.
Now for my problem:
It is a problem of the December long challenge.
I used basic maths
first i calculated the number of days that the vaccine is produced by each company
Comp 1: d - D1 +1
Comp 2: d - D2 +1
then i multiplied them by number of vaccines per day and solved the inequation
(d-D1+1)*V1 + (d-D2+1)*V2 >=P
this came to:
d > = (P+ D1V1 + D2V2 - V1 - V2) / (V1+V2)
so i calculated the RHS and used ceil() so that sould give me minimum d. But the answer is not matching for 1 test case.
Please tell me if there is some mistake in logic or code.
All the past solutions i checked are complicated yet they give correct answers.
So I am worried if I missed something.