Moving Tables
#include<stdio.h>
#include<string.h>
#define N 210
int room[N];
void swap(int &a,int &b){
int c;
c = a;
a = b;
b = c;
}
int main(){
int i,j,n,t,a,b;
scanf("%d",&t);
while(t--){
scanf("%d",&n); memset(room, 0, sizeof(room));int min = 0;
for(i=0;i<n;i++){
scanf("%d%d",&a,&b);
a = (a -1)/2;
b = (b -1)/2;
if(a>b)
{
swap(a,b);
}
for(j = a;j<=b;j++){
room[j]++;
if(room[j]>min)
min = room[j];
}
}printf("%d\n",min*10);
}
return 0;
}