Robot

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given nn points (x1,y1),,(xn,yn)(x_1, y_1), \dots, (x_n, y_n) in the plane. Your goal is to navigate a robot from point (x1,y1)(x_1, y_1) to point (xn,yn)(x_n, y_n).

From its current point (xi,yi)(x_i, y_i), the robot may travel to any other point (xj,yj)(x_j, y_j) that is at most RR units away, at a speed of 11 unit per second. Before it moves, however, the robot must turn until it faces (xj,yj)(x_j, y_j); this turning happens at a rate of 11 degree per second.

Compute the shortest time needed for the robot to travel from point (x1,y1)(x_1, y_1) to (xn,yn)(x_n, y_n). Assume the robot initially faces (xn,yn)(x_n, y_n).

To avoid floating-point precision issues, use the double data type rather than float. It is guaranteed that the unrounded shortest time is no more than 0.40.4 away from the nearest integer. If you use inverse trigonometric functions, prefer atan2() over acos() or asin().

Input

The input contains multiple test cases. Each test case begins with a line containing two integers RR and nn: RR is the maximum distance the robot may travel between points (10R100010 \le R \le 1000), and nn is the number of points (2n202 \le n \le 20).

Each of the next nn lines contains two integers; the ii-th of these lines contains xix_i and yiy_i (1000xi,yi1000-1000 \le x_i, y_i \le 1000). Every point is distinct.

The end of input is marked by a test case with R=n=1R = n = -1.

Output

For each test case, print a single line containing the shortest possible time in seconds (rounded to the nearest integer) required for the robot to travel from (x1,y1)(x_1, y_1) to (xn,yn)(x_n, y_n). If no such trip is possible, print impossible instead.