WA in "Chef and His Cake" (GIT01)

problem : https://www.codechef.com/problems/GIT01
my solution : https://www.codechef.com/viewsolution/36404851