#include #include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); }; // } ; } fio; bool solve(){ int N, X, Y, Z; int sum = 0, con = 0; vector A; vector> B; bool flag = true; cin>>N>>X>>Y>>Z; A.resize(N); B.resize(N); for(int i = 0; i < N; i++){ cin>>A[i]; A[i]++; sum += A[i]; con += A[i] / 10000; B[i] = {A[i] % 10000, A[i]}; } if(sum > X * 1000 + Y * 5000 + Z * 10000){ return false; // flag = false; } // cout<<"con = "<= 5 && con) { Y--; X -= 5; con--; } c = min(X/10, con); X -= c * 10; con -= c; } // cout<<"con = "<