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:

https://www.codechef.com/problems/VACCINE1

It is a problem of the December long challenge.

My solution:

https://www.codechef.com/viewsolution/40897793

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+ D1*V1 + D2*V2 - 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.