Falling Portals#10441

Falling Portals

1 second
128 megabytes
Very hard

There are worlds, each with a portal. Initially, world (1 \le i \le n) is located at -coordinate and -coordinate A_i (1 \le A_i \le 10^9). Each world also has a cow. At time , all -coordinates are distinct, and the worlds begin to fall: world moves continuously in the negative -direction at a speed of units per second.

Whenever two worlds are at the same -coordinate, possibly at a fractional time, their portals "align", allowing a cow on either world to travel instantaneously to the other.

For each , the cow on world wants to travel to world Q_i (Q_i \ne i). Help each cow determine the minimum amount of time needed to reach her destination, assuming she travels optimally.

For each query, output the journey time as a fraction , where and are positive, relatively prime integers, or output if the journey is impossible.

Input

The first line contains one integer n~(2 \le n \le 2 \cdot 10^5).

The second line contains space-separated integers A_1, A_2, \ldots, A_n.

The third line contains integers Q_1, Q_2, \ldots, Q_n.

Output

Print lines. The -th line should contain the minimum journey time for cow .

Examples

Example 1

Loading
Loading