1050 Moving Tables

来源:互联网 发布:mysql的having max函数 编辑:程序博客网 时间:2024/05/17 23:38
 #include<iostream>
using namespace std;
main()
{
 int t,i,j,N,P[200];
 int s,d,temp,k,min;
 cin>>t;
 for(i=0;i<t;i++)
 {
  for(j=0;j<200;j++)
   P[j]=0;
  cin>>N;
  for(j=0;j<N;j++)
  {
   cin>>s>>d;
   s=(s-1)/2;
   d=(d-1)/2;
   if(s>d)
   {
    temp=s;
    s=d;
    d=temp;
   }
   for(k=s;k<=d;k++)
    P[k]++;
  }
  min=-1;
  for(j=0;j<200;j++)
   if(P[j]>min)
    min=P[j];
   cout<<min*10<<endl;
 }
}