Help me in solving LUCKYFR problem

My issue

My code

# cook your dish here

Problem Link: LUCKYFR Problem - CodeChef