Error in Practice (BUGCAL), only getting a partial score

Hello everyone! I am a beginner, and was attempting BUGCAL, but only got 30 points, can anyone help me?
Here is my code:

https://www.codechef.com/viewsolution/37137928

I would be most grateful if anyone could figure out(and inform me of) a bug. Thank you.