z-skakac
Mr. Little Z and his best friend R2D2 love to play the following game:
First, R2D2 draws a few lines on the concrete. After that Mr. Little Z must jump from point A to point B without leaping over any of the lines R2D2 painted.
Since Mr. Little Z was always winning, R2D2 has decided to draw so many lines that Mr. Little Z must lose.
Mr. Little Z has decided to make a robot that will play in his place. After a few hard days of work, Mr. Little Z has made his robot, a robot that can jump as many times as he wants to. Unfortunately, Mr. Little Z couldn't write a program for the robot. Help Mr. Little z write a program for his robot.
For the given map that contains all the lines R2D2 drew, the program should find a path from point A to point B, such that the path doesn't cross any of the lines. The points on the path mustn't be outside of the given territory (the area covers 300x300 meters), but it can be on the edge of the territory.
Note: The solution is not unique!
0.00 0.00 10.00 10.00
1
5.00 0.00 5.00 10.00Output:
2
0.00 11.00Explanation: To get from the point (0.00, 0.00) to (10.00, 10.00) you need 2 jumps, the first jump to the point (0.00, 11.00), and then from that point to the end point. The correct solution can be like this, too:
Output:
3
0.00 5.00
0.00 11.00Note: The jumper mustn't pass over the edge points of the lines R2D2 has drawn!
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.