The Mathematician's Path#11782

The Mathematician's Path

1 second
256 megabytes
Medium

On his way to work after a heavy downpour, a mathematician reached a roadway that was almost completely flooded with water. The mathematician stopped at the very edge, pondering how he could get to the other side of the road.

While he was contemplating, he observed an interesting fact: individual round islands – manhole covers – were visible above the water.

The mathematician set up a coordinate system, with the origin at his location and the x-axis along the edge of the road. He then recorded the coordinates and radii of each manhole cover.

Write a program that determines whether the mathematician can cross the road without getting his feet wet, given the width of the road (considering the sides of the road are parallel) and the maximum possible size of the mathematician's step.

Input

The first line contains three numbers separated by spaces:

• – the width of the road (a real number);

• – the maximum stride length of the mathematician (a real number);

• – the number of manholes (an integer, 1 \le N \le 1000).

Each of the next lines contains three real numbers X_i, Y_i, R_i – the coordinates and radius of each manhole cover (real numbers).

Output

A single number – the minimum number of manholes the mathematician can use to cross the road, or the number «» if it is not possible.

Examples

Example 1

Loading
Loading