this is my code link which is not accepted: https://codeforces.net/contest/233/submission/160186584
this is the code link which is accepted: https://codeforces.net/contest/233/submission/160187423
both on 10000000100000000 as the input are giving 100000000 as the output in my local ide, but somehow on running my previous solution on codeforces it is giving -1 as the output.