#P6245. [USACO06OPEN] The Climbing Wall S
[USACO06OPEN] The Climbing Wall S
Background
This problem is a shortened version that ensures the original meaning is not changed.
Problem Description
Bessie wants to climb a wall. The wall has width and height . There are distinct footholds on the wall.
is on the ground at the bottom-left corner. Any two footholds are at least apart. There is at least one path to the top. Each time, Bessie can climb at most units of distance, and she can move in any direction.
Once she reaches a foothold whose height is less than away from , she can go directly to the top of the wall. Bessie may start on any foothold whose height is at most . Find the minimum number of moves for Bessie to reach the top.
In this problem, distance means Euclidean distance.
Input Format
The first line contains two integers and , separated by a space.
Lines to each contain the coordinates of a foothold, where is the distance from the left side of the climbing wall, and is the distance from the ground.
Output Format
Output a single integer: the minimum number of moves Bessie needs to reach the top of the climbing wall.
3000 5
600 800
1600 1800
100 1300
300 2100
1600 2300
3
Hint
Sample Explanation
The path goes through .
Constraints:
Translated by ChatGPT 5