Example #1
0
int main()
{
  int t,i,j,k,n,s,m;
  scanf("%d",&t);
  pii p;
  
  while(t--){
    v.clear();
    scanf("%d",&n);
    for(i=0;i<n;i++){
      scanf("%d %d",&j,&k);
      v.push_back(ii(j,0));
      v.push_back(ii(k,1));      
    }

    sort(v.begin(),v.begin()+2*n);
    s=0,m=-SENTINEL;
    for(i=0;i<2*n;i++){
      p=v[i];
      if(p.second==0)s+=1;
      else s-=1;
      m=max(m,s);
    }
    printf("%d\n",m);
  }
  return 0;
}
int main()
{
    sive();
    int cas=0,t;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%lld %lld %lld",&a,&b,&l);
        v.clear();
        mem(a1,0);mem(b1,0);

        aprime=0;bprime=0;lprime=0;
        factor(a,0);
        factor(b,1);
        factor(l,2);

        ll ans=make();
        if(ans==-1) printf("Case %d: impossible\n",++cas);
        else printf("Case %d: %d\n",++cas,ans);
    }
    return 0;
}