| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 6 | 5 | 2 | 66.667% |
Given a convex polygon of $n$ points $P_1, P_2, \ldots, P_n$ on a two-dimensional plane, answer $q$ queries, where each query has one of the following types:
The first line contains two integers $n$ and $q$ (3ドル \le n \le 10^5,ドル 1ドル \le q \le 10^5$) denoting the number of vertices in the given polygon and the number of queries, respectively.
Each of the following $n$ lines contains two integers, $x$ and $y,ドル denoting a vertex of the polygon.
Each of the following $q$ lines contains one query, which is in one of the following formats:
1 $x$ $y$", asking to calculate the number of pairs $(P_i, P_j)$ such that 1ドル \le i < j \le n$ and the three points $(x, y),ドル $P_i,ドル and $P_j$ are collinear.2 $x_1$ $y_1$ $x_2$ $y_2$", asking to calculate the number of points $P_i$ such that 1ドル \le i \le n$ and the three points $(x_1, y_1),ドル $(x_2, y_2),ドル and $P_i$ are collinear.It is guaranteed that:
For each query, output a line containing a single integer: the answer to the query.
5 3 0 0 2 0 2 1 1 2 0 2 1 1 1 2 1 1 2 2 1 2 2
1 1 2