#include using namespace std; const int MAX=100; int Start[MAX], End[MAX], p, Parties[48]; void PrintParties(){ for(int i=0;i-1 && End[j]>x){ End[j+1] = End[j]; Start[j+1] = Start[j]; j--; } End[j+1] = x; Start[j+1] = y; } } int SortOnStart(){ int j, x, y; for(int i=1;i-1 && Start[j]>x){ End[j+1] = End[j]; Start[j+1] = Start[j]; j--; } End[j+1] = y; Start[j+1] = x; } } void GetParties(){ int s,e; for(int i=0;i>s>>e; End[i]=2*e; Start[i]=2*s; } } int CountParties(){ for(int i=0;i<48;i++) Parties[i]=0; for(int i=0;i>p; while(p>0){ GetParties(); SortOnStart(); SortOnEnd(); c = CountParties(); cout<<"On day "<>p; } return 0; }