#include #include using namespace atcoder; using mint=modint; using namespace std; #define rep(i, N) for(i = 0; i < N; i++) #define ll long long /* テスト */ bool test = 0; /*------------焼きなまし------------*/ float TIME_LIMIT=0.995/*[秒]*/; int end_time=TIME_LIMIT*CLOCKS_PER_SEC; int now_time=0; float start_temp=100.0; float end_temp=1.0; float temp,prob; random_device rd; mt19937 gen(rd()); uniform_int_distribution disi(0, 49); uniform_real_distribution disf(0.0, 1.0); int rand_int(void){return disi(gen);} float rand_float(void){return disf(gen);} /*minimize*/ bool simulated_annealing(int now_score,int next_score){ if(now_score>next_score)return 1; temp=start_temp+(end_temp-start_temp)*now_time/end_time; prob=exp((now_score-next_score)/temp); if(prob>rand_float())return 1; return 0; } /*------------------------------------*/ /*-------------パラメータ-------------*/ /* 高さ */ ll N = 50; /* 目標 */ mint A[50][50]; /* ピラミッド */ mint P[50][50]; /*------------------------------------*/ /*---------------入出力---------------*/ /* 入力 */ void input(void) { ll i, j; cin >> N; rep(i, N) rep(j, i + 1) { ll a; cin >> a; A[i][j] = a; } } /* 出力 */ void output(void) { ll i; rep(i, N) cout << P[49][i].val() << " "; cout << endl; } /*------------------------------------*/ /* 状態の計算 */ ll cal(vector& v) { ll i, j; rep(i, N) { P[N - 1][i] = v[i]; } for(i = N - 2; 0 <= i; i--) { rep(j, i + 1) { P[i][j] = P[i + 1][j] + P[i + 1][j + 1]; } } ll score = 0; rep(i, N) { rep (j, i + 1) { ll diff = A[i][j].val() - P[i][j].val(); diff = max(diff, -diff); diff = min(diff, 100'000'000 - diff); score += diff; } } return score; } /*解く*/ void solve(void){ vectorv(50, 0); ll now = cal(v), next; while(now_time 1 && string(argv[1]) == "eevee") { test = 1; } /*main関数内で使用,modを設定*/ int mod=100'000'000; mint::set_mod(mod); input(); solve(); output(); return 0; }