QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#762626#8225. 最小值之和rizynvu39 12ms11092kbC++143.4kb2024-11-19 15:54:202024-11-19 15:54:28

Judging History

你现在查看的是最新测评结果

  • [2024-11-19 15:54:28]
  • 评测
  • 测评结果:39
  • 用时:12ms
  • 内存:11092kb
  • [2024-11-19 15:54:20]
  • 提交

answer

#include<bits/stdc++.h>
using ll = long long;
inline void fmax(ll &x, ll y) {
   x < y && (x = y);
}
inline void fmax(ll &x, ll y, int &xp, int yp) {
   x < y && (x = y, xp = yp);
}
inline int exgcd(int a, int b, ll &x, ll &y) {
   if (! b) {
      x = 1, y = 0;
      return a;
   }
   int g = exgcd(b, a % b, y, x);
   y -= 1ll * a / b * x;
   return g;
}
constexpr int maxn = 80 + 5;
int n;
ll a[maxn], mn[maxn][maxn], b[maxn];
ll f[maxn][maxn][maxn], h[maxn];
int fp[maxn][maxn][maxn];
void dfs(int l, int r, ll x) {
   if (l == r) return ;
   int len = r - l, z = x % len;
   ll y = f[l][r][z];
   for (int i = l; i < r; i++) {
      b[i] += (y - x) / (r - l);
   }
   dfs(l, fp[l][r][z], y), dfs(fp[l][r][z] + 1, r, y);
}
int main() {
   scanf("%d", &n);
   for (int i = 1; i <= n; i++) {
      scanf("%lld", &a[i]), mn[i][i] = a[i];
   }
   for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
         mn[i][j] = std::min(mn[i][j - 1], a[j]);
      }
   }
   if (n == 1) {
      puts(a[1] == 0 ? "Yes" : "No");
      return 0;
   }
   memset(f, -1, sizeof(f));
   for (int len = 1; len < n; len++) {
      for (int l = 1, r = len + 1; r <= n; l++, r++) {
         for (int p = l; p < r; p++) {
            int L = p - l, R = r - (p + 1);
            if (! L && ! R) {
               if (a[l] == a[r]) {
                  fmax(f[l][r][0], a[l], fp[l][r][0], p);
               }
            } else if (! L) {
               if (f[p + 1][r][a[l] % R] >= a[l]) {
                  fmax(f[l][r][a[l] % len], a[l], fp[l][r][a[l] % len], p);
               }  
            } else if (! R) {
               if (f[l][p][a[r] % L] >= a[r]) {
                  fmax(f[l][r][a[r] % len], a[r], fp[l][r][a[r] % len], p);
               }
            } else {
               ll x, y; int g = exgcd(L, R, x, y);
               y = -y;
               assert(x * L + y * -R == g);
               int z = L * R / g;
               memset(h, -1, sizeof(ll) * len);
               for (int a = 0; a < L; a++) {
                  for (int b = 0; b < R; b++) {
                     ll fl = f[l][p][a], fr = f[p + 1][r][b];
                     if (fl == -1 || fr == -1) continue;
                     if ((fl - fr) % g) continue;
                     ll val = (fl - fr) / g;
                     ll fx = x * val, fy = y * val;
                     fy = (fy % z + z) % z;
                     ll F = fr - fy * R;
                     if (F < 0) continue;
                     fmax(h[F % len], F);
                  }
               }
               for (int i = 0, ed = std::__gcd(z, len); i < ed; i++) {
                  for (int j = i, c = 0; c < 2; (j += len - z % len) %= len, c += j == i) {
                     fmax(h[(j + len - z % len) % len], h[j] - z);
                  }
               }
               int lcm = z * len / std::__gcd(z, len);
               for (int i = 0; i < len; i++) {
                  ll d = h[i] - mn[l][r];
                  if (d > 0) {
                     ll c = (d + lcm - 1) / lcm;
                     h[i] -= c * lcm;
                  }
                  assert(h[i] <= mn[l][r]);
                  fmax(f[l][r][i], h[i], fp[l][r][i], p);
               }
            }
         }
      }
   }
   if (f[1][n][0] == -1) {
      return puts("No"), 0;
   }
   puts("Yes");
   dfs(1, n, 0);
   for (int i = 1; i < n; i++) {
      printf("%lld ", b[i]);
   }
   return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 2ms
