每个位置当前最多可以发射几个火炮
import java.util.*;
public class Main {
private static int n, a, b;
private static int[] V, V2;
private static int[] h;
private static int ans = Integer.MAX_VALUE;
private static void dfs(int x, int times) {
if (times >= ans) {
return;
}
if (x == n) {
if (h[x] < 0) {
V2 = V.clone();
ans = times;
}
return;
}
for (int i = 0; i <= Math.max(h[x-1]/b+1, Math.max(h[x]/a+1, h[x+1]/b+1)); i++) {
if (h[x-1]<b*i) {
h[x-1] -= b*i;
h[x] -= a*i;
h[x+1] -= b*i;
V[x] = i;
dfs(x+1, times+i);
V[x] = 0;
h[x-1] += b*i;
h[x] += a*i;
h[x+1] += b*i;
}
}
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
n = in.nextInt();
a = in.nextInt();
b = in.nextInt();
h = new int[n+1];
V = new int[n+1];
for (int i = 1; i <= n; i++) {
h[i] = in.nextInt();
}
dfs(2, 0);
System.out.println(ans);
for (int i = 1; i < V2.length; i++) {
for (int j = 0; j < V2[i]; j++) {
System.out.print(i + " ");
}
}
System.out.print("\n");
}
}