QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#858995 | #9631. Median Replacement | 000226 | TL | 727ms | 4096kb | C++17 | 2.9kb | 2025-01-17 11:50:11 | 2025-01-17 11:50:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
inline int mod (int x) { return x + (x >> 31 & P); }
inline void pls(int &x, int y) { x = mod (x + y - P); }
inline int power (int x, int k) {
int res = 1;
while (k) {
if (k & 1) res = 1ll * res * x % P;
x = 1ll * x * x % P;
k >>= 1;
}
return res;
}
#define lep(i, l, r) for (int i = (l); i <= (r); i ++)
#define rep(i, l, r) for (int i = (l); i >= (r); i --)
const int N = 150 + 5;
int n, L[N], R[N];
int f[N][3];
int getC(int x) {
f[0][0] = 1; f[0][1] = f[0][2] = 0;
for (int i = 1; i <= n; i ++) {
f[i][0] = f[i][1] = f[i][2] = 0;
int le = max(x - L[i], 0); le = min (le, R[i] - L[i]);
int ri = max(R[i] - x, 0); ri = min (ri, R[i] - L[i]);
assert (le + ri == R[i] - L[i]);
pls (f[i][0], 1ll * (f[i - 1][0] + f[i - 1][2]) * le % P);
pls (f[i][1], 1ll * (f[i - 1][0]) * ri % P);
pls (f[i][2], 1ll * f[i - 1][1] * le % P);
}
int ans = 0;
lep (i, 0, 2) pls (ans, f[n][i]);
int mul = 1;
lep (i, 1, n) mul = 1ll * mul * (R[i] - L[i]) % P;
//cerr << x << ' ' << ans << ' ' << mul << endl;
ans = (mul - ans + P) % P;
return ans;
}
int brute(int l, int r) {
int ans = 0;
lep (i, l, r) pls (ans, getC(i));
return ans;
}
struct Lag {
int X[N], Y[N], fac[N * N], inv[N * N], tmp[N * N];
int id[N][N];
void getinv() {
int tot = 0;
lep (i, 1, n + 2) lep (j, 1, n + 2) if (i != j) id[i][j] = ++ tot, fac[tot] = (X[i] - X[j] + P) % P, tmp[tot] = fac[tot], inv[tot] = 0;
fac[0] = 1; tmp[0] = 1;
lep (i, 1, tot) fac[i] = 1ll * fac[i] * fac[i - 1] % P;
inv[tot] = power (fac[tot], P - 2);
rep (i, tot - 1, 0) inv[i] = 1ll * inv[i + 1] * tmp[i + 1] % P;
lep (i, 1, tot) inv[i] = 1ll * inv[i] * fac[i - 1] % P;
}
int get(int x) {
int ans = 0;
for (int i = 1; i <= n + 2; i ++) {
int mul = 1;
for (int j = 1; j <= n + 2; j ++) if (i != j) {
mul = 1ll * mul * (x - X[j] + P) % P;
mul = 1ll * mul * inv[id[i][j]] % P;
}
mul = 1ll * mul * Y[i] % P;
pls (ans, mul);
}
return ans;
}
} lag;
int calc (int l, int r) {
if (r - l + 1 <= n + 2) return brute(l, r);
for (int i = 1; i <= n + 2; i ++) {
lag.X[i] = l + i - 1;
lag.Y[i] = getC(l + i - 1);
pls (lag.Y[i], lag.Y[i - 1]);
}
lag.getinv();
return lag.get(r);
}
void solve() {
cin >> n;
vector<int> p;
lep (i, 1, n) cin >> L[i], p.push_back (L[i]);
lep (i, 1, n) cin >> R[i], ++ R[i], p.push_back (R[i]);
p.push_back (1);
p.push_back (1e9 + 1);
sort (p.begin(), p.end());
p.erase (unique (p.begin(), p.end()), p.end());
int ans = 0;
for (int x : p) pls (ans, getC(x));
for (int i = 0; i + 1 < (int) p.size(); i ++) {
int l = p[i] + 1, r = p[i + 1] - 1;
if (l > r) continue;
pls (ans, calc(l, r));
}
cout << ans << '\n';
}
int main() {
ios :: sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int Case;
cin >> Case;
while (Case --) solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3712kb
input:
10 5 5 1 4 3 2 14 2 5 3 2 5 4 5 1 2 3 13 7 1 2 3 5 5 2 5 3 1 10 2 12 3 2 5 5 5 3 1 5 57 5 3 1 5 5 2 2 3 3 5 4 5 4 4 5 5 4 5 3 5 3 13 7 3 5 3 5 5 1 4 2 3 14 3 4 2 3 5 1 2 5 4 5 2 8 5 7 5 5 1 1 3 5 1 8 2 3 8 1 5 4 4 4 2 3 5 10 5 2 3
output:
180 170 650 265 182 173 120 296 192 131
result:
ok 10 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
10 5 1 2 2 5 3 6 4 2 6 3 5 4 4 1 4 3 6 7 2 5 3 5 5 3 4 2 4 5 7 5 2 6 5 1 5 3 5 2 7 7 3 5 2 5 1 3 3 2 2 10 5 3 2 2 5 4 4 4 5 3 4 11 9 5 3 5 5 3 2 1 3 13 5 2 1 5 5 5 4 1 2 5 10 6 1 2 5 5 3 5 3 4 2 5 9 3 5 2 5 1 1 3 2 1 7 3 3 3 1
output:
120 230 144 110 110 289 324 89 140 122
result:
ok 10 lines
Test #3:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
10 5 3 1 3 4 4 9 1 3 10 4 5 1 1 3 1 1 9 1 3 3 1 5 5 1 2 3 1 74 1 2 3 1 5 2 5 5 3 4 5 6 8 3 4 5 2 1 3 4 5 2 4 6 4 5 5 2 4 2 1 3 2 11 3 2 3 5 1 5 4 4 2 1 14 6 6 2 5 4 1 3 5 1 9 2 4 5 1 5 4 1 2 4 4 6 1 6 4 4 5 3 2 5 3 5 8 8 5 3 5
output:
196 76 140 172 72 80 486 84 65 224
result:
ok 10 lines
Test #4:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
10 5 676437428 903889545 700650370 965758082 146716866 676437431 903889567 700650370 965758082 146716866 5 517457740 64600397 388618400 783268973 388618400 517457797 64600397 388618400 783268973 388618400 5 971452763 106948541 259878781 537741075 9504353 971452780 106948544 259878781 537741075 95043...
output:
157838571 539867046 711272106 123881231 497944943 9791579 539012259 963879245 315607794 495624077
result:
ok 10 lines
Test #5:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
10 5 462008700 417744555 925098328 70231697 547596413 462008735 417744555 925098328 70231697 547596413 5 294230630 403894618 294230635 403894620 403894617 294230638 403894620 294230635 403894620 403894617 5 757647830 757647826 757647828 184694646 161891480 757647839 757647827 757647830 184694646 161...
output:
713470735 905154643 458869425 477055327 633375786 349097981 980046476 478461437 573246310 810688575
result:
ok 10 lines
Test #6:
score: 0
Accepted
time: 9ms
memory: 4096kb
input:
10 150 7 1 8 8 2 3 8 2 1 3 2 10 9 7 3 9 4 5 4 5 10 7 9 9 9 3 4 7 10 8 5 3 5 1 8 4 1 2 7 9 10 9 1 7 4 7 6 8 7 6 6 7 4 5 10 8 7 10 2 8 1 4 9 2 9 3 9 6 2 2 7 7 10 8 4 10 4 1 7 3 3 5 4 3 9 7 4 1 8 1 4 4 2 7 5 4 9 6 5 8 6 4 8 7 4 6 8 8 2 9 8 3 10 9 2 4 6 10 2 8 9 1 6 6 7 8 8 7 8 8 8 3 4 6 3 8 10 10 10 3 ...
output:
8640 8000 9600 8100 9360 9900 9600 9960 9300 5560
result:
ok 10 lines
Test #7:
score: 0
Accepted
time: 9ms
memory: 4096kb
input:
10 150 5 4 2 6 6 9 4 8 4 9 2 5 4 7 5 4 2 1 10 10 6 5 10 2 5 8 4 2 10 4 10 8 4 1 4 1 6 3 2 4 1 10 10 1 9 7 7 4 7 6 9 2 4 5 2 6 2 9 10 6 6 8 7 7 1 9 1 7 5 3 4 9 5 2 3 2 10 2 9 3 1 3 7 9 8 3 7 2 2 8 8 5 2 4 8 4 10 10 2 1 10 8 10 3 7 1 6 9 9 7 8 1 9 3 7 6 4 9 1 2 7 8 4 8 6 7 4 2 7 3 9 5 6 6 1 1 9 6 3 6 ...
output:
5760 9600 6580 7680 5280 7200 8640 8000 5400 5040
result:
ok 10 lines
Test #8:
score: 0
Accepted
time: 7ms
memory: 3968kb
input:
10 150 1 1 7 5 2 6 5 9 10 2 5 9 10 10 9 5 2 2 8 7 2 10 9 5 10 4 4 10 3 1 3 8 5 8 3 5 9 4 2 1 4 1 3 2 5 4 4 7 10 2 7 10 9 9 1 1 2 4 7 2 1 4 2 4 5 1 6 6 6 5 10 3 7 5 7 7 7 4 3 3 3 5 3 9 9 8 5 7 5 5 1 5 1 5 7 2 1 8 7 7 7 3 8 6 7 8 4 5 10 7 5 7 4 8 7 2 6 6 7 6 2 1 6 6 8 9 3 9 2 7 9 1 2 1 7 7 4 3 3 1 4 3...
output:
8800 8100 5040 5580 9600 7200 6400 5184 7560 8640
result:
ok 10 lines
Test #9:
score: 0
Accepted
time: 716ms
memory: 3968kb
input:
10 150 390717977 225426217 217154512 811659013 811659022 811659006 811659019 811658998 380139276 562680969 391897894 391897902 610662417 702576570 778349151 778349150 144611847 144611847 888681165 952726258 635003873 635003864 365476184 353032583 492888825 492888833 451690481 492888832 492888828 781...
output:
444384507 582048587 4116309 958927956 240831257 919504659 253033294 811573108 93791855 55056035
result:
ok 10 lines
Test #10:
score: 0
Accepted
time: 727ms
memory: 4096kb
input:
10 150 639295555 548367354 795034024 795034022 966256461 795034026 795034019 795034024 795034024 236525600 236525591 236525601 702472531 628995729 702472534 409845953 409845958 430611099 965171120 216366412 173295815 311261799 311261793 113953747 830664527 290505090 830664533 273223393 617764565 273...
output:
937895614 451483826 722427169 185150800 218102505 102966546 445812982 11748745 363947119 423405610
result:
ok 10 lines
Test #11:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
10 3 544728022 153689801 431863569 962200031 220484001 642878600 3 421093150 239667044 200668081 921717358 939761114 474185560 3 517484553 194763387 57955343 815612679 384192788 271266363 3 214367561 759072795 528460561 303043703 861920493 583504876 3 143012658 242807202 110332706 980720465 65744848...
output:
293616219 48585431 362851773 192424288 936380090 286057574 444732014 660047559 2182519 70392946
result:
ok 10 lines
Test #12:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
10 3 298079042 283121490 717390320 437344567 909940091 774539057 3 235438777 376875054 584255176 478700356 640919350 964768573 3 504253873 213254989 281505721 790055054 369444342 899259056 3 242453813 574481027 433905467 604033969 874943153 488294451 3 155021502 321365687 394277313 588948932 3628728...
output:
658457380 752702154 881598439 284195799 542121898 669197146 513534536 764463052 817670155 823615527
result:
ok 10 lines
Test #13:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
10 3 277164454 177504386 630108854 815592583 817130094 966582180 3 553551886 526662439 221462453 877993210 612603746 809537190 3 169107669 114697789 9365466 566730568 727422421 814482341 3 773373879 420215722 106068835 868342918 919639071 445011274 3 785827099 88432369 496957960 847893274 886893130 ...
output:
461710583 414550512 334516230 388987842 533579032 470040652 305411016 722018199 415828227 836463369
result:
ok 10 lines
Test #14:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
10 3 802940830 180816657 739400517 866223617 790954548 859222671 3 319700485 420670621 20112496 848710888 862460339 119058099 3 570852685 257303395 22343287 968627558 669195733 23553532 3 772960648 19212766 491996184 918599736 605893944 555566188 3 601445601 101290141 337160285 665968569 606274511 8...
output:
49494813 830694683 945521224 293496959 293657772 321812024 438726817 205376054 845441105 110533117
result:
ok 10 lines
Test #15:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
10 3 115993273 597120648 886068528 721362023 618405041 901128755 3 684616276 385798500 452823159 885203911 544535789 682511433 3 616136314 31141818 241912255 828030263 209761597 509249219 3 334790687 771587111 334138763 557406637 803908718 907322782 3 116832581 153505687 37609451 883976815 459234532...
output:
747305720 941038555 57462918 748152292 250716967 976657098 857556760 824115560 380112870 174895205
result:
ok 10 lines
Test #16:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
10 7 404918898 292311647 631396922 706089372 4898185 154066652 86654812 803261286 973316302 717003179 797462316 600001001 750252153 244616894 10 253859357 738242986 419522759 102326522 553403220 460105736 155341224 312766161 586806247 147676006 778607664 878991494 845146711 677678023 915736076 57019...
output:
849134175 306713685 881527929 251671699 694452876 311001344 628555523 346587535 902942159 103821021
result:
ok 10 lines
Test #17:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
10 7 121111846 445340255 191941417 423275256 868126532 333767818 25022569 260853257 809478517 266094588 686280489 934489058 456034373 948948371 7 301110391 272236238 727134768 371870131 919766596 151622847 242954800 358031962 617845183 850880394 555542716 925523610 266646892 265133857 7 539967256 15...
output:
497125921 258253342 380704069 786019436 912261795 632500387 250869698 544524402 415934297 985785773
result:
ok 10 lines
Test #18:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
10 9 207858087 631694427 287886898 358182369 613992517 796728947 498835939 435131275 390639390 775917322 791575481 548422068 549231678 900712002 989988795 625864644 894221883 889007873 7 292127639 293563569 94414926 757026897 216093287 54668573 659126092 585405226 551240378 279162638 958909562 78949...
output:
215421667 614451181 77960994 266883019 108364173 970035897 743934096 768983378 86008080 584393526
result:
ok 10 lines
Test #19:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
10 8 30947596 383236048 143686783 309066197 536154193 5357155 76140165 744480193 727145099 507226631 497967471 523313738 779787626 264931916 269289614 882809271 9 40989614 631023222 328430419 26599364 180448969 683186487 806322666 160679452 499905995 131736654 735260968 391251944 511881433 791591704...
output:
942880522 623635592 885310284 44833726 869194242 904636919 998102640 520298689 554134728 321585202
result:
ok 10 lines
Test #20:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
10 7 527148962 715399291 137919183 531321136 50973907 95271028 254976744 825165194 980761753 372939195 981935096 168277555 246414642 635564167 7 101659477 797868142 700786608 2398186 482053627 267841983 47067041 218316683 997740323 756305919 260795527 886244499 427633956 260347782 8 389457848 115128...
output:
685565542 812084335 379192186 811781184 613700870 107574211 758326954 457925630 213735319 69350931
result:
ok 10 lines
Test #21:
score: 0
Accepted
time: 7ms
memory: 3968kb
input:
10 149 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 2 1 1 1 2 1 1 2 2 1 1 1 1 1 2 2 1 1 1 2 2 1 1 1 2 1 1 1 1 1 1 2 1 1 2 1 1 1 1 2 1 1 2 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 2 2 2 1 1 2 2 2 2 1 1 1 1 1 2 2 1 1 1 1 1 1 2 1 1 1 1 1 2 1 2 1 1 1 1 1 2 2 1 1...
output:
635008130 124160285 540032506 80065005 270016253 562080146 317504065 248320570 986564553 317504065
result:
ok 10 lines
Test #22:
score: 0
Accepted
time: 8ms
memory: 3968kb
input:
10 149 1 1 1 1 1 2 1 2 1 1 2 1 2 2 2 2 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 2 1 2 1 2 1 2 2 1 2 2 1 1 1 1 1 1 2 1 1 1 1 2 1 2 1 1 1 2 1 2 1 2 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 2 2 2 1 1 1 2 1 1 2 2 2 2 1 2 1 1 1 2 2 1 1 1 1 2 2 1 1 1 1 1 2 2 1 1 1 1 2 2 1 1 2 2 1 1 1 1 1 1 2 2 1 1 1...
output:
80065005 582344008 281040073 993282280 540032506 248320570 993282280 160130010 785032743 317504065
result:
ok 10 lines
Test #23:
score: 0
Accepted
time: 6ms
memory: 4096kb
input:
10 148 2 2 2 1 1 2 2 2 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 1 1 1 2 1 2 2 2 1 2 2 1 1 1 1 1 1 1 2 2 1 2 1 2 1 1 1 1 1 2 1 1 2 2 1 1 1 2 1 1 2 1 2 2 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 2 1 1 1 2 1 1 2 1 1 1 2 1 2 1 1 1 1 1 1 1 2 1 2 1 1 1 2 1 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1 1 1 2 1 1 2...
output:
160130010 562080146 320260020 248320570 281040073 329376018 635008130 160130010 160130010 80065005
result:
ok 10 lines
Test #24:
score: 0
Accepted
time: 6ms
memory: 3968kb
input:
10 148 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 2 2 1 2 1 1 2 1 2 1 1 1 1 2 1 2 1 2 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 2 1 1 1 2 2 1 1 2 2 2 1 1 1 1 2 1 2 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 2 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 2...
output:
80065005 946258191 164688009 946258191 640520040 540032506 160130010 496641140 946258191 892516375
result:
ok 10 lines
Test #25:
score: 0
Accepted
time: 6ms
memory: 3968kb
input:
10 148 1 1 1 1 1 2 1 1 2 1 1 2 1 1 2 2 1 2 1 1 1 1 2 2 2 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 2 2 1 1 1 1 1 1 2 2 1 1 1 1 2 1 1 2 1 1 2 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 2 2 2 1 2 2 1 2 1 2 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 2 1 1 2 1 1 2 1 1 2 2 1 1 1 2 2 2 2...
output:
496641140 320260020 986564553 993282280 270016253 658752036 270016253 329376018 993282280 993282280
result:
ok 10 lines
Test #26:
score: 0
Accepted
time: 21ms
memory: 3968kb
input:
10 150 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752968683 752...
output:
726708573 915419289 85145284 579300071 537665168 366473149 561290774 793806849 611890051 614402417
result:
ok 10 lines
Test #27:
score: 0
Accepted
time: 19ms
memory: 4096kb
input:
10 150 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319595269 319...
output:
388589272 602346764 462537146 60202120 320843890 351814258 42233160 712110504 611906201 377499089
result:
ok 10 lines
Test #28:
score: 0
Accepted
time: 21ms
memory: 3968kb
input:
10 147 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492274 86492...
output:
768622775 683829672 830294274 581780613 343038002 920705863 13282476 26292105 317688586 363705467
result:
ok 10 lines
Test #29:
score: 0
Accepted
time: 19ms
memory: 3968kb
input:
10 149 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322038482 322...
output:
729883852 742836494 375525630 921641879 871647658 955516173 697036547 96409123 321760629 870226465
result:
ok 10 lines
Test #30:
score: 0
Accepted
time: 21ms
memory: 3968kb
input:
10 149 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254944881 254...
output:
598767342 925587638 691164677 840186622 93510386 361124370 918981547 358852426 152412885 63135715
result:
ok 10 lines
Test #31:
score: 0
Accepted
time: 20ms
memory: 3968kb
input:
10 148 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303484245 303...
output:
494645000 102248666 116650840 202825805 881683198 70807294 85078744 509890856 124535818 321587476
result:
ok 10 lines
Test #32:
score: 0
Accepted
time: 19ms
memory: 4096kb
input:
10 150 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433251 67433...
output:
844424406 219516167 108325299 602420453 909018124 182398298 129297636 550925302 989928501 230895797
result:
ok 10 lines
Test #33:
score: -100
Time Limit Exceeded
input:
10 147 566148717 117031228 46015763 314994311 603135631 225980456 303552874 219843870 301970004 54574233 142459962 262415059 182837687 131567128 197386620 287794220 47113175 720054924 383821011 255651947 31786762 377370893 91536176 113937389 683483401 157998567 288284812 82724379 937975535 303995177...
output:
973175117 487609376 379373784 680113005 816631967 660582904 410286898 332733428 296751855 631972126