#include #include #include #include using namespace std; bool flag[50]; struct time { int start; int end; bool operator <(const time a)const { if(a.end==end) return a.startQ; int i,n,j=0,t; while(++j) { memset(flag,false,sizeof(flag)); scanf("%d",&n); if(!n) return 0; for(i=0;i