memory: 10584kb

input:

5
14 14 12 13 13

output:

Yes
5 3 3 4 

result:

ok The answer is correct.

Test #2:

score: 11
Accepted
time: 1ms
memory: 10224kb

input:

5
4 4 7 7 4

output:

Yes
1 1 4 1 

result:

ok The answer is correct.

Test #3:

score: 11
Accepted
time: 2ms
memory: 9288kb

input:

5
4 13 14 14 13

output:

Yes
1 4 5 4 

result:

ok The answer is correct.

Test #4:

score: 11
Accepted
time: 0ms
memory: 9904kb

input:

5
11 11 10 5 5

output:

Yes
5 4 1 2 

result:

ok The answer is correct.

Test #5:

score: 11
Accepted
time: 2ms
memory: 9776kb

input:

5
10 10 10 4 4

output:

Yes
4 4 1 1 

result:

ok The answer is correct.

Test #6:

score: 11
Accepted
time: 2ms
memory: 9740kb

input:

5
20 20 17 7 4

output:

Yes
10 7 2 1 

result:

ok The answer is correct.

Test #7:

score: 11
Accepted
time: 0ms
memory: 11092kb

input:

5
12 12 16 19 19

output:

Yes
3 3 5 8 

result:

ok The answer is correct.

Test #8:

score: 11
Accepted
time: 0ms
memory: 10960kb

input:

5
2 2 6 11 11

output:

Yes
2 0 3 8 

result:

ok The answer is correct.

Test #9:

score: 11
Accepted
time: 1ms
memory: 10124kb

input:

5
10 10 8 5 5

output:

Yes
5 3 1 2 

result:

ok The answer is correct.

Test #10:

score: 11
Accepted
time: 1ms
memory: 10260kb

input:

5
24 24 28 28 26

output:

Yes
6 6 9 7 

result:

ok The answer is correct.

Test #11:

score: 11
Accepted
time: 1ms
memory: 10504kb

input:

5
5 5 22 31 31

output:

Yes
2 1 10 19 

result:

ok The answer is correct.

Test #12:

score: 11
Accepted
time: 1ms
memory: 10260kb

input:

5
8 33 38 38 29

output:

Yes
2 11 16 9 

result:

ok The answer is correct.

Test #13:

score: 11
Accepted
time: 1ms
memory: 9212kb

input:

5
16 16 4 12 12

output:

Yes
13 1 1 9 

result:

ok The answer is correct.

Test #14:

score: 11
Accepted
time: 1ms
memory: 10624kb

input:

5
29 29 24 26 26

output:

Yes
11 6 6 8 

result:

ok The answer is correct.

Test #15:

score: 11
Accepted
time: 0ms
memory: 10576kb

input:

5
0 33 33 32 32

output:

Yes
0 13 10 12 

result:

ok The answer is correct.

Test #16:

score: 11
Accepted
time: 0ms
memory: 10100kb

input:

5
20 16 8 25 22

output:

No

result:

ok The answer is correct.

Test #17:

score: 11
Accepted
time: 1ms
memory: 9024kb

input:

5
0 2 3 0 2

output:

No

result:

ok The answer is correct.

Test #18:

score: 11
Accepted
time: 0ms
memory: 8968kb

input:

5
28 23 29 29 24

output:

No

result:

ok The answer is correct.

Test #19:

score: 11
Accepted
time: 0ms
memory: 9168kb

input:

5
0 1 0 4 2

output:

No

result:

ok The answer is correct.

Test #20:

score: 11
Accepted
time: 1ms
memory: 8944kb

input:

5
12 21 21 13 4

output:

No

result:

ok The answer is correct.

Test #21:

score: 11
Accepted
time: 1ms
memory: 10272kb

input:

5
9 22 25 23 12

output:

No

result:

ok The answer is correct.

Test #22:

score: 11
Accepted
time: 1ms
memory: 10272kb

input:

5
6 7 7 6 6

output:

Yes
2 3 1 3 

result:

ok The answer is correct.

Test #23:

score: 11
Accepted
time: 1ms
memory: 10588kb

input:

5
25 25 24 20 20

output:

Yes
8 7 5 5 

result:

ok The answer is correct.

Test #24:

score: 11
Accepted
time: 1ms
memory: 10312kb

input:

