Hiring Help

아직 제출이 없습니다시간 제한4초메모리 제한1024 MB

문제

A certain large unnamed software development company has nn developers.  The productivity of each coder working for the company has been rigorously measured in terms of two key performance indicators: the number of lines of code they write per hour, and the number of bugs they fix per hour.

When a project needs to be done, the manager in charge of the project is allocated some budget of tt man-hours of programmer time.  The manager can then staff different coders on the project, up to a total of tt hours.  For instance if there are three programmers, the manager can allocate any non-negative real numbers t_1t\_1, t_2t\_2, and t_3t\_3 hours of their respective work hours, as long as t_1+t_2+t_3tt\_1 + t\_2 + t\_3 \le t.  If the three programmers write l_1l\_1, l_2l\_2, and l_3l\_3 lines of code per hour, a total amount of t_1l_1+t_2l_2+t_3l_3t\_1 \cdot l\_1 + t\_2 \cdot l\_2 + t\_3 \cdot l\_3 lines of code will then be written for the project. Similarly if they fix b_1b\_1, b_2b\_2, and b_3b\_3 bugs per hour, a total of t_1b_1+t_2b_2+t_3b_3t\_1 \cdot b\_1 + t\_2 \cdot b\_2 + t\_3 \cdot b\_3 bugs will be fixed.

Due to the uncertain economy, the company has a hiring freeze, meaning that no new coders are hired to the company.  However, under certain conditions, a manager is allowed to bring in outside help by outsourcing a project to an external consultant rather than doing it in-house.  But this is only allowed if it is not possible to do the project equally efficiently in-house.  In particular, if the consultant writes \ell lines of code and fixes bb bugs in tt hours, and there exists some allocation of our existing coders which would write at least \ell lines of code and fix at least bb bugs in at most tt hours, then a manager is not allowed to hire this consultant (regardless of whether those existing coders would actually have time to work on the project or whether they are already too busy with other projects).

While no new coders are hired, employees do sometimes decide to leave the company.  Given a chronological list of events -- requests to use a consultant, and employees quitting -- find out which of the requests will be approved.

입력

The first line of input consists of a single integer nn (0n21050 \leq n \leq 2 \cdot 10^5), the number of coders (initially) at the company.  The employees are numbered from 11 to nn (names are too personal). Then follow nn lines, the iith of which contains two integers _i\ell\_i and f_if\_i (1_i,f_i1081 \leq \ell\_i, f\_i \leq 10^8), the number of lines of code and the number of bugs fixed per hour by coder ii.

Next follows a line with a single integer ee (1e1051 \le e \le 10^5), the number of events. This is followed by ee lines, describing the events in chronological order.  An event is a line in one of the following two forms:

  • "c tt \ell ff", for three integers tt, \ell and ff (1t1001 \le t \le 100, 1,f1081 \le \ell, f \le 10^8): a request to take in a consultant for a project of tt hours, where the consultant would write \ell lines of code and fix ff bugs in those tt hours.
  • "q ii", for an integer ii (1in1 \le i \le n): coder ii quit the company.

You may assume that no coder quits more than once.

출력

For each request to take in a consultant, output "yes" if the request is approved, and "no" if it is not approved.