constantly getting WA
heres my code CodeChef: Practical coding for everyone
The absolute value of each coordinate is less than or equal to 1000. So distance between two points may be greater than your m (= 1009) in min1(). This may return garbage value of index;
???