5
17 9 8 16 9

output:

No

result:

ok The answer is correct.

Test #25:

score: 11
Accepted
time: 1ms
memory: 9536kb

input:

5
20 5 34 34 23

output:

No

result:

ok The answer is correct.

Test #26:

score: 11
Accepted
time: 1ms
memory: 10584kb

input:

5
15 33 35 35 31

output:

No

result:

ok The answer is correct.

Test #27:

score: 11
Accepted
time: 0ms
memory: 8820kb

input:

5
21 22 23 1 18

output:

No

result:

ok The answer is correct.

Test #28:

score: 11
Accepted
time: 0ms
memory: 9468kb

input:

5
4 2 3 4 2

output:

No

result:

ok The answer is correct.

Test #29:

score: 11
Accepted
time: 0ms
memory: 9188kb

input:

5
16 25 8 19 7

output:

No

result:

ok The answer is correct.

Test #30:

score: 11
Accepted
time: 1ms
memory: 9896kb

input:

5
4 0 8 6 6

output:

No

result:

ok The answer is correct.

Test #31:

score: 11
Accepted
time: 0ms
memory: 9680kb

input:

2
2 3

output:

No

result:

ok The answer is correct.

Test #32:

score: 11
Accepted
time: 1ms
memory: 9156kb

input:

2
2 2

output:

Yes
2 

result:

ok The answer is correct.

Test #33:

score: 11
Accepted
time: 0ms
memory: 3784kb

input:

1
0

output:

Yes

result:

ok The answer is correct.

Test #34:

score: 11
Accepted
time: 0ms
memory: 3828kb

input:

1
233

output:

No

result:

ok The answer is correct.

Subtask #2:

score: 15
Accepted

Dependency #1:

100%
Accepted

Test #35:

score: 15
Accepted
time: 0ms
memory: 9480kb

input:

8
16 16 8 8 9 9 6 6

output:

Yes
16 0 4 1 5 1 2 

result:

ok The answer is correct.

Test #36:

score: 15
Accepted
time: 0ms
memory: 9144kb

input:

8
16 16 9 21 21 23 23 23

output:

Yes
10 1 2 14 1 9 9 

result:

ok The answer is correct.

Test #37:

score: 15
Accepted
time: 0ms
memory: 9608kb

input:

8
10 10 15 15 15 10 10 5

output:

Yes
10 0 5 5 2 3 1 

result:

ok The answer is correct.

Test #38:

score: 15
Accepted
time: 1ms
memory: 9252kb

input:

8
13 13 15 15 24 24 24 10

output:

Yes
7 1 9 1 9 9 2 

result:

ok The answer is correct.

Test #39:

score: 15
Accepted
time: 1ms
memory: 8836kb

input:

8
5 13 16 25 25 24 4 4

output:

Yes
1 3 4 9 8 0 4 

result:

ok The answer is correct.

Test #40:

score: 15
Accepted
time: 2ms
memory: 9664kb

input:

8
1313 1695 1695 1129 1129 711 557 557

output:

Yes
459 841 79 575 157 80 80 

result:

ok The answer is correct.

Test #41:

score: 15
Accepted
time: 1ms
memory: 10100kb

input:

8
1386 1416 1416 1069 1069 390 645 645

output:

Yes
558 588 54 736 57 57 312 

result:

ok The answer is correct.

Test #42:

score: 15
Accepted
time: 1ms
memory: 9344kb

input:

8
3377 3377 3164 3164 3570 3570 3365 3365

output:

Yes
665 452 452 452 724 519 519 

result:

ok The answer is correct.

Test #43:

score: 15
Accepted
time: 2ms
memory: 9884kb

input:

8
28167709 33181201 33829300 33829300 21924091 26145199 28398185 28398185

output:

Yes
5213219 7719965 8368064 3132013 3132013 5242567 7495553 

result:

ok The answer is correct.

Test #44:

score: 15
Accepted
time: 1ms
memory: 10272kb

input:

8
4726918 12793592 12793592 6681214 13995142 22020836 22566624 22566624

output:

Yes
675274 7113368 1000990 1000990 3438966 7451813 7997601 

result:

ok The answer is correct.

Test #45:

score: 15
Accepted
time: 0ms
memory: 9644kb

input:

8
9146297 15736298 15736298 16471005 16471005 14187656 14187656 6001415

