#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main() {
    float n, m, x, MAX = 0, max , cnt;
    bool have = false;
    ifstream fin("starzi.in");
    ofstream fout("strazi.out");
    cin >> n;
    for(int i = 1; i <= n ; i++) {
        cin >> m;
        max = 0; cnt = 0;
        for(int j = 1; j <= m; j++) {
             cin >> x;
            if(x > max) {
                cnt++;
                max = x;
            }
        }
       	cout << fixed << setprecision(3) << (double)cnt / m;
        cout << '\n';
        if(cnt / m == 1 && !have) {
            MAX = i;
            have = true;
        }
    }
    cout << (int)MAX;
}
