The Last Problem - May Cook Off

My solution - solution
Problem - https://www.codechef.com/COOK129B/problems/TLAPM

Can someone point out the mistake please :slight_smile: