Antennas

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

문제

There are nn equidistant antennas on a line, numbered from 11 to nn. Each antenna has a power rating, the power of the ii-th antenna is p_ip\_i.

The ii-th and the jj-th antenna can communicate directly if and only if their distance is at most the minimum of their powers, i.e., ij min(p_i,p_j)|i - j| ≤ \min{(p\_i, p\_j)}. Sending a message directly between two such antennas takes 11 second.

What is the minimum amount of time necessary to send a message from antenna aa to antenna bb, possibly using other antennas as relays?

입력

Each test contains multiple test cases. The first line contains an integer tt (1t100,0001 ≤ t ≤ 100\\,000) — the number of test cases. The descriptions of the tt test cases follow.

The first line of each test case contains three integers nn, aa, bb (1a,bn200,0001 ≤ a, b ≤ n ≤ 200\\,000) — the number of antennas, and the origin and target antenna.

The second line contains nn integers p_1p\_1, p_2p\_2, \dots, p_np\_n (1p_in1 ≤ p\_i ≤ n) — the powers of the antennas. The sum of the values of nn over all test cases does not exceed 200,000200\\,000.

출력

For each test case, print the number of seconds needed to trasmit a message from aa to bb. It can be shown that under the problem constraints, it is always possible to send such a message.