시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB32161463.636%

문제

A $1$-indexed integer sequence $a$ of length $n$ is a V-diagram if $n\ge 3$ and there exists an index $i$ ($1< i< n$) satisfying:

  • $a_j>a_{j+1}$ for $1\le j<i$;
  • $a_j>a_{j-1}$ for $i<j\le n$.

Given a V-diagram $a$, find a V-diagram $b$ with maximum average, satisfying that $b$ is a consecutive subsequence of $a$.

Note that a consecutive subsequence of a sequence can be obtained by removing some (possibly zero) elements from the beginning and end of the sequence.

입력

Each test contains multiple test cases. The first line contains a single integer $t$ ($1\le t\le 10^5$), denoting the number of test cases.

For each test case, the first line contains one integer $n$ ($3\le n\le 3\cdot10^5$), denoting the length of the integer sequence $a$.

The second line contains $n$ integers $a_1,a_2,\cdots,a_n$ ($1\le a_i\le10^9$), denoting the sequence $a$.

It is guaranteed that $a$ is a V-diagram, and the sum of $n$ over all test cases does not exceed $3\cdot 10^5$.

출력

For each test case, output a real number denoting the maximum of the average.

Your answer is considered correct if its absolute or relative error does not exceed $10^{-9}$.

Formally, let your answer be $x$, and the jury's answer be $y$. Your answer is accepted if and only if $\frac{|x-y|}{\max(1,|y|)}\le 10^{-9}$.

예제 입력 1

2
4
8 2 7 10
6
9 6 5 3 4 8

예제 출력 1

6.75000000000000000000
5.83333333333333303727