output:

Yes
2429786 9019787 857345 11326935 857345 9043586 857345 

result:

ok The answer is correct.

Test #46:

score: 15
Accepted
time: 0ms
memory: 9900kb

input:

8
25115296 25115296 22120670 21035156 20603135 28703897 28703897 27553199

output:

Yes
6624695 3630069 3087312 2943305 2943305 7569035 6418337 

result:

ok The answer is correct.

Test #47:

score: 15
Accepted
time: 0ms
memory: 10168kb

input:

8
22440147 22440147 22626721 22626721 22592252 22592252 19174074 19174074

output:

Yes
6005229 2739153 6191803 2739153 6157332 2739154 2739154 

result:

ok The answer is correct.

Test #48:

score: 15
Accepted
time: 1ms
memory: 10880kb

input:

8
12 0 13 8 18 18 18 0

output:

No

result:

ok The answer is correct.

Test #49:

score: 15
Accepted
time: 0ms
memory: 9428kb

input:

8
3 23 13 18 26 12 25 25

output:

No

result:

ok The answer is correct.

Test #50:

score: 15
Accepted
time: 1ms
memory: 9696kb

input:

8
1353255 1004808 981534 1400692 1246708 409750 1177255 1177255

output:

No

result:

ok The answer is correct.

Test #51:

score: 15
Accepted
time: 1ms
memory: 10420kb

input:

8
96 96 99 99 4 94 39 36

output:

No

result:

ok The answer is correct.

Test #52:

score: 15
Accepted
time: 1ms
memory: 10832kb

input:

8
15 21 0 20 20 15 13 6

output:

No

result:

ok The answer is correct.

Test #53:

score: 15
Accepted
time: 0ms
memory: 9584kb

input:

8
2 1 0 2 6 6 5 1

output:

No

result:

ok The answer is correct.

Test #54:

score: 15
Accepted
time: 0ms
memory: 9460kb

input:

8
7 12 11 11 1 11 4 11

output:

No

result:

ok The answer is correct.

Test #55:

score: 15
Accepted
time: 2ms
memory: 8976kb

input:

8
18 3 27 27 19 10 6 6

output:

No

result:

ok The answer is correct.

Subtask #3:

score: 13
Accepted

Dependency #2:

100%
Accepted

Test #56:

score: 13
Accepted
time: 1ms
memory: 10096kb

input:

14
10 10 2 30 45 50 50 47 47 47 46 33 33 32

output:

Yes
9 1 0 3 8 12 9 3 12 11 3 5 4 

result:

ok The answer is correct.

Test #57:

score: 13
Accepted
time: 2ms
memory: 10076kb

input:

14
0 19 19 16 16 4 0 36 36 36 36 31 31 26

output:

Yes
0 19 0 14 2 0 0 16 4 16 4 10 5 

result:

ok The answer is correct.

Test #58:

score: 13
Accepted
time: 1ms
memory: 9420kb

input:

14
37 38 38 37 28 27 27 28 28 10 17 17 12 4

output:

Yes
10 11 10 7 0 27 0 28 0 3 9 4 1 

result:

ok The answer is correct.

Test #59:

score: 13
Accepted
time: 1ms
memory: 10112kb

input:

14
13 27 33 33 30 30 31 31 20 20 25 25 24 24

output:

Yes
1 8 14 1 14 2 15 2 4 1 7 4 6 

result:

ok The answer is correct.

Test #60:

score: 13
Accepted
time: 0ms
memory: 10520kb

input:

14
50 50 52 52 54 60 62 62 62 33 33 28 34 34

output:

Yes
26 2 28 2 9 11 12 12 2 9 2 3 9 

result:

ok The answer is correct.

Test #61:

score: 13
Accepted
time: 2ms
memory: 10708kb

input:

14
5123 5321 5321 5600 5600 5161 5537 5537 5359 4679 4679 4128 4128 3029

output:

Yes
1280 1478 233 2804 233 725 1002 824 561 571 233 1332 233 

result:

ok The answer is correct.

Test #62:

score: 13
Accepted
time: 0ms
memory: 10436kb

input:

14
340 2315 2315 2251 2251 1200 1366 1366 2831 2831 2864 2864 2812 2680

output:

Yes
27 2002 26 1939 26 139 305 132 589 429 550 498 432 

result:

