QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#827437 | #9906. 乘积的期望 | wsyear | 100 ✓ | 1726ms | 234412kb | C++20 | 5.5kb | 2024-12-22 23:03:53 | 2024-12-22 23:03:53 |
Judging History
answer
// Problem: A. 乘积的期望
// Memory Limit: 1024 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
// Author: Donomonayuas
#include <bits/stdc++.h>
#define rep(i, j, k) for (int i = (j); i <= (k); ++i)
#define per(i, j, k) for (int i = (j); i >= (k); --i)
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
using ll = long long;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;
template<class T>inline void chkmn(T &x, T y) { if (y < x) x = y; }
template<class T>inline void chkmx(T &x, T y) { if (y > x) x = y; }
using namespace std;
template <int P>
class mod_int {
using Z = mod_int;
private:
static int mo(int x) { return x < 0 ? x + P : x; }
public:
int x;
int val() const { return x; }
mod_int() : x(0) {}
template <class T>
mod_int(const T &x_) : x(x_ >= 0 && x_ < P ? static_cast<int>(x_) : mo(static_cast<int>(x_ % P))) {}
bool operator==(const Z &rhs) const { return x == rhs.x; }
bool operator!=(const Z &rhs) const { return x != rhs.x; }
Z operator-() const { return Z(x ? P - x : 0); }
Z pow(long long k) const {
Z res = 1, t = *this;
while (k) {
if (k & 1) res *= t;
if (k >>= 1) t *= t;
}
return res;
}
Z &operator++() {
x < P - 1 ? ++x : x = 0;
return *this;
}
Z &operator--() {
x ? --x : x = P - 1;
return *this;
}
Z operator++(int) {
Z ret = x;
x < P - 1 ? ++x : x = 0;
return ret;
}
Z operator--(int) {
Z ret = x;
x ? --x : x = P - 1;
return ret;
}
Z inv() const { return pow(P - 2); }
Z &operator+=(const Z &rhs) {
(x += rhs.x) >= P && (x -= P);
return *this;
}
Z &operator-=(const Z &rhs) {
(x -= rhs.x) < 0 && (x += P);
return *this;
}
Z &operator*=(const Z &rhs) {
x = 1ULL * x * rhs.x % P;
return *this;
}
Z &operator/=(const Z &rhs) { return *this *= rhs.inv(); }
#define setO(T, o) \
friend T operator o(const Z &lhs, const Z &rhs) {\
Z res = lhs; \
return res o## = rhs; \
}
setO(Z, +) setO(Z, -) setO(Z, *) setO(Z, /)
#undef setO
};
const int P = 998244353;
using Z = mod_int<P>;
const int maxn = 110;
int n, m, c, a[maxn];
Z mul, sum, s[maxn], pw[maxn][maxn], val[maxn], fac[maxn], ivf[maxn];
Z f[maxn][1 << 18], g[maxn][1 << 18], dp[maxn][maxn][maxn], dq[maxn][maxn];
namespace lag {
int n;
Z x[maxn], y[maxn];
Z solve(int k) {
Z ans = 0;
rep (i, 1, n) {
Z s1 = y[i], s2 = 1;
rep (j, 1, n) if (i != j) {
s1 = s1 * (k - x[j]);
s2 = s2 * (x[i] - x[j]);
}
ans += s1 * s2.inv();
}
return ans;
}
}
int main() {
fac[0] = 1;
rep (i, 1, maxn - 1) fac[i] = fac[i - 1] * i;
ivf[maxn - 1] = fac[maxn - 1].inv();
per (i, maxn - 1, 1) ivf[i - 1] = ivf[i] * i;
cin.tie(nullptr) -> ios::sync_with_stdio(false);
cin >> n >> m >> c;
rep (i, 1, n - m + 1) cin >> a[i], sum += a[i];
if (2 * m > n) {
mul = Z(c).pow(2 * m - n);
int tn = 2 * n - 2 * m, tm = n - m;
n = tn, m = tm;
} else {
mul = 1;
}
Z ans = 0;
if (3 * m > n) {
rep (i, 1, 3 * m) {
pw[i][0] = 1;
rep (j, 1, n) pw[i][j] = pw[i][j - 1] * a[i];
}
// a[i] + a[i + m] + a[i + 2 * m] = c
// i <= m, choose i, a[i] - a[i - 1] times
// i > 2 * m, choose i - m + 1, a[i] - a[i + 1] times
// choose m + 1, c - a[m] - a[2 * m + 1] times
rep (C, 0, n) {
rep (s, 0, C) {
// a[m] = s
rep (i, 0, n) rep (j, 0, C) rep (k, 0, C - j) dp[i][j][k] = 0;
rep (i, 0, C) rep (j, 0, C - i) if (s + j <= C) {
if (2 * m + 1 > n && j) continue;
dp[1][i][j] = pw[1][i] * pw[m + 1][C - j - s] * ivf[i] * ivf[C - j - s] * i * (2 * m + 1 > n ? 1 : j) * (C - i - j);
}
rep (i, 2, m) {
int lk = (2 * m + i - 1 > n ? 0 : C);
rep (j, 0, C) rep (k, 0, lk) dq[j][k] = 0;
rep (j, 0, C) rep (k, 0, C - j) if (dp[i - 1][j][k].val()) {
rep (tj, j, C) dq[tj][k] += dp[i - 1][j][k] * pw[i][tj - j] * ivf[tj - j];
}
rep (tj, 0, C) rep (k, 0, lk) if (dq[tj][k].val()) {
rep (tk, 0, k) dp[i][tj][tk] += dq[tj][k] * pw[m + i][k - tk] * ivf[k - tk] * tj * (2 * m + i > n ? 1 : tk) * (C - tj - tk);
}
}
rep (i, 0, C) rep (j, 0, C - i) if (i == s) val[C] += fac[C] * dp[m][i][j] * pw[2 * m + 1][j] * ivf[j];
}
lag::x[C + 1] = C, lag::y[C + 1] = val[C] * Z(sum).pow(C).inv();
}
lag::n = n + 1;
ans = lag::solve(c);
} else {
rep (i, 1, n) s[i] = s[i - 1] + a[i] / sum;
f[0][0] = 1;
rep (i, 1, n) {
rep (j, 0, i - 1) rep (S, 0, (1 << (m - 1)) - 1) g[j][S] = f[j][S], f[j][S] = 0;
rep (j, 0, i - 1) rep (S, 0, (1 << (m - 1)) - 1) if (g[j][S].val()) {
if (!(S >> (m - 2) & 1)) {
f[j][S << 1] += g[j][S] * __builtin_popcount(S);
f[j + 1][S << 1 | 1] += g[j][S] * (c - j);
f[j + 1][S << 1] += g[j][S] * (c - j) * (s[i] - s[max(0, i - m)]);
}
rep (k, 0, m - 2) if (S >> k & 1) {
if ((S ^ (1 << k)) >> (m - 2) & 1) continue;
f[j][(S ^ (1 << k)) << 1] += g[j][S] * (s[i - k - 1] - s[max(0, i - m)]);
}
}
}
rep (i, 0, n) ans += f[i][0];
}
cout << (ans * mul).val() << '\n';
}
詳細信息
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 7ms
memory: 234400kb
input:
50 8 538603133 67980 83398 26783 9496 18845 44534 25751 12189 79555 49066 87559 96963 11358 39078 24880 28212 34282 24882 137 65957 82361 13906 96900 98969 84165 18398 39061 3819 69062 26508 50351 14635 53121 29490 50901 32530 6748 40834 98869 30306 21857 78350 4599
output:
780535604
result:
ok "780535604"
Test #2:
score: 10
Accepted
time: 20ms
memory: 234188kb
input:
50 8 587747017 73318 91285 55244 40290 44971 27131 59762 78217 11618 22791 8230 67954 91139 66898 94469 73436 98641 74614 85192 59413 58707 69699 92937 72529 8164 66650 44765 89246 23894 77803 43834 60147 70575 76591 31984 50622 13221 56352 18059 14373 80635 73746 13256
output:
509817337
result:
ok "509817337"
Subtask #2:
score: 20
Accepted
Test #3:
score: 20
Accepted
time: 1702ms
memory: 234192kb
input:
50 16 741556017 69810 78288 21013 9835 661 55545 30670 5295 93027 2280 84775 68841 409 27907 27934 30629 4727 72420 32399 56614 387 66084 24179 58626 65756 40652 2761 38442 35627 60928 38003 70482 82058 80740 76968
output:
805808885
result:
ok "805808885"
Test #4:
score: 20
Accepted
time: 1698ms
memory: 234320kb
input:
50 16 147814602 51498 44840 93424 78185 21164 78590 64690 21633 33673 59346 37035 35846 61909 66802 95333 51221 98017 81388 17656 3445 22845 83300 37487 94178 93563 34798 61453 63409 57626 96446 95427 59524 83458 27735 75700
output:
756826776
result:
ok "756826776"
Subtask #3:
score: 15
Accepted
Test #5:
score: 15
Accepted
time: 4ms
memory: 234128kb
input:
20 2 20 15733 41504 1298 31206 29251 80612 23096 62011 53587 93432 61688 29933 49923 56050 48077 18165 94224 89994 73376
output:
462941922
result:
ok "462941922"
Test #6:
score: 15
Accepted
time: 0ms
memory: 234124kb
input:
20 3 20 57522 48009 37618 39300 19577 44005 65454 97035 85345 80443 97133 52062 91020 52423 83416 21116 74840 76619
output:
540559668
result:
ok "540559668"
Test #7:
score: 15
Accepted
time: 3ms
memory: 234172kb
input:
20 4 20 60925 70573 53982 31710 66093 18975 7260 83233 67515 95597 44015 58869 34028 36548 45651 23271 52701
output:
611973859
result:
ok "611973859"
Test #8:
score: 15
Accepted
time: 12ms
memory: 234060kb
input:
20 5 20 82390 2317 82179 18938 9953 34563 82381 70783 97738 81517 17602 56993 58751 59673 9558 73494
output:
488417654
result:
ok "488417654"
Test #9:
score: 15
Accepted
time: 3ms
memory: 234124kb
input:
20 6 20 4771 68929 33616 57489 4669 17494 94028 43155 50480 55531 98839 87302 87698 21218 63988
output:
655440595
result:
ok "655440595"
Test #10:
score: 15
Accepted
time: 15ms
memory: 234356kb
input:
20 7 20 68307 10269 840 3121 93665 53351 26597 97291 62697 11200 87435 54633 26415 94315
output:
538177939
result:
ok "538177939"
Test #11:
score: 15
Accepted
time: 12ms
memory: 234336kb
input:
20 8 20 94622 30267 99868 82290 60454 482 96118 32322 77392 47281 68220 43584 79613
output:
983197463
result:
ok "983197463"
Test #12:
score: 15
Accepted
time: 12ms
memory: 234360kb
input:
20 9 20 40104 90548 19465 44878 21994 5498 52682 63165 12176 4666 20666 89555
output:
984574821
result:
ok "984574821"
Test #13:
score: 15
Accepted
time: 7ms
memory: 234196kb
input:
20 10 20 67417 20117 81885 6396 70004 86426 73034 32420 34993 47876 97728
output:
336081501
result:
ok "336081501"
Test #14:
score: 15
Accepted
time: 15ms
memory: 234388kb
input:
20 11 20 99807 80522 52177 65878 99955 73779 96792 36724 59702 36109
output:
676922342
result:
ok "676922342"
Test #15:
score: 15
Accepted
time: 4ms
memory: 234160kb
input:
20 12 20 55274 17402 20117 15472 45970 87173 57280 50633 48156
output:
941665181
result:
ok "941665181"
Subtask #4:
score: 15
Accepted
Test #16:
score: 15
Accepted
time: 0ms
memory: 234056kb
input:
30 2 30 63840 50413 47135 89472 59483 28187 26327 20630 9120 5935 35689 11933 65347 7807 67870 97007 98326 57595 38213 70182 28242 45443 98275 17795 64068 90290 77827 40552 52025
output:
325631710
result:
ok "325631710"
Test #17:
score: 15
Accepted
time: 15ms
memory: 234172kb
input:
30 3 30 58754 9093 33080 66153 24781 95196 70341 93542 64458 69630 3648 43011 78044 97039 73733 8851 1896 29496 98337 21621 94366 11212 26578 29439 74055 78934 25756 1851
output:
851829651
result:
ok "851829651"
Test #18:
score: 15
Accepted
time: 8ms
memory: 234356kb
input:
30 4 30 70665 9951 85696 25954 89838 90092 83036 79852 70557 78760 60484 87643 10448 6715 68462 4493 82690 8559 30903 5905 39538 81729 8336 75504 89887 68791 66413
output:
172769472
result:
ok "172769472"
Test #19:
score: 15
Accepted
time: 7ms
memory: 234396kb
input:
30 5 30 4616 33385 72106 14845 67092 3951 96876 7368 54847 48413 60577 59351 58653 70687 42529 64602 820 22253 86012 75249 25748 93849 91461 24425 19817 22975
output:
745999087
result:
ok "745999087"
Test #20:
score: 15
Accepted
time: 8ms
memory: 234392kb
input:
30 6 30 68519 56186 7862 25791 15648 16165 43082 86076 92196 77604 7951 96158 62855 81679 56293 89222 84771 226 43433 5233 32700 17535 86592 18798 74119
output:
322276513
result:
ok "322276513"
Test #21:
score: 15
Accepted
time: 11ms
memory: 234060kb
input:
30 7 30 11979 43527 49710 83806 59784 10553 68014 56617 56964 20855 89934 83282 47947 91684 29142 14582 22216 47716 42934 88501 12941 81062 98625 86477
output:
479411090
result:
ok "479411090"
Test #22:
score: 15
Accepted
time: 12ms
memory: 234400kb
input:
30 8 30 50530 478 23599 15778 21860 54253 34595 9777 63783 10943 26328 8586 90283 7759 34046 90014 58492 23149 15587 50844 74581 49737 26174
output:
988323551
result:
ok "988323551"
Test #23:
score: 15
Accepted
time: 15ms
memory: 234104kb
input:
30 9 30 52373 94342 29939 70926 23969 36137 48228 13762 11057 85576 10055 13114 77103 42530 23705 83562 45258 46500 31125 32543 7826 38012
output:
198006227
result:
ok "198006227"
Test #24:
score: 15
Accepted
time: 16ms
memory: 234184kb
input:
30 10 30 66855 12442 31206 69706 41102 13002 71643 15297 96987 9399 43850 84667 70263 97248 70337 70772 96208 25811 31946 63360 13780
output:
349331037
result:
ok "349331037"
Test #25:
score: 15
Accepted
time: 87ms
memory: 234388kb
input:
30 11 30 63794 26487 77468 69405 79142 15701 6057 99485 61747 48099 56083 27976 11947 30322 39159 72042 36576 31480 53232 41315
output:
19451382
result:
ok "19451382"
Test #26:
score: 15
Accepted
time: 65ms
memory: 234180kb
input:
30 12 30 80898 17749 59921 9255 82725 8930 53041 53386 58051 84640 98791 94989 8871 95652 37155 9323 8097 81155 78102
output:
261521267
result:
ok "261521267"
Test #27:
score: 15
Accepted
time: 43ms
memory: 234188kb
input:
30 13 30 65147 21933 7432 81312 10324 45873 13728 26121 3275 16453 9280 57605 85482 44741 98435 40994 6478 77720
output:
274723136
result:
ok "274723136"
Test #28:
score: 15
Accepted
time: 35ms
memory: 234356kb
input:
30 14 30 99433 79585 57069 28038 88731 41369 69178 84107 78049 34469 69809 65449 5423 14965 45054 65614 7255
output:
531649575
result:
ok "531649575"
Test #29:
score: 15
Accepted
time: 11ms
memory: 234104kb
input:
30 15 30 34791 87968 97064 94330 24647 56928 99053 1859 84764 82545 4199 75885 95797 14013 95453 65527
output:
476428907
result:
ok "476428907"
Test #30:
score: 15
Accepted
time: 15ms
memory: 234184kb
input:
30 16 30 81070 71460 72957 46508 22653 1514 766 73140 94127 57765 71685 40157 40738 27575 22096
output:
943749094
result:
ok "943749094"
Test #31:
score: 15
Accepted
time: 4ms
memory: 234396kb
input:
30 17 30 98135 24472 38513 82024 11071 92354 54542 17518 91226 33375 36883 90532 49032 84492
output:
409734064
result:
ok "409734064"
Test #32:
score: 15
Accepted
time: 8ms
memory: 234388kb
input:
30 18 30 70803 58919 82442 55967 37825 95512 75994 49366 22520 45613 38003 21085 65894
output:
701270755
result:
ok "701270755"
Test #33:
score: 15
Accepted
time: 4ms
memory: 234120kb
input:
30 19 30 1320 60630 85617 38806 28625 95703 64506 79178 22839 12464 28793 17556
output:
502723897
result:
ok "502723897"
Test #34:
score: 15
Accepted
time: 4ms
memory: 234104kb
input:
30 20 30 42578 24181 92902 44315 20604 67455 81665 17675 58137 50353 69939
output:
687766607
result:
ok "687766607"
Subtask #5:
score: 15
Accepted
Test #35:
score: 15
Accepted
time: 8ms
memory: 234164kb
input:
40 2 40 35138 42435 44437 707 7353 69441 86322 53577 70023 6596 29411 46831 24261 46551 61944 37823 76356 70071 2125 29889 42261 75504 48476 73665 40836 83539 15019 32 70786 23007 75297 39802 45176 74888 64949 65975 20791 74909 3174
output:
272092213
result:
ok "272092213"
Test #36:
score: 15
Accepted
time: 19ms
memory: 234104kb
input:
40 3 40 71100 68198 31780 89574 17629 66878 44226 75602 9923 3197 13761 17979 95562 40271 15950 21383 7904 75208 65826 12943 66864 8901 16830 50349 47157 3255 19410 73815 75217 35628 11839 39663 33376 98009 28434 25197 96530 11916
output:
756937948
result:
ok "756937948"
Test #37:
score: 15
Accepted
time: 0ms
memory: 234172kb
input:
40 4 40 18267 87400 24737 39364 49406 44146 68860 73686 66473 25089 14386 4341 51873 4470 52773 54215 86457 3144 8169 84880 63200 7604 48305 83228 70617 78343 44987 89465 68212 2688 21433 25103 97185 5745 70037 67867 87650
output:
932235563
result:
ok "932235563"
Test #38:
score: 15
Accepted
time: 8ms
memory: 234168kb
input:
40 5 40 79213 93638 1075 40058 39851 18424 41024 12561 85281 60808 73986 94177 13354 9098 58534 7504 40433 89494 42514 60354 71445 61038 35277 70563 24545 51024 39955 6610 58894 98867 44346 71217 34653 31472 97507 24244
output:
265604217
result:
ok "265604217"
Test #39:
score: 15
Accepted
time: 12ms
memory: 234188kb
input:
40 6 40 13136 45215 78397 27958 18696 27713 26785 76785 55059 63834 94616 73045 71879 98953 86697 19717 26214 4420 98410 14040 91055 51076 54283 288 2201 53187 60510 40903 48472 26339 33860 64399 14624 5316 89041
output:
459926865
result:
ok "459926865"
Test #40:
score: 15
Accepted
time: 15ms
memory: 234100kb
input:
40 7 40 13291 15112 5901 47419 59971 56553 70301 54132 78871 17227 23376 63262 47081 3603 53707 68249 60392 74222 35948 93693 39147 96268 83133 73155 17148 40820 92704 73284 97318 17751 28876 83166 32064 48116
output:
961301214
result:
ok "961301214"
Test #41:
score: 15
Accepted
time: 3ms
memory: 234068kb
input:
40 8 40 19184 69028 28504 19515 61680 8242 31347 75928 30064 25580 43644 12978 90742 86638 85532 86894 58945 9010 96354 82384 59210 76066 22164 49992 97906 31831 21312 71675 44627 60340 93515 92716 43354
output:
196212497
result:
ok "196212497"
Test #42:
score: 15
Accepted
time: 12ms
memory: 234188kb
input:
40 9 40 10830 3889 7327 22854 66931 50142 22369 58379 19041 38563 9042 91755 82900 81485 75186 72224 73801 74958 73853 32208 44483 55391 65509 99350 80387 71719 53611 94566 64027 29375 47535 23979
output:
412400704
result:
ok "412400704"
Test #43:
score: 15
Accepted
time: 19ms
memory: 234396kb
input:
40 10 40 63205 33454 67452 10120 13857 31209 79721 4437 27180 70598 98880 83898 98701 64331 4643 85035 98697 63590 63713 69545 93785 91683 97343 50773 3344 28898 71335 17953 35337 14070 89663
output:
190170017
result:
ok "190170017"
Test #44:
score: 15
Accepted
time: 35ms
memory: 234188kb
input:
40 11 40 85745 92961 77258 15278 43689 41427 38296 44770 39423 73589 62174 80221 57789 47002 59188 41963 9121 71861 66319 94786 87035 62248 45682 22701 84797 8995 57881 94256 70827 36270
output:
958920189
result:
ok "958920189"
Test #45:
score: 15
Accepted
time: 65ms
memory: 234384kb
input:
40 12 40 29024 51799 54226 35554 92053 39849 38598 89310 47774 83241 21417 54305 36458 77878 39291 16427 53665 8200 9506 41976 87157 10980 87289 36206 68760 57123 95210 32802 16015
output:
342527023
result:
ok "342527023"
Test #46:
score: 15
Accepted
time: 118ms
memory: 234096kb
input:
40 13 40 7616 68972 33345 41016 40353 62734 18807 48838 51588 75658 27447 19845 90544 72308 48057 47487 59739 75677 40270 69074 80145 99762 99051 94665 14320 19302 14688 42942
output:
924074137
result:
ok "924074137"
Test #47:
score: 15
Accepted
time: 455ms
memory: 234368kb
input:
40 14 40 99848 87213 45085 85170 16792 58530 25767 72540 44036 25822 27909 92447 93011 45308 5219 77182 12910 51262 55225 19188 3586 24518 54539 15548 93118 87243 36541
output:
718774375
result:
ok "718774375"
Test #48:
score: 15
Accepted
time: 393ms
memory: 234100kb
input:
40 15 40 9003 66185 41935 84841 31314 99958 95478 50898 95631 18002 2563 92593 15096 20111 47506 20543 18815 83300 66980 97809 11109 3915 2359 10225 34564 47407
output:
800463419
result:
ok "800463419"
Test #49:
score: 15
Accepted
time: 333ms
memory: 234324kb
input:
40 16 40 19473 67149 59178 99134 68088 82769 53032 28667 20184 24765 89263 23148 38584 66561 36502 24404 87957 60646 4931 74331 99443 6031 47307 5024 63144
output:
799873706
result:
ok "799873706"
Test #50:
score: 15
Accepted
time: 263ms
memory: 234104kb
input:
40 17 40 97949 88037 85570 30267 246 48078 81464 53921 80742 24523 97369 4502 44179 3471 81397 29593 56321 81311 45563 36324 54242 91142 30283 52329
output:
992592521
result:
ok "992592521"
Test #51:
score: 15
Accepted
time: 201ms
memory: 234196kb
input:
40 18 40 28112 2827 98169 81994 43574 8309 28359 64100 93523 86469 45776 28118 85179 43751 10877 62661 3604 40936 7650 98478 37125 8195 12224
output:
692884148
result:
ok "692884148"
Test #52:
score: 15
Accepted
time: 130ms
memory: 234112kb
input:
40 19 40 33662 66542 29518 90771 39657 39995 43 90633 74709 11002 58733 6303 7147 96471 94720 99121 18718 61095 2826 21637 11963 63457
output:
739624974
result:
ok "739624974"
Test #53:
score: 15
Accepted
time: 23ms
memory: 234164kb
input:
40 20 40 6683 6594 25060 88226 10329 9503 43687 11094 70151 61078 38578 87980 51133 83265 73113 17631 26342 86052 15555 71959 64071
output:
646772904
result:
ok "646772904"
Test #54:
score: 15
Accepted
time: 20ms
memory: 234188kb
input:
40 21 40 22924 21387 1326 67927 342 88841 97533 90078 81561 36889 61145 25764 64826 26165 61311 8459 66420 37649 90204 16414
output:
214264432
result:
ok "214264432"
Test #55:
score: 15
Accepted
time: 28ms
memory: 234172kb
input:
40 22 40 91618 54087 66492 85014 69086 34317 82681 91559 46428 2247 30075 807 50346 18452 85027 75015 62623 7236 41596
output:
815121849
result:
ok "815121849"
Test #56:
score: 15
Accepted
time: 16ms
memory: 234116kb
input:
40 23 40 18460 71894 58806 1065 84696 50681 26798 52831 68217 49927 56 74357 96730 36204 74341 58064 92339 75669
output:
168875828
result:
ok "168875828"
Test #57:
score: 15
Accepted
time: 23ms
memory: 234196kb
input:
40 24 40 18977 35097 89930 64528 43455 1448 29441 22866 68180 45849 61470 39201 14605 90942 79613 26024 92261
output:
925685055
result:
ok "925685055"
Test #58:
score: 15
Accepted
time: 15ms
memory: 234356kb
input:
40 25 40 11846 57438 92711 26955 94706 57543 25609 12829 24516 32188 35662 18420 61093 28073 53725 87596
output:
882429361
result:
ok "882429361"
Test #59:
score: 15
Accepted
time: 12ms
memory: 234108kb
input:
40 26 40 6265 80732 30167 90260 73922 84136 37310 16069 38069 75656 13058 6177 6027 41446 98090
output:
93693117
result:
ok "93693117"
Subtask #6:
score: 15
Accepted
Test #60:
score: 15
Accepted
time: 4ms
memory: 234116kb
input:
50 2 50 53029 77661 89821 96796 28335 72369 90651 95802 13374 29886 81635 88365 51184 98387 7102 32265 60561 23222 99406 30927 59740 76150 85630 96176 10160 70769 19803 42511 26180 40659 21813 44505 37884 93565 75651 24071 59735 21876 92814 23825 99659 86324 3121 57736 47497 42211 19049 28386 62614
output:
966860170
result:
ok "966860170"
Test #61:
score: 15
Accepted
time: 14ms
memory: 234088kb
input:
50 3 50 96445 17531 4985 23485 13120 58689 66414 77376 99105 34985 52873 99206 20358 54743 56826 23382 61605 44307 43828 79980 47627 16387 35 46167 59598 49047 20753 69122 67406 89098 98604 73441 7364 73297 34961 17242 47050 27238 20463 42460 564 62305 30757 63016 93486 14093 4321 85391
output:
275707768
result:
ok "275707768"
Test #62:
score: 15
Accepted
time: 4ms
memory: 234128kb
input:
50 4 50 74938 23059 67849 99019 40296 34071 83582 37652 30622 46626 59266 20048 46849 2256 15255 42610 92619 40455 16548 78028 74707 42108 47598 21417 61795 56917 42288 42360 73614 49594 32133 37558 16840 14096 59556 31733 88554 13726 27151 47197 66555 52085 37486 85423 31240 41455 9476
output:
535543625
result:
ok "535543625"
Test #63:
score: 15
Accepted
time: 4ms
memory: 234168kb
input:
50 5 50 7060 46842 14170 61800 73324 87736 90002 900 74923 57156 63841 67704 26366 59428 86766 41384 23691 62248 89959 15336 84515 79004 96333 41741 97521 73536 25922 21015 82905 56513 46291 93889 64519 92731 54654 44343 237 13858 94701 90536 63762 79544 29126 53519 38244 65619
output:
870962285
result:
ok "870962285"
Test #64:
score: 15
Accepted
time: 11ms
memory: 234104kb
input:
50 6 50 64959 28210 37728 17098 71426 42982 92453 40335 28714 584 35795 7730 29650 54353 8263 65605 48895 54358 57899 84757 28766 94548 1618 85984 71002 89515 13811 95270 99883 24796 85059 59037 76746 42209 4568 8983 41819 61014 44398 89465 94647 49655 15088 24818 91141
output:
643042630
result:
ok "643042630"
Test #65:
score: 15
Accepted
time: 12ms
memory: 234056kb
input:
50 7 50 69117 22907 49998 22118 52072 67379 11081 61522 32796 19666 75556 81101 95643 42449 79385 40460 85775 74898 49734 90978 26116 24073 77800 97206 80342 79176 26719 47801 32725 682 72332 30095 23469 16354 95413 58769 41611 15522 33144 38557 50622 72506 4933 63622
output:
712790994
result:
ok "712790994"
Test #66:
score: 15
Accepted
time: 7ms
memory: 234184kb
input:
50 8 50 49569 78329 63498 65496 40759 49529 90061 92912 81259 12538 19900 22760 4347 61746 77129 70127 78851 69849 65399 94519 76410 23542 37028 98351 64260 99163 85113 6231 22918 1704 7987 29955 80582 58034 19354 33357 54959 74446 16833 94301 98799 7241 37787
output:
758769960
result:
ok "758769960"
Test #67:
score: 15
Accepted
time: 8ms
memory: 234100kb
input:
50 9 50 34112 34920 69853 89379 46478 94340 79906 86572 93276 89070 81279 52826 14491 9271 41289 72513 31923 63351 78035 69850 49241 28625 3590 36740 92720 95725 82140 98552 16923 31290 73899 3838 36298 77916 68761 50821 26984 169 97630 64510 43674 63803
output:
359659180
result:
ok "359659180"
Test #68:
score: 15
Accepted
time: 20ms
memory: 234168kb
input:
50 10 50 76877 46259 90672 91432 39864 10326 63655 77558 11712 45648 98824 20987 85669 8261 27105 10251 50548 64890 16572 60228 48898 15555 51502 91170 86557 99342 71012 35806 58334 66983 15340 2737 57547 82813 45309 57058 34583 35614 25188 79454 3691
output:
661548784
result:
ok "661548784"
Test #69:
score: 15
Accepted
time: 48ms
memory: 234104kb
input:
50 11 50 55916 67182 33829 73177 44113 80486 54953 56187 81888 34753 23575 71571 5510 7632 2966 27348 48007 74961 43045 57078 82887 54070 17035 2237 3559 11202 19208 86382 23868 46666 64936 39838 73616 7267 69696 74122 43166 33528 78753 34556
output:
954738220
result:
ok "954738220"
Test #70:
score: 15
Accepted
time: 93ms
memory: 234184kb
input:
50 12 50 6459 42176 98652 11845 65762 73713 16354 99880 29406 66472 83851 27292 43132 79054 94491 70129 66659 64586 56822 33691 1764 80198 34818 53939 43582 88381 71722 45226 38014 64811 56746 91683 10904 74811 47155 13237 22934 15250 94723
output:
967252542
result:
ok "967252542"
Test #71:
score: 15
Accepted
time: 208ms
memory: 234352kb
input:
50 13 50 49351 71797 62230 47497 9168 1590 35982 60179 49202 31337 13279 50009 77879 37961 5925 2866 20997 91593 90615 87995 88174 20798 71718 77714 59175 37136 91266 10294 18357 43883 90112 7107 32250 68655 36863 22802 53651 84788
output:
21535047
result:
ok "21535047"
Test #72:
score: 15
Accepted
time: 414ms
memory: 234356kb
input:
50 14 50 68781 78492 54629 67949 23884 9536 29736 2639 24475 94400 50839 37421 88228 86573 87900 56802 65682 96339 67620 34317 42937 18844 29374 54965 45284 9007 46103 13487 2723 87088 45478 51515 44241 413 10095 66344 99387
output:
265347058
result:
ok "265347058"
Test #73:
score: 15
Accepted
time: 840ms
memory: 234388kb
input:
50 15 50 66464 28628 52028 56988 87320 59104 43629 96183 52751 63910 41444 27611 16936 36102 11296 37575 63197 32292 21882 87828 62772 10683 18047 56367 91226 96724 84846 31186 65618 73416 53484 60982 91605 55776 37407 94410
output:
1174588
result:
ok "1174588"
Test #74:
score: 15
Accepted
time: 1709ms
memory: 234400kb
input:
50 16 50 76981 57910 52399 40159 82889 6697 67045 44236 4200 56656 73831 17165 52972 45136 3403 32468 13892 91219 32628 77819 72981 1782 19880 87174 1041 64739 52915 34707 42708 26503 1322 73034 31863 99766 49038
output:
839194511
result:
ok "839194511"
Test #75:
score: 15
Accepted
time: 1726ms
memory: 234192kb
input:
50 17 50 89148 74885 63535 49386 36950 55293 97685 55335 17602 70817 47525 79524 96753 7860 78281 75508 48303 961 3519 88106 81506 72192 34990 63649 39348 121 48634 83223 2386 14705 24126 69162 28819 83556
output:
693939384
result:
ok "693939384"
Test #76:
score: 15
Accepted
time: 1544ms
memory: 234100kb
input:
50 18 50 90021 77626 82454 23008 29283 9018 87282 29748 12957 20295 80574 80375 73252 91314 64705 31795 18005 59365 37487 9318 83558 44932 79981 49754 41849 38608 59101 97285 6592 4902 14536 62668 53386
output:
817242894
result:
ok "817242894"
Test #77:
score: 15
Accepted
time: 1356ms
memory: 234400kb
input:
50 19 50 65740 90350 10179 12069 52499 90896 67623 79513 62102 59889 68675 7626 31031 55496 68746 76612 7398 71044 47437 64941 77741 38200 69581 39539 9704 4547 81434 1816 10515 65307 69642 9095
output:
73347048
result:
ok "73347048"
Test #78:
score: 15
Accepted
time: 1156ms
memory: 234356kb
input:
50 20 50 60337 5060 62673 99212 64353 41483 56346 98683 36742 98319 68693 95861 45853 28896 73373 15239 94144 90860 97761 31940 13741 18665 4392 87741 56626 18324 13554 28129 11517 25858 47479
output:
979089075
result:
ok "979089075"
Test #79:
score: 15
Accepted
time: 941ms
memory: 234196kb
input:
50 21 50 78161 57369 5734 34654 72061 21010 54213 16691 41282 31844 42071 99456 50580 99081 74252 78535 28655 25729 28144 4034 67038 38002 52426 97397 29107 32205 671 98350 8516 37074
output:
45236149
result:
ok "45236149"
Test #80:
score: 15
Accepted
time: 731ms
memory: 234188kb
input:
50 22 50 23330 2973 51440 36112 47285 2285 18937 18509 16106 48215 54586 70618 25949 81726 34279 53792 38843 56450 90706 16321 99163 69238 47214 47651 97275 11911 69706 84217 79288
output:
970196067
result:
ok "970196067"
Test #81:
score: 15
Accepted
time: 534ms
memory: 234172kb
input:
50 23 50 71560 7701 81221 44930 8250 85799 26509 73321 21229 39389 62487 90672 20338 34780 51760 93695 96049 61557 80610 3255 63411 66605 87977 67065 43416 15430 2214 58453
output:
371400898
result:
ok "371400898"
Test #82:
score: 15
Accepted
time: 322ms
memory: 234172kb
input:
50 24 50 99110 80924 52231 42080 62802 83124 68646 29222 80982 79980 18896 2199 95309 2350 14678 52185 40335 78056 74297 10743 77108 83909 15611 83834 76803 10407 48648
output:
236056274
result:
ok "236056274"
Test #83:
score: 15
Accepted
time: 75ms
memory: 234320kb
input:
50 25 50 28428 30784 94940 26674 40737 55507 1719 72478 48870 48785 44097 82658 13179 90231 23710 50088 18842 6074 88832 47703 9745 97708 22997 84380 81018 67874
output:
650160493
result:
ok "650160493"
Test #84:
score: 15
Accepted
time: 78ms
memory: 234100kb
input:
50 26 50 55504 97175 21770 73560 8317 17158 59603 10786 29954 35260 40637 23877 4192 58017 18222 78422 87802 97830 76780 81032 10333 84144 89121 98624 27574
output:
391952239
result:
ok "391952239"
Test #85:
score: 15
Accepted
time: 55ms
memory: 234388kb
input:
50 27 50 77773 23392 57792 75775 6778 82827 44669 66457 99875 16632 69424 19177 54784 80395 99315 72815 80565 53795 32406 4382 41543 28997 85784 57566
output:
337423424
result:
ok "337423424"
Test #86:
score: 15
Accepted
time: 44ms
memory: 234164kb
input:
50 28 50 93714 99302 95025 13217 17107 76817 68670 48349 38957 26078 91700 45882 11177 71582 96225 98102 82988 10634 49357 93882 25783 63171 93783
output:
655407985
result:
ok "655407985"
Test #87:
score: 15
Accepted
time: 42ms
memory: 234192kb
input:
50 29 50 76735 90013 28727 13398 80606 28337 39984 19529 55326 60805 74351 18436 77918 82468 47570 56461 31528 25506 56654 13087 4966 13875
output:
915107776
result:
ok "915107776"
Test #88:
score: 15
Accepted
time: 37ms
memory: 234096kb
input:
50 30 50 2184 15819 64803 21452 29193 69064 83908 49400 38474 29779 51926 24106 59260 85621 46358 19614 18922 33867 89110 52788 60027
output:
944306187
result:
ok "944306187"
Test #89:
score: 15
Accepted
time: 30ms
memory: 234400kb
input:
50 31 50 83896 69420 42362 96153 77729 34466 11584 10104 29145 81880 79818 67223 91576 28825 1516 43602 91969 11306 73921 53148
output:
117480109
result:
ok "117480109"
Test #90:
score: 15
Accepted
time: 20ms
memory: 234156kb
input:
50 32 50 31785 55295 91882 25926 69142 17863 48692 51863 50061 14087 7116 90465 85499 61978 37410 61739 3659 98237 24607
output:
267712451
result:
ok "267712451"
Subtask #7:
score: 10
Accepted
Test #91:
score: 10
Accepted
time: 0ms
memory: 234100kb
input:
50 2 803148095 69632 6145 90266 98714 33652 25290 13413 24460 73968 20427 63478 45461 84799 58528 32781 71127 95223 49585 47134 68284 92786 64910 46840 90501 28361 70029 52269 71032 64637 4223 74513 31660 86876 17066 76967 7309 69967 29448 90148 51876 85305 47798 57822 85122 5026 11764 59061 42974 3...
output:
76793352
result:
ok "76793352"
Test #92:
score: 10
Accepted
time: 12ms
memory: 234156kb
input:
50 3 690392776 36134 32877 28105 85422 43833 97920 54580 71403 99737 2350 53745 87037 44559 15101 23172 68869 56424 99171 77073 76023 8511 42173 21912 77817 45897 65943 1940 79506 52197 72845 61589 36288 13283 86198 15909 17484 54673 73865 6915 86550 31149 63772 6395 44043 46633 47502 34361 64490
output:
493792782
result:
ok "493792782"
Test #93:
score: 10
Accepted
time: 3ms
memory: 234128kb
input:
50 4 558837165 55157 65085 79872 75153 10915 23058 44507 63069 68493 84237 26393 74470 32249 10093 20159 4532 1482 48439 29699 38858 46401 49512 98567 94680 41914 65640 53605 13429 60561 67354 27016 10244 34129 94566 98380 7799 28634 97069 20004 68339 97848 83064 95753 42610 89742 9573 60117
output:
920025950
result:
ok "920025950"
Test #94:
score: 10
Accepted
time: 4ms
memory: 234400kb
input:
50 5 478283612 71261 21836 31508 16521 33733 69741 33002 88839 18137 33510 14974 55425 11800 93801 91693 11132 60049 33018 36244 54343 38638 33617 58862 97575 95401 44639 3837 23131 48447 88969 5677 61719 5946 48507 31185 95656 70018 20193 63745 56019 76908 13134 59007 89890 55156 22208
output:
137796333
result:
ok "137796333"
Test #95:
score: 10
Accepted
time: 4ms
memory: 234352kb
input:
50 6 786212020 55679 15417 22708 88476 9694 11625 71072 93984 47267 81363 739 52450 93269 70110 94661 84448 98260 58652 75764 27320 6531 85150 62737 80036 85536 52525 6829 77456 90459 69716 86176 24288 20838 91391 56025 84787 92528 89753 19596 72802 88053 63385 56681 27185 50232
output:
458406243
result:
ok "458406243"
Test #96:
score: 10
Accepted
time: 15ms
memory: 234060kb
input:
50 7 568334537 12730 13929 55859 98813 98849 45593 89863 73708 74559 60996 32781 48368 96603 61072 94652 66249 55999 17496 78591 93591 10276 11631 56478 12591 89665 9534 75165 16035 326 60405 72166 68031 97881 29011 65003 57743 68014 36909 76453 63303 78428 37023 98463 68384
output:
923180239
result:
ok "923180239"
Test #97:
score: 10
Accepted
time: 15ms
memory: 234188kb
input:
50 8 300254556 48282 38684 17909 28247 37678 28460 41858 96022 46320 64807 28306 1068 8772 84943 76229 57996 39498 96616 93853 85870 92486 27467 39412 56764 47551 88051 69387 36634 22058 47443 38030 48720 62409 89006 23661 76200 26694 45900 65400 71483 1504 92867 58247
output:
853288554
result:
ok "853288554"
Test #98:
score: 10
Accepted
time: 11ms
memory: 234184kb
input:
50 9 172158731 89649 51422 97393 68913 1822 7619 85343 29308 66171 64593 97612 71688 77356 60003 83174 57152 74022 37137 44231 10608 73057 54944 20965 60496 98921 7041 35468 12491 32799 37226 87161 15888 69406 75204 16199 93764 5425 52907 87866 94896 22107 6664
output:
796548821
result:
ok "796548821"
Test #99:
score: 10
Accepted
time: 20ms
memory: 234356kb
input:
50 10 495282454 99757 7077 39623 9814 55638 819 5048 56858 88363 57678 23379 67408 45631 25110 74083 59010 87867 17134 51731 45984 87529 57227 23423 3588 99706 28803 1833 91367 5201 23971 81263 93734 31490 86474 24364 89804 27485 6169 99469 30403 8493
output:
766383494
result:
ok "766383494"
Test #100:
score: 10
Accepted
time: 47ms
memory: 234412kb
input:
50 11 627387726 50185 79149 84611 730 73308 30573 18329 16631 3708 9748 3818 65519 44945 49807 83166 67044 38388 14015 83997 81765 21187 66552 24283 70861 5128 63631 74758 62143 29090 93432 60759 66107 70908 73535 24547 48850 64795 36117 70009 31104
output:
429092846
result:
ok "429092846"
Test #101:
score: 10
Accepted
time: 96ms
memory: 234188kb
input:
50 12 326283313 12366 22857 74526 31879 50863 87507 80290 74293 56163 347 64611 32086 332 63138 20254 9317 33719 65890 83821 41260 44835 90867 8643 74270 46685 77481 86901 42974 20704 70566 55990 38382 9384 812 93179 85993 5553 66690 59542
output:
610000969
result:
ok "610000969"
Test #102:
score: 10
Accepted
time: 201ms
memory: 234056kb
input:
50 13 522934736 82423 73265 81682 10575 18844 69884 16317 63637 82901 4847 99044 35180 7571 21148 26881 1579 48919 44273 19972 72110 49689 16084 64353 89878 23916 32932 79838 51979 36371 41936 20104 87589 73104 53922 21885 74598 15735 62822
output:
922646049
result:
ok "922646049"
Test #103:
score: 10
Accepted
time: 411ms
memory: 234104kb
input:
50 14 726989484 79644 30940 68493 42928 73682 22987 97717 73123 73516 39041 56728 46001 84021 24662 19126 68780 72643 76853 23720 36614 34870 80353 75648 36279 43373 2834 19806 34603 96569 8450 32520 94767 85371 17327 13900 20869 48158
output:
71487255
result:
ok "71487255"
Test #104:
score: 10
Accepted
time: 826ms
memory: 234388kb
input:
50 15 222428969 4027 29243 62409 44371 98994 96487 37077 20060 54228 32500 24693 99081 12112 45708 43746 64201 6709 99806 1068 76784 51174 70127 1329 48336 32453 9175 43339 10302 65098 25492 89595 45417 92047 29093 98945 21443
output:
385594633
result:
ok "385594633"
Test #105:
score: 10
Accepted
time: 1691ms
memory: 234108kb
input:
50 16 800745511 96712 94902 4563 43503 85003 26363 58312 87068 97072 8887 35999 85459 14742 45885 48182 99163 12365 16338 77410 85729 36014 21108 98245 52389 56462 59912 48535 69990 77420 99028 98167 8521 40187 82296 74839
output:
234488951
result:
ok "234488951"
Test #106:
score: 10
Accepted
time: 1726ms
memory: 234108kb
input:
50 17 626865815 99287 97713 11494 74415 96916 72794 23024 30060 46753 26481 95534 63142 16593 77944 35514 56135 93135 1392 41910 45046 16947 94237 23459 51001 48353 59466 75616 61285 58790 15229 28593 83218 8097 52868
output:
530633546
result:
ok "530633546"
Test #107:
score: 10
Accepted
time: 1558ms
memory: 234116kb
input:
50 18 682329223 89189 57733 2337 22793 54925 16803 79327 21026 34394 24305 55182 96914 37343 47981 17181 15593 3987 14162 58133 14868 70858 83656 15726 23697 79747 69202 16576 71139 66841 99297 66711 51044 62829
output:
956250746
result:
ok "956250746"
Test #108:
score: 10
Accepted
time: 1351ms
memory: 234120kb
input:
50 19 878792735 51239 75327 78051 20255 78340 65266 71891 16537 15420 88831 37369 78722 86193 44863 61496 17461 61813 21336 73302 83118 44802 51291 34274 18686 88032 90201 49138 85978 81316 29511 93239 63456
output:
820299671
result:
ok "820299671"
Test #109:
score: 10
Accepted
time: 1142ms
memory: 234100kb
input:
50 20 540481314 27343 96627 23135 18064 26956 45126 54957 25666 84963 60375 82522 26060 50036 92362 85313 35707 96925 76068 65799 2961 974 74403 62184 92888 14943 19817 38766 91811 51115 46043 1743
output:
690110864
result:
ok "690110864"
Test #110:
score: 10
Accepted
time: 945ms
memory: 234188kb
input:
50 21 385921461 32273 41713 71277 31516 12417 22457 36444 12958 56880 76278 5021 71840 77459 36973 24409 37664 19718 98595 85721 53226 75575 64170 74451 69451 76008 88025 67994 90640 19439 35352
output:
221426944
result:
ok "221426944"
Test #111:
score: 10
Accepted
time: 734ms
memory: 234196kb
input:
50 22 592051938 6956 99129 37491 79436 28027 93125 85710 89070 86602 50070 17119 9488 58685 89587 57221 17252 32016 49799 33298 15975 21232 49031 95074 54461 69499 18973 13320 72963 79815
output:
204061643
result:
ok "204061643"
Test #112:
score: 10
Accepted
time: 535ms
memory: 234324kb
input:
50 23 570817729 25793 45480 36637 65551 43804 42813 31524 48373 63466 12244 36781 27595 19066 82381 17483 83545 37785 44533 15624 92044 74602 49547 91315 89845 97496 89477 68690 64822
output:
649980683
result:
ok "649980683"
Test #113:
score: 10
Accepted
time: 320ms
memory: 234160kb
input:
50 24 500628242 26321 97773 57004 38680 4544 33095 48885 95145 53225 86733 21612 57766 47978 16814 2958 12920 93537 2674 3931 33329 43104 53032 43280 81511 54764 15725 86122
output:
666026194
result:
ok "666026194"
Test #114:
score: 10
Accepted
time: 82ms
memory: 234356kb
input:
50 25 688104995 53192 86788 81466 13920 27976 66167 13055 4457 48064 45763 60788 95100 74296 21025 33268 40935 21461 6969 47760 64231 9655 23447 31731 25552 88357 41351
output:
410358428
result:
ok "410358428"
Test #115:
score: 10
Accepted
time: 71ms
memory: 234360kb
input:
50 26 745312457 26180 6945 73220 63406 92233 74486 63780 25279 3064 77141 91634 41679 11804 90623 25031 50877 87674 14801 98406 59419 74392 63344 1213 85886 81047
output:
989653979
result:
ok "989653979"
Test #116:
score: 10
Accepted
time: 62ms
memory: 234388kb
input:
50 27 259708603 26180 75149 76407 29447 25300 87884 69124 77095 4378 6780 18516 93790 19252 65769 47914 58148 19432 89026 15446 56360 70033 39137 85311 26580
output:
190085888
result:
ok "190085888"
Test #117:
score: 10
Accepted
time: 58ms
memory: 234164kb
input:
50 28 448727582 24351 49510 1917 80181 2272 59064 83172 49206 15230 35721 76346 32043 20876 90906 50780 42742 72967 32836 9783 56675 67717 26528 42743
output:
283113130
result:
ok "283113130"
Test #118:
score: 10
Accepted
time: 50ms
memory: 234124kb
input:
50 29 710327236 37902 420 25750 70 43869 34444 92634 32253 20483 90012 66190 35856 22004 17228 75114 54087 26233 11439 75092 47932 86052 81025
output:
10289570
result:
ok "10289570"
Test #119:
score: 10
Accepted
time: 35ms
memory: 234108kb
input:
50 30 564395090 15917 99220 60092 98992 22574 20496 21618 25980 48851 81492 6242 93521 21959 38687 97249 34528 18487 23354 78833 95878 30857
output:
544344012
result:
ok "544344012"
Test #120:
score: 10
Accepted
time: 36ms
memory: 234196kb
input:
50 31 496579468 98927 33799 78674 31161 69205 49841 31947 25564 11151 97599 68615 27543 45198 3902 43736 91843 35887 22731 15399 80650
output:
155925617
result:
ok "155925617"
Test #121:
score: 10
Accepted
time: 26ms
memory: 234404kb
input:
50 32 565232398 91303 55365 5517 7662 79400 66219 58130 81760 14484 14747 87035 43201 89205 30327 97233 60265 86414 30280 59213
output:
187378906
result:
ok "187378906"