6 years later

Trying to know how to solve the problems and enjoying the Coding in SPOJ
Can somebody please help me?