Shows wrong Answer for Guessing Game problem

//CODE DELETED

I wrote the above code, i solved it mathematically and then came out to the conclusion that we do not need gcd for this question if we frame it like this.
Anyone can help…?

Compile this in c++ 4.8.1 in ideone.com once and run the test cases, it gives correct answers.

PLEASE DO NOT POST CODE OR LOGIC OR ALGORITHMS RELATED TO ONGOING CONTESTS. THIS IS A LIVE CONTEST AND YOU ARE MEANT TO SOLVE IT ON YOUR OWN. IT WOULD NOT HAVE BEEN CALLED A “CONTEST” IF QUESTIONS WERE TO BE SOLVED BY PUBLIC DISCUSSION.

We will be more than happy to help you once the contest is over. Till then keep trying.

1 Like