Time limit
2s
Memory limit
128 MB
For each year, the officially measured amount of rain is called that year's rainfall. Based on these records, people may say, “In year X, the rainfall was the greatest since year Y.” Some yearly records may be missing, so you must decide whether each statement is certainly true, only possible, or impossible.
The statement “In year X, the rainfall was the greatest since year Y” is true when all of the following conditions hold.
If the missing yearly rainfall values can be chosen so that the conditions hold, the answer is maybe. If the known information already makes the conditions impossible, the answer is false. If every condition is fully verified, the answer is true.
The first line contains an integer n (1 <= n <= 50,000).
Each of the next n lines contains two integers y and r, meaning that the rainfall in year y is r.
The rainfall records are given in increasing order of y.
The next line contains an integer m (1 <= m <= 10,000).
Each of the next m lines contains two integers Y and X, representing the statement “In year X, the rainfall was the greatest since year Y.”
For each statement, print one answer on its own line.
true if the statement is certainly true.maybe if it could be true but cannot be confirmed.false if it is impossible.