#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main() {
double n, m, x, MAX = 0, max , cnt, maxprob = 0;
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((double)x > (double)max) {
cnt++;
max = x;
}
}
cout << fixed << setprecision(3) << (double)cnt / m;
cout << '\n';
if(cnt / m > maxprob) {
MAX = i;
maxprob = cnt / m;
}
}
cout << (int)MAX;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPGlvbWFuaXA+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkgewogICAgZG91YmxlIG4sIG0sIHgsIE1BWCA9IDAsIG1heCAsIGNudCwgbWF4cHJvYiA9IDA7CiAgICBpZnN0cmVhbSBmaW4oInN0YXJ6aS5pbiIpOwogICAgb2ZzdHJlYW0gZm91dCgic3RyYXppLm91dCIpOwogICAgY2luID4+IG47CiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG4gOyBpKyspIHsKICAgICAgICBjaW4gPj4gbTsKICAgICAgICBtYXggPSAwOyBjbnQgPSAwOwogICAgICAgIGZvcihpbnQgaiA9IDE7IGogPD0gbTsgaisrKSB7CiAgICAgICAgICAgICBjaW4gPj4geDsKICAgICAgICAgICAgaWYoKGRvdWJsZSl4ID4gKGRvdWJsZSltYXgpIHsKICAgICAgICAgICAgICAgIGNudCsrOwogICAgICAgICAgICAgICAgbWF4ID0geDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICAgICBjb3V0IDw8IGZpeGVkIDw8IHNldHByZWNpc2lvbigzKSA8PCAoZG91YmxlKWNudCAvIG07CiAgICAgICAgY291dCA8PCAnXG4nOwogICAgICAgIGlmKGNudCAvIG0gPiBtYXhwcm9iKSB7CiAgICAgICAgICAgIE1BWCA9IGk7CiAgICAgICAgICAgIG1heHByb2IgPSBjbnQgLyBtOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgKGludClNQVg7Cn0K