ok The answer is correct.

Test #63:

score: 13
Accepted
time: 1ms
memory: 10724kb

input:

14
681 810 2276 2390 2390 1189 2424 2424 2031 1180 2548 2620 2620 221

output:

Yes
132 175 908 1022 17 157 971 578 154 154 838 910 17 

result:

ok The answer is correct.

Test #64:

score: 13
Accepted
time: 2ms
memory: 9760kb

input:

14
37026886 40993600 44483477 44483477 41071802 57414984 57414984 60000010 60000010 64898381 64898381 63120240 63120240 58440430

output:

Yes
2848222 3178789 6668666 3178780 3187475 19530657 3187470 7641823 6082243 12540194 6082243 10762053 6082243 

result:

ok The answer is correct.

Test #65:

score: 13
Accepted
time: 0ms
memory: 10836kb

input:

14
49671403 50230564 50230564 63423001 63423001 62198273 62452752 62452752 44987219 48671053 49604115 49604115 20314360 20314360

output:

Yes
16241165 16800326 1562643 24932997 6497215 15102742 15357221 6497215 1562643 15740990 16674052 1562643 1562644 

result:

ok The answer is correct.

Test #66:

score: 13
Accepted
time: 1ms
memory: 9500kb

input:

14
17008521 17008521 17440120 44338597 44338597 42528453 45138523 45138523 43354927 34182290 34182290 33775196 33775196 32314840

output:

Yes
1308360 1308347 1362300 28260777 1362298 9725077 11921910 10138314 1362298 18104472 1308346 10421873 8961517 

result:

ok The answer is correct.

Test #67:

score: 13
Accepted
time: 1ms
memory: 9332kb

input:

14
17784224 17784224 16246661 3452639 30562832 30928394 31034175 31034175 17501619 21436456 21436456 5363633 5661668 5661668

output:

Yes
8200165 6662602 265587 265589 9302320 9485101 9590882 265587 6716781 10651618 647787 647788 945823 

result:

ok The answer is correct.

Test #68:

score: 13
Accepted
time: 1ms
memory: 10508kb

input:

14
69235639 69235639 68987597 68987597 57039158 57039158 55926434 63346321 63346321 66237443 66237443 64858399 62617841 60839024

output:

Yes
17611255 4302032 17363203 4302033 5414764 4302033 4302034 7628096 5120799 8213061 6834017 5713738 5120799 

result:

ok The answer is correct.

Test #69:

score: 13
Accepted
time: 1ms
memory: 9972kb

input:

14
87 74 86 89 86 79 79 14 37 9 33 33 38 38

output:

No

result:

ok The answer is correct.

Test #70:

score: 13
Accepted
time: 1ms
memory: 10012kb

input:

14
8 10 24 23 23 19 31 30 15 16 2 23 34 27

output:

No

result:

ok The answer is correct.

Test #71:

score: 13
Accepted
time: 1ms
memory: 10660kb

input:

14
72 72 72 64 72 62 15 15 42 42 6 26 43 25

output:

No

result:

ok The answer is correct.

Test #72:

score: 13
Accepted
time: 1ms
memory: 10672kb

input:

14
124 125 103 108 120 120 121 127 130 130 69 43 48 48

output:

No

result:

ok The answer is correct.

Test #73:

score: 13
Accepted
time: 2ms
memory: 10232kb

input:

14
18 3 16 11 11 24 24 25 25 10 14 17 13 10

output:

No

result:

ok The answer is correct.

Test #74:

score: 13
Accepted
time: 0ms
memory: 9712kb

input:

14
1432833 514825 398091 1958543 1337446 1729822 2090128 1970313 1970313 2487044 1900924 2317778 425241 425241

output:

No

result:

ok The answer is correct.

Test #75:

score: 13
Accepted
time: 2ms
memory: 10188kb

input:

14
24 3 0 31 31 23 9 15 21 25 21 25 27 27

output:

No

result:

ok The answer is correct.

Test #76:

score: 13
Accepted
time: 0ms
memory: 9704kb

input:

14
27 46 64 56 68 68 68 13 74 74 74 51 26 55

output:

No

result:

ok The answer is correct.

Subtask #4:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #77:

score: 25
Accepted
time: 10ms
memory: 9716kb

input:

