Chicago 106 miles

1 out of 4 testcase passed.
What is wrong in the code?
https://ide.codingblocks.com/s/245094