V-Diagram
시간 제한1초메모리 제한2048 MB
V자 모양 수열이 주어질 때, 길이가 3 이상인 연속한 V자 모양 부분수열 중 평균이 최대인 것을 찾아 그 평균을 출력한다.
문제
A -indexed integer sequence of length is a V-diagram if and there exists an index () satisfying:
- for ;
- for .
Given a V-diagram , find a V-diagram with maximum average, satisfying that is a consecutive subsequence of .
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 (), denoting the number of test cases.
For each test case, the first line contains one integer (), denoting the length of the integer sequence .
The second line contains integers (), denoting the sequence .
It is guaranteed that is a V-diagram, and the sum of over all test cases does not exceed .
출력
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 .
Formally, let your answer be , and the jury's answer be . Your answer is accepted if and only if .