I used the same logic as provided in geeks for geeks and ran my code over several test cases then also I am getting WA. Can anyone provide some test cases over which my solution fails or the bug which I am missing out? My solution link.
Here you go:
3 2 98 19995
Also, 0 seems to make it TLE.
Just curious, How did you find out corner cases where my code failed.
I changed my code according to the test cases you provided and I am still getting WA. MyCode
By creating an input file with some random numbers and comparing the output of your code with mine.
Your latest code gives the same answers as mine.
Then is it a bug in problem. Why am I getting WA. I tried all test cases provided by you and other people in the comment section.
Well that’s a bit of a leap!
I think it’s far more likely there’s a bug in your code that we haven’t found.
Like these for example.
2 27536799922889 506677219976642000