I have attached 3 screenshots, one in local, another in CodeChef online compiler as well as submission on code forces. for **Testcase 2 — case 4**, gives correct output as expected in codechef online compiler as well as in local, but gives the wrong answer in codeforces submission. Can anyone please help.

question link : https://codeforces.com/contest/1737/problem/B submission : https://codeforces.com/contest/1737/submission/175028607

The same happens to me. The inbuilt

`sqrt`

give some precision error for long integers in different systems. You can either use`sqrtl`

(made especially for long long) or find it simply using binary search.The following code will have different results on codeforces vs my local machine.

Thanks! Thanks! Thanks! I learned

`sqrtl`

from your here and fixed some improper use of`sqrt`

in my code, as a good result, it`ACCEPTED`

!!! THANK YOU for your`SQRTL`

!!!credits CHANDANKR7730

why do we need to start with right = 2000000123,we can also start with right = x right because sqrt(x) will be anyways less than x

what is the significance here using the number 2000000123?

Thank you so much