Sasha still loves physics. Sasha still has no friends. It is still unknown if these two facts are related, but Sasha is still very upset about the lack of companions. Therefore, he decided to impress Vadim with his experiment again, but this time a little different.
Sasha took 2^{N} vessels, placed them in a row, and poured 1 liter of juice into each vessel, with the temperature of the juice in the ith vessel being t_{i}. After that, he brought this setup to Vadim to demonstrate the experiment. Unfortunately, Vadim still doesn’t like physics, but he was interested in a slightly different question.
Vadim numbered the vessels from left to right with numbers from 1 to 2
^{N}. He wants to know how much time it will take to mix the juice from the vessels in the range from the
l_{j}th to the (
l_{j} + 2
^{pj} − 1)th using a simple algorithm:

Vadim takes every second vessel and pours its contents into the vessel to its left, discarding these empty vessels from the range;

Then he waits until the juice in each vessel is fully mixed and reaches a common temperature throughout the vessel;

When the temperature is evenly distributed in each vessel, Vadim repeats the first step. He pours the juice from every second vessel in the range into the vessel to its left;

To avoid waiting for the previous steps to complete, Vadim has determined in advance which vessels and at which stage of the algorithm he will have to mix, and pours the corresponding pair as soon as the temperature of the juice in these two vessels becomes constant;

Vadim performs this algorithm until all the juice in the range ends up in one vessel.
Vadim has Q questions of this type that he asked Sasha. Sasha quickly realized that mixing and checking all of this would be quite difficult, so he decided to conduct mental experiments. He remembered several formulas from physics that would come in handy. To determine the temperature of the juice t_{f} after mixing vessels with V_{1} and V_{2} liters and juices with temperatures t_{1} and t_{2} degrees respectively, you can use the formula:
t_{f} = (V_{1} · t_{1} + V_{2} · t_{2}) / (V_{1} + V_{2}).And to determine the mixing time T_{f}, you need to know the mixing rate coefficient for identical liquids with different temperatures c_{w}. For juice, it is equal to 1 l · deg / sec. Then the formula is as follows:
T_{f} = (t_{f} − t_{1} · V_{1} + t_{f} − t_{2} · V_{2}) / c_{w}.Sasha was upset that performing these calculations in his head is very difficult, so he asks for your help.
Input
The first line contains two integers N and Q — the number used to describe the number of vessels and the number of questions asked by Vadim (1 ≤ N ≤ 18, 1 ≤ Q ≤ 10^{5}).
The second line contains 2^{N} integers t_{i} separated by spaces — the temperatures of the juice in the vessels (0 ≤ t_{i} ≤ 10^{5}).
The next Q lines describe Vadim’s questions with two integers l_{j} and p_{j}, corresponding to the interval [l_{j}; l_{j} + 2^{pj} − 1] (1 ≤ l_{j} ≤ 2^{N}, 0 ≤ p_{j} ≤ N, l_{j} + 2^{pj} − 1 ≤ 2^{N}).
Output
Output Q numbers — the time taken to mix the juice according to Vadim’s algorithm, in seconds, in the order of input.
The answer will be accepted if the absolute or relative error of the values does not exceed 10^{−9}. Formally, let your answer be x, and the jury’s answer be y. Your answer is considered correct if x−y / max(1,y) ≤ 10^{−9}.
Sample
input  output 

2 2
1 2 3 4
2 1
1 2
 1.0
5.0

Problem Author: Vadim Barinov
Problem Source: Ural School Programming Contest 2022