/* * This template is valid both in C and in C++, * so you can expand it with code from both languages. * NOTE: it is recommended to use this even if you don't * understand the following code. */ #include #include // constraints #define MAXD 500000 #define MAXP 500000 #define MAXE 500000 // input data int D, P, E, i; int A[MAXD+MAXP]; int T[MAXE], ID[MAXE]; int main() { // uncomment the following lines if you want to read/write from files // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); assert(3 == scanf("%d%d%d", &D, &P, &E)); for(i=0; i