#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPGlvbWFuaXA+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkgewogICAgZmxvYXQgbiwgbSwgeCwgTUFYID0gMCwgbWF4ICwgY250OwogICAgYm9vbCBoYXZlID0gZmFsc2U7CiAgICBpZnN0cmVhbSBmaW4oInN0YXJ6aS5pbiIpOwogICAgb2ZzdHJlYW0gZm91dCgic3RyYXppLm91dCIpOwogICAgY2luID4+IG47CiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG4gOyBpKyspIHsKICAgICAgICBjaW4gPj4gbTsKICAgICAgICBtYXggPSAwOyBjbnQgPSAwOwogICAgICAgIGZvcihpbnQgaiA9IDE7IGogPD0gbTsgaisrKSB7CiAgICAgICAgICAgICBjaW4gPj4geDsKICAgICAgICAgICAgaWYoeCA+IG1heCkgewogICAgICAgICAgICAgICAgY250Kys7CiAgICAgICAgICAgICAgICBtYXggPSB4OwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgCWNvdXQgPDwgZml4ZWQgPDwgc2V0cHJlY2lzaW9uKDMpIDw8IChkb3VibGUpY250IC8gbTsKICAgICAgICBjb3V0IDw8ICdcbic7CiAgICAgICAgaWYoY250IC8gbSA9PSAxICYmICFoYXZlKSB7CiAgICAgICAgICAgIE1BWCA9IGk7CiAgICAgICAgICAgIGhhdmUgPSB0cnVlOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgKGludClNQVg7Cn0K