Whats wrong in my code(EVENT)

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

Can anyone please help me to point out my mistake in my code for problem EVENT.

Check out the testcase

monday tuesday 9 9

I think your answer will be impossible but the answer should be 9

@admin5 Thanks got it