49
28 28 28 24 37 37 33 36 36 29 43 43 41 41 29 48 51 51 44 49 50 50 9 9 15 18 18 3 17 17 9 13 17 17 13 13 0 6 6 16 21 25 25 19 7 19 19 17 4

output:

Yes
14 14 0 4 13 5 7 10 5 0 23 2 21 2 3 8 11 6 5 9 10 0 9 0 7 10 1 0 17 0 3 5 9 0 13 0 0 6 0 4 6 10 5 0 2 9 7 1 

result:

ok The answer is correct.

Test #78:

score: 25
Accepted
time: 11ms
memory: 10992kb

input:

49
3 3 29 29 31 31 34 34 34 34 31 22 22 21 21 21 36 36 37 42 42 41 22 22 6 6 19 37 65 71 71 77 78 78 76 76 42 46 46 40 60 60 60 60 60 60 6 6 4

output:

Yes
3 0 29 0 31 0 34 0 13 10 1 10 1 2 2 2 9 4 6 9 8 0 22 0 6 0 4 10 24 30 1 36 37 0 76 0 7 11 4 6 26 4 12 12 12 0 4 2 

result:

ok The answer is correct.

Test #79:

score: 25
Accepted
time: 7ms
memory: 9420kb

input:

49
18 18 18 16 16 59 61 64 64 57 57 78 78 78 78 81 92 92 92 92 89 81 47 64 64 63 59 65 65 63 52 52 34 34 33 8 13 13 17 17 14 16 19 19 13 13 18 18 18

output:

Yes
4 4 3 1 2 11 12 15 10 11 0 68 1 22 7 10 21 10 17 14 10 5 0 19 18 3 11 15 13 4 18 3 4 3 0 4 9 0 6 3 1 4 7 1 4 1 5 5 

result:

ok The answer is correct.

Test #80:

score: 25
Accepted
time: 12ms
memory: 10616kb

input:

50
43 47 47 42 42 41 51 51 57 62 62 61 58 58 67 67 68 68 63 68 68 67 71 71 76 76 76 76 76 76 48 48 48 48 36 36 33 33 4 8 8 6 6 11 11 3 3 10 10 10

output:

Yes
9 13 1 16 1 4 14 3 9 12 11 1 8 8 17 3 13 8 8 13 1 9 13 7 12 11 12 0 52 3 24 3 20 4 8 4 5 0 2 6 0 6 0 11 0 3 0 5 5 

result:

ok The answer is correct.

Test #81:

score: 25
Accepted
time: 6ms
memory: 10840kb

input:

49
12 14 14 16 16 10 18 32 32 30 30 0 0 5 5 4 0 9 9 18 18 18 30 41 43 43 39 39 35 24 26 27 27 6 6 13 13 19 22 22 21 21 44 44 43 43 33 33 31

output:

Yes
6 8 0 16 0 2 4 10 8 8 0 0 0 3 2 0 0 9 0 9 9 0 4 7 9 6 6 5 3 1 9 10 0 6 0 1 1 4 7 1 2 2 20 3 16 4 6 4 

result:

ok The answer is correct.

Test #82:

score: 25
Accepted
time: 9ms
memory: 10552kb

input:

48
13 13 11 3 36 40 40 40 36 35 35 30 18 18 33 33 33 23 20 20 17 19 20 20 0 10 31 31 28 30 30 5 16 16 13 12 12 36 39 39 37 37 25 25 26 26 7 7

output:

Yes
7 5 1 0 9 11 11 9 0 20 15 0 8 1 9 9 4 2 5 2 1 5 6 0 0 5 26 0 14 16 0 1 7 4 2 5 0 10 13 4 17 4 5 0 22 2 3 

result:

ok The answer is correct.

Test #83:

score: 0
Wrong Answer
time: 10ms
memory: 10132kb

input:

49
72 72 71 33 98 98 89 89 174 174 163 163 170 170 82 98 98 202 202 179 164 282 299 299 316 316 300 262 250 250 236 154 140 148 150 150 148 148 131 95 95 106 106 108 108 81 78 78 51

output:

Yes
24 23 1 4 69 2 21 21 106 2 93 10 100 10 11 27 0 98 75 1 28 87 104 4 85 69 50 12 69 55 14 3 23 27 29 2 43 26 8 4 6 17 3 30 3 1 38 11 

result:

wrong answer Your answer is wrong.

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%