#include<stdio.h> #include<string.h> #include<map> #include<algorithm> using namespace std; int main() { int C,N,x,k,h; int time; map<int ,int>m; map<int ,int>::iterator it; scanf("%d",&C); while(C--) { m.clear(); k=0;//记录不同的层数 scanf("%d",&N); for(int i=0;i<N;i++) { scanf("%d",&x); m[x]++; } for(it=m.begin();it!=m.end();it++) k++; it--; h=it->first;//最高层 //printf("%d%d%d\n",h,N,k); time=10*h+N+5*k; printf("%d\n",time); //for(it=m.begin();it!=it.end();it++) } return 0; }