#include <stdio.h>
void main(){
FILE *fp,*fp0;
int a,a0,a1,a2,b,b0=0,c,d,e,f,scor[50][2]={0};
float inde[50][4]={0};
fp=fopen("11.txt","r");
fp0=fopen("12.txt","w");
for (a=0;a<=21;a++){
fscanf(fp,"%d",&b);
if (a!=b) {
printf("\n%d\n",a);
break;
}
fscanf(fp,"%d",&a0);
for (a1=0;a1<a0;a1++)
fscanf(fp,"%d %d",&scor[b0+a1][0],&scor[b0+a1][1]);
for (a1=0;a1<a0;a1++){
fscanf(fp,"%d",&a2);
inde[b0][0]=(float)a2;
for (b=0;b<a2;b++){
fscanf(fp,"%d",&c);
inde[b0][1]=inde[b0][1]+c;
f=0;
for (d=0;d<c;d++){
fscanf(fp,"%d",&e);
inde[b0][2]=inde[b0][2]+e;
f=f+e;
}
inde[b0][3]+=1.0*f/c;
}
inde[b0][3]=inde[b0][3]/a2;
b0=b0+1;
}
}
for (a=0;a<50;a++){
for (b=0;b<4;b++)
fprintf(fp0,"%8.2f",inde[a][b]);
fprintf(fp0,"\n");
}
fclose(fp);
fclose(fp0);
}