problem link:https://www.codechef.com/problems/NEAR
solution link: https://www.codechef.com/viewsolution/11606162
problem link:https://www.codechef.com/problems/NEAR
solution link: https://www.codechef.com/viewsolution/11606162
First and foremost you need to modify the array declarations.
p[1003], ca[1003][5], cu[1003][5];