Codeforces Beta Round 64
D
Professor's task
Codeforces
2700
原题
← CE →
翻译中…

Once a walrus professor Plato asked his programming students to perform the following practical task.

翻译中…

The students had to implement such a data structure that would support a convex hull on some set of points $*S*$. The input to the program had $*q*$ queries of two types:

翻译中…
  1. Add a point with coordinates $(*x*, *y*)$ into the set $*S*$. Note that in this case the convex hull of $*S*$ could have changed, and could have remained the same.
翻译中…
  1. Say whether a point with coordinates $(*x*, *y*)$ belongs to an area limited by the convex hull, including the border.
翻译中…

All the students coped with the task. What about you?

翻译中…

Input

翻译中…

The first line contains an integer $*q*$ ($4 ≤ *q* ≤ 10^{5}$).

翻译中…

Then follow $*q*$ lines in the following way: "$*t*$ $*x*$ $*y*$", where $*t*$ is the query type (1 or 2), and $(*x*, *y*)$ are the coordinates of the point ($- 10^{6} ≤ *x*, *y* ≤ 10^{6}$, $*x*$ and $*y*$ are integers).

翻译中…

There is at least one query of type 2.

翻译中…

It is guaranteed that the three queries of the first type follow first and the points given in the queries form a non-degenerative triangle. Also all the points added in $*S*$ are distinct.

翻译中…

Output

翻译中…

For each query of the second type print one string containing "YES", if the point lies inside the convex hull or on its border. Otherwise, print "NO".

翻译中…

样例

Input #1
8
1 0 0
1 2 0
1 2 2
2 1 0
1 0 2
2 1 1
2 2 1
2 20 -1
Output #1
YES
YES
YES
NO
InputCopy OutputCopy
题目信息
题号
70D
时间限制
1 s
内存限制
256 MB
标签
数据结构
计算几何

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。