ACM14KG3- Discount on Crackers getting WA using Floyd-Warshall algorithm

Question - https://www.codechef.com/LRNDSA08/problems/ACM14KG3
Solution link - https://www.codechef.com/viewsolution/33388694

Can anyone check why this soln is getting WA?

Cannot view the solution since it’s contest, provide the code with proper indentation here itself