SCHOOL OF COMPUTER SCIENCE

 Hiking

In the Padurea forest there are 100 rest stops. There are 1000 trails, each connecting a pair of rest stops. Each trail e has a level of difficulty l(e). No two trails have the same difficulty. An intrepid hiker, Sendeirismo has decided to spend a vacation by taking a hike consisting of 20 trails of ever increasing difficulty.
Can he be sure that it can be done?

He is free to choose the starting rest stop and the 20 trails from a sequence where the start of one trail is the end of a previous one.

    Solution