Once upon a time in Time-Land

Problem Name:
Once upon a time in Time-Land
Site:HackerEarth
Links:
Tags:
Problem setters: