#includecstdio #includealgorithm #includestring #includecstring using namespace std ; int a [ 600 ]; int main () { int t ; scanf ( "%d" , t ); while ( t -- ){ int n ; scanf ( "%d" , n ); memset ( a , 0 , sizeof ( a )); while ( n -- ){ int x
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int a[600];
int main()
{
int t;
scanf("%d",&t);
while(t--){
int n;
scanf("%d",&n);
memset(a,0,sizeof(a));
while(n--){
int x,y;
scanf("%d%d",&x,&y);
a[x]+=y;
}
int p1=0,p2=0;
for(int i=1;i<=500;i++)
{
p1 = a[i]/64 + (a[i]%64!=0);
// printf("%d\n",p1);
p2 += p1;
}
// printf("%d\n",p2);
printf("%d\n",p2/36 + (p2%36!=0) );
}
return 0;
}