Long Challenge MEET Problem

Can anyone help me where I went wrong as I am unable to understand it.

Here is my solution link
https://www.codechef.com/viewsolution/42777882

Problem Link
https://www.codechef.com/FEB21C/problems/MEET/