/* * This template is valid both in C and in C++, * so you can expand it with code from both languages. */ #include #include // constraints #define MAXN 50000 // input data int N, V, i; int prices[MAXN], vouchers[MAXN]; 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(2 == scanf("%d %d", &N, &V)); for(i=0; i