There are points on a plane. The points are uniformly distributed within the square [0..C] \times [0..C].
You are given the number of points (1 \le N \le 5 \cdot 10^4), the number of queries (1 \le M \le 5 \cdot 10^4), and the constant (an integer from to 10^4). Then there are points (X, Y) with integer coordinates. Then come half-planes described by integers (a, b, c). The integers , , do not exceed 10^4 in absolute value. It is guaranteed that a^2 + b^2 \ne 0. A point is considered to lie in the half-plane if and only if ax + by + c \ge 0.
For each of the queries, output a single integer — the number of points in the half-plane.
Example 1