Idea: This is really a water question=-=
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t; cin>>t;
while(t--){
double count1 = 0;
int n; cin>>n; getchar();
for(int i=0;i<n;i++){
string s; getline(cin,s);
if(s.find('2')!=-1) count1++;
}
double ans=count1/n;
cout<<ans<<endl;
}
return 0;
}