TLAPM - help

TLAPM code: CodeChef: Practical coding for everyone)

I have used concept of sum of ap terms to find out and add only required cells of grid.
Submission results shows wrong answer.
Can someone help me with what is wrong with the code…Which test cases are failed?

On the VACCINE3 solution, you should typecast the print statement using ceil to int as follows:
cout<<(int)ceil((s+1)*1.0/p)<<" “<<(int)ceil((s+x[g-1])*1.0/p)<<”\n";

Since ceil returns double, the test cases fail. Im still trying to figure out why.

1 Like