In the test case of 8 of the given problem, somehow the total distance 257593781689876390 when divided by 1, yielded 257593781689876384. I am using Python 3. Please point out the problem and solution.
I spent more than half an hour during the contest trying to debug...
try // instead of / (everywhere where division needed)
isn't round 329 the upcoming one ?