import java.util.*; public class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main().run(); } void run() { int n = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextInt(); int z = sc.nextInt(); int[] arr = new int[n]; for (int i=0; i=10000) { int cnt = arr[i]/10000; int remain = arr[i]%10000; z -= cnt; arr[i] -= cnt*10000; if (remain==0) arr[i] += 1; } } Arrays.sort(arr); if (z>0) { label: for (int i=n-1; i>=0; i--) { arr[i] = 0; z--; if (z<=0) break label; } } label: for (int i=0; i=5000) { int cnt = arr[i]/5000; int remain = arr[i]%5000; y -= cnt; arr[i] -= cnt*5000; if (remain==0) arr[i] += 1; } } Arrays.sort(arr); if (y>0) { label: for (int i=n-1; i>=0; i--) { arr[i] = 0; y--; if (y<=0) break label; } } label: for (int i=0; i