#include using namespace std; int main(){ int N,X,Y,Z; cin>>N>>X>>Y>>Z; int *A = new int[N]; int i; for (i=0;i>A[i]; } for (i=0;i0){ if((X!=0)&&((A[i]>10000)||(A[i]>=5000*Y+1000*Z))){ X--; A[i]-=10000; }else{ if( (Y!=0) && ( (A[i]<5000*Y+1000*Z) || ((X==0)&&((A[i]>1000*Z)||(A[i]>=5000))) ) ){ Y--; A[i]-=5000; }else{ Z--; A[i]-=1000; } } } } if((X<0)&&(Y*Z==0)){ cout<<"No"<