Hiring Help
Time limit4sMemory limit1024 MB
For each consultant request, decide whether the current coders can match its lines and bugs per hour, with coders removed over time.
- Level
Hard8 of 10
- Topics
- Geometry, Divide and conquer
- Solved
- No attempts yet
Statement
A certain large unnamed software development company has developers. The productivity of each coder is measured by two 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 a budget of man-hours of programmer time. The manager can staff different coders on the project, up to a total of hours. For instance, if there are three programmers, the manager can allocate any non-negative real numbers , , and hours of their respective work hours, as long as . If the three programmers write , , and lines of code per hour, a total of lines of code will be written for the project. Similarly, if they fix , , and bugs per hour, a total of bugs will be fixed.
The company has a hiring freeze, so no new coders are hired. A manager may bring in outside help by outsourcing a project to an external consultant, but only if the project cannot be done equally efficiently in-house. If the consultant writes lines of code and fixes bugs in hours, and some allocation of the existing coders would write at least lines of code and fix at least bugs in at most hours, then the manager is not allowed to hire this consultant. This holds regardless of whether those coders have time for the project or are already busy with other projects.
Employees sometimes quit the company during the freeze. Given a chronological list of events, consultant requests and employees quitting, find out which of the requests will be approved.
Input
The first line contains a single integer (), the number of coders at the start. The coders are numbered from to . The next lines each contain two integers and (), the lines of code and the bugs fixed per hour by coder .
The next line contains a single integer (), the number of events. Each of the following lines is one of two forms:
- "
c", for integers , , and (, ): a request to take in a consultant for a project of hours, where the consultant would write lines of code and fix bugs in those hours. - "
q", for an integer (): coder quit the company.
No coder quits more than once.
Output
For each consultant request, output "yes