A Car Trip Of sundar

Revision en1, by tirupati, 2015-07-04 13:23:40

Today I was trying to solve some questions from codechef and I ran into this question. I tried to optimise it in different ways but I failed in every attempt. The problem statement is here. I am getting TLE on my submission here. Can someone help by giving me a rough idea on solving this question? Thank You...:)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English tirupati 2015-07-04 13:23:40 432 Initial revision (published)