The farthest#2954

The farthest

2 seconds
256 megabytes
Easy

Given points on a plane, you are required to process the following types of queries:

Input

The first line contains the integer (1 \leq N \leq 10^5), followed by the coordinates of these points. The next line contains the integer (1 \leq M \leq 10^5), followed by queries. The format of the queries is shown in the example. All point coordinates, as well as the numbers and , are integers with absolute values not exceeding 10^9.

Output

For each query of the type get, output a single integer — the maximum value of ax + by.

Examples

Example 1

Loading
Loading