#include #include #include using namespace std; int DP[11][11];//evolution,power int main() { int n; cin >> n; vectorS(n + 1); for (int i = 0; i < n+1; i++){ cin >> S[i]; } for (int i = 0; i < 11; i++)for (int j = 0; j < 11; j++)DP[i][j] = 1e7; DP[0][0] = 1; for (int i = 0; i < n+1; i++){ for (int j = 0; j <= S[S.size() - 1]; j++){ for (int k = 0; k <= S[S.size() - 1]; k++){ if (DP[i][j] == 1e7 || DP[i][k] == 1e7)continue; if(j+k+1<=S[i])DP[i][j + k + 1] = min(DP[i][j + k + 1], DP[i][j] + DP[i][k]); } } for (int j = 0; j <= S[i]; j++){ DP[i + 1][j] = DP[i][j] + DP[0][0]; } } for (int i = 0; i <=S[S.size() - 1]; i++){ if (i)cout << " "; cout << DP[n][i]; } cout << endl; return 0; }