A Look at the Sky
A telescope is positioned at a specific point in space to observe stars. It can "see" stars located within a sector defined by an opening angle A relative to its "view" direction, and at a distance no greater than L. This means the telescope's "view" forms a cone with a spherical base (refer to the illustration in the example).
Your task is to determine how many stars the telescope can "see," based on the telescope's position, its "view" direction, and the stars' locations.
Notes:
No stars are located on the boundaries of the "view";
All star coordinates are unique;
The center of the cone's base is on the line connecting the telescope's position and the "view" direction point;
The telescope's position does not coincide with the "view" direction point.
Input
The first line contains two integers A and L, separated by a space, representing the opening angle and the "view" distance (10° ≤ A ≤ 45°; 1 ≤ L ≤ 100).
The second line contains three integers x_t, y_t, z_t, separated by spaces, which are the coordinates of the telescope's position (0 ≤ x_t, y_t, z_t ≤ 100).
The third line contains three integers x_v, y_v, z_v, separated by spaces, representing the coordinates of the telescope's "view" direction (0 ≤ x_v, y_v, z_v ≤ 100).
The fourth line contains one integer n, the number of stars (1 ≤ n ≤ 10000).
Each of the following n lines contains the coordinates of the i-th star, given as three integers x_i, y_i, z_i, separated by spaces (0 ≤ x_i, y_i, z_i ≤ 100).
Output
The output should be a single integer, indicating the number of stars that the telescope "sees."