GO Solution For UVa 10801 - Lift Hopping. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

Ted the bellhop: “I’m coming up and if there isn’t a dead body by the time I get there, I’ll make one

myself. You!” Robert Rodriguez, "Four Rooms."

A skyscraper has no more than 100 floors, numbered from 0 to 99. It has n (1 ≤ n ≤ 5) elevators which travel up and down at (possibly) different speed

...

You can find the full details of the problem Lift Hopping at UVa Online Judge

Sample Input

2 30
10 5
0 1 3 5 7 9 11 13 15 20 99
4 13 15 19 20 25 30
2 30
10 1
0 5 10 12 14 20 25 30
2 4 6 8 10 12 14 22 25 28 29
3 50
10 50 100
0 10 30 40
0 20 30
0 20 50
1 1
2
0 2 4 6 8 10

Sample Output

275
285
3920
IMPOSSIBLE

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985