Chefhack WA

My chefhack is giving wrong answer.
Solution link is http://www.codechef.com/viewsolution/1696242
Admin please tell me the test case where it is going wrong.

Dear raman92,

Kindly post your query on the editorial page of the respective problem here, to get the desired response.

Read the announcement I’ve added to the editorial.
Your program returns 421211088 for this test:


While the correct answer is 436746489.

1 Like

We have too many queries there. It is quite hard to keep tracking those mess we have there. I prefer them to be separate questions.

Moreover since voted comments does not change karma it is quite upsetting from karma point of view to answer such question there.

I am sorry, from next time I will remember this.

The test data is too large for me to debug the program, so I am unable to find why is it giving 421211088 instead of correct result. Can you please help.

Read editorial again. I added link to another smaller test there.
Most probably your bug occur for large prime numbers.
So unlikely test with smaller numbers could help.