QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#18796 | #2116. Oranżada [B] | Elegia | 10 ✓ | 82ms | 4236kb | C++17 | 493b | 2022-01-27 13:48:48 | 2022-05-06 02:39:31 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
const int _ = 500005;
int N, M;
bool vis[_];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
cin >> N >> M;
int c1 = 0, c2 = 0;
ull ans = 0;
for (int i = 1; i <= N; ++i) {
int ai; cin >> ai;
if (vis[ai] || c1 >= M) ++c2;
else { ++c1; ans += c2; }
vis[ai] = true;
}
if (c1 != M) cout << "-1\n";
else cout << ans << '\n';
return 0;
}
详细
Subtask #1:
score: 1
Accepted
Test #1:
score: 1
Accepted
time: 3ms
memory: 3736kb
input:
5 3 3 3 3 1 2
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 3ms
memory: 3672kb
input:
3 2 1 1 1
output:
-1
result:
ok single line: '-1'
Test #3:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1 1 1
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
2 2 2 1
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
3 2 3 1 1
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 4ms
memory: 3556kb
input:
4 1 4 4 4 1
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 3ms
memory: 3576kb
input:
5 2 5 2 5 5 4
output:
0
result:
ok single line: '0'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
9 3 4 4 8 2 3 8 7 9 2
output:
2
result:
ok single line: '2'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3684kb
input:
9 4 9 3 3 5 3 5 8 9 4
output:
4
result:
ok single line: '4'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
9 9 9 2 5 7 8 9 4 3 9
output:
-1
result:
ok single line: '-1'
Test #11:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
9 2 9 9 9 9 9 9 9 9 9
output:
-1
result:
ok single line: '-1'
Test #12:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
9 1 6 6 6 8 6 6 6 6 6
output:
0
result:
ok single line: '0'
Test #13:
score: 0
Accepted
time: 3ms
memory: 3608kb
input:
9 3 1 4 9 9 9 7 1 9 7
output:
0
result:
ok single line: '0'
Test #14:
score: 0
Accepted
time: 3ms
memory: 3612kb
input:
9 1 2 1 9 4 4 9 7 6 8
output:
0
result:
ok single line: '0'
Test #15:
score: 0
Accepted
time: 3ms
memory: 3732kb
input:
9 1 1 3 4 9 2 6 8 7 5
output:
0
result:
ok single line: '0'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
9 1 5 4 5 4 5 4 4 5 4
output:
0
result:
ok single line: '0'
Test #17:
score: 0
Accepted
time: 2ms
memory: 3536kb
input:
9 6 4 1 5 5 1 5 1 3 4
output:
-1
result:
ok single line: '-1'
Test #18:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
9 6 3 9 6 3 4 8 7 5 1
output:
3
result:
ok single line: '3'
Test #19:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
9 7 6 1 5 9 3 8 7 2 4
output:
0
result:
ok single line: '0'
Test #20:
score: 0
Accepted
time: 3ms
memory: 3628kb
input:
9 1 8 8 8 8 8 8 8 8 8
output:
0
result:
ok single line: '0'
Test #21:
score: 0
Accepted
time: 3ms
memory: 3612kb
input:
9 1 3 8 3 3 8 3 3 8 3
output:
0
result:
ok single line: '0'
Test #22:
score: 0
Accepted
time: 3ms
memory: 3736kb
input:
9 6 9 5 9 4 8 3 1 7 2
output:
4
result:
ok single line: '4'
Subtask #2:
score: 1
Accepted
Test #23:
score: 1
Accepted
time: 3ms
memory: 3596kb
input:
99 28 55 95 94 77 71 93 15 74 35 89 47 31 23 96 75 18 39 24 51 55 87 7 67 31 44 93 47 37 27 65 86 5 42 9 77 31 42 45 45 95 88 53 37 25 1 39 81 42 91 66 56 84 97 25 78 52 94 26 26 16 78 92 33 99 83 94 13 65 43 37 71 48 96 14 63 35 87 48 22 55 15 53 30 52 59 70 30 62 63 2 91 47 20 77 16 2 75 82 40
output:
25
result:
ok single line: '25'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
100 93 31 30 44 55 77 44 42 56 19 24 49 72 70 27 1 24 46 93 12 87 13 3 48 12 70 5 41 79 50 70 78 34 55 66 75 24 7 36 95 44 1 11 68 29 56 49 20 70 7 34 58 84 22 2 12 2 37 72 88 11 53 2 76 36 23 57 100 53 77 40 24 86 40 12 45 70 30 95 18 72 32 77 45 27 13 22 53 11 25 68 10 28 100 50 66 29 97 77 10 1
output:
-1
result:
ok single line: '-1'
Test #25:
score: 0
Accepted
time: 3ms
memory: 3464kb
input:
100 3 6 89 66 95 40 69 27 20 38 91 12 88 68 95 20 60 5 37 53 70 47 98 84 62 87 50 99 79 33 84 9 27 47 66 58 77 88 9 11 81 54 35 63 14 55 35 82 94 13 44 67 40 65 36 25 3 34 93 9 46 1 58 49 71 59 43 30 66 16 78 22 67 78 91 82 93 92 62 86 16 73 57 53 16 33 82 68 68 79 97 22 70 1 55 34 4 38 44 57 10
output:
0
result:
ok single line: '0'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
98 34 21 95 20 95 67 45 40 7 66 84 16 27 16 59 92 9 73 92 27 21 16 53 95 21 51 36 56 2 17 71 45 16 79 40 4 84 13 53 34 80 11 39 72 90 46 30 3 80 85 28 84 30 2 8 44 48 76 43 58 91 6 78 4 24 81 36 38 11 66 94 61 75 26 89 71 35 72 90 47 72 42 29 55 42 60 34 26 1 8 46 97 44 22 40 49 10 44 75
output:
220
result:
ok single line: '220'
Test #27:
score: 0
Accepted
time: 3ms
memory: 3680kb
input:
100 67 22 1 4 23 61 85 75 77 80 82 48 56 85 51 46 52 28 12 62 90 20 6 18 63 2 84 16 87 5 95 78 12 21 46 66 22 10 10 44 43 23 73 32 83 96 26 82 8 16 95 9 55 59 10 34 24 11 100 40 22 27 36 92 84 36 33 15 21 100 85 47 37 89 79 97 12 97 45 87 44 12 7 70 6 90 8 8 74 32 17 7 48 7 3 90 13 76 14 58 21
output:
490
result:
ok single line: '490'
Test #28:
score: 0
Accepted
time: 3ms
memory: 3632kb
input:
98 60 11 23 5 14 84 57 85 79 13 47 64 49 39 69 35 47 1 72 47 81 60 57 21 4 32 4 47 76 45 32 52 78 89 47 7 47 91 50 11 90 45 5 41 85 81 74 97 6 24 61 18 65 46 63 89 83 37 87 23 69 23 72 38 74 47 76 46 97 31 64 37 53 25 55 78 37 67 8 78 39 67 98 89 27 23 89 45 89 58 63 47 86 51 38 68 42 21 82
output:
-1
result:
ok single line: '-1'
Test #29:
score: 0
Accepted
time: 3ms
memory: 3632kb
input:
100 62 58 95 30 81 69 14 84 46 99 80 33 77 1 72 83 23 59 93 55 68 16 66 71 5 89 67 48 86 54 97 27 5 75 49 35 20 15 41 13 32 53 56 22 40 62 17 3 81 50 39 19 43 13 40 91 88 10 4 47 53 64 24 26 39 75 8 68 78 65 25 52 60 63 7 38 89 51 36 9 18 63 96 30 85 11 70 94 6 24 2 90 44 37 10 57 61 34 73 76 31
output:
89
result:
ok single line: '89'
Test #30:
score: 0
Accepted
time: 3ms
memory: 3464kb
input:
95 1 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
output:
0
result:
ok single line: '0'
Test #31:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
99 2 85 33 33 85 33 85 33 85 33 33 33 33 33 33 85 33 33 85 85 33 85 85 85 85 33 33 85 85 33 85 33 33 85 33 33 85 85 85 85 33 33 85 33 33 33 85 33 33 85 85 33 85 33 33 33 33 85 85 85 33 33 85 85 85 85 33 33 85 33 33 33 33 33 85 33 33 85 85 85 85 85 85 33 85 33 33 33 33 85 85 33 85 85 33 85 33 33 33 85
output:
0
result:
ok single line: '0'
Test #32:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
100 1 80 80 28 80 57 57 2 57 80 57 2 2 57 57 70 2 70 29 2 2 2 2 80 57 57 2 28 51 80 80 29 29 2 70 2 2 70 29 2 51 2 28 57 2 28 70 57 70 57 2 57 80 29 57 29 29 70 57 29 57 2 29 80 28 70 2 57 28 51 80 2 57 57 51 2 2 70 80 2 2 80 57 70 57 80 2 57 28 57 57 2 2 57 57 28 80 57 70 51 70
output:
0
result:
ok single line: '0'
Test #33:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
100 15 53 36 49 31 49 16 39 73 36 39 24 16 73 39 47 24 47 53 47 36 44 39 54 73 69 27 49 44 53 24 44 44 27 62 44 24 49 55 54 53 53 91 53 44 69 39 53 47 73 44 49 53 16 73 69 44 73 54 16 16 73 39 53 53 53 91 16 73 53 54 36 39 53 44 49 53 16 24 97 16 69 24 27 73 39 11 47 62 91 47 16 16 53 55 27 27 49 39...
output:
104
result:
ok single line: '104'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
97 61 85 40 51 5 67 63 84 37 74 24 58 63 81 62 91 58 91 53 81 5 72 80 79 42 12 87 9 40 40 37 39 11 12 92 84 62 37 49 13 3 70 74 57 74 32 71 82 39 30 74 55 15 28 73 51 43 26 32 33 30 74 70 32 7 8 95 23 39 31 13 90 66 39 6 11 91 86 41 15 28 1 54 20 8 56 29 19 69 32 73 76 74 12 74 28 10 70
output:
-1
result:
ok single line: '-1'
Test #35:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
100 23 100 50 54 57 94 85 69 20 63 39 38 32 61 64 35 79 82 98 11 24 1 46 91 88 22 30 37 54 54 76 44 100 36 13 12 33 2 41 26 83 27 78 1 45 54 72 14 85 2 60 32 99 17 48 65 78 74 89 86 90 59 32 62 36 2 1 66 41 19 4 92 76 23 78 53 29 84 54 9 54 68 63 53 64 77 47 29 86 95 93 14 97 69 69 31 78 54 34 95 46
output:
0
result:
ok single line: '0'
Test #36:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
100 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ...
output:
0
result:
ok single line: '0'
Test #37:
score: 0
Accepted
time: 3ms
memory: 3604kb
input:
98 1 30 52 30 30 30 52 30 52 52 52 30 52 30 30 30 52 30 52 30 52 30 52 52 30 52 52 30 52 52 30 30 52 30 30 52 30 30 52 30 30 30 30 52 30 30 52 30 52 30 52 30 30 52 30 30 52 52 52 52 52 30 30 30 52 30 52 52 30 30 52 52 30 52 30 52 52 52 52 30 30 30 52 30 52 30 30 30 30 52 52 52 52 30 30 30 30 30 52
output:
0
result:
ok single line: '0'
Test #38:
score: 0
Accepted
time: 2ms
memory: 3580kb
input:
100 1 95 2 95 2 95 73 79 2 79 2 2 73 73 95 95 2 2 79 2 73 2 73 95 2 95 2 2 2 2 2 2 2 95 2 73 79 2 2 95 2 2 2 95 95 2 79 95 2 2 95 95 95 95 95 95 2 73 79 2 73 79 73 95 2 95 2 79 95 95 95 2 2 95 95 79 73 2 2 95 95 95 2 79 2 2 73 79 95 2 73 79 2 95 95 2 2 95 2 73 95
output:
0
result:
ok single line: '0'
Test #39:
score: 0
Accepted
time: 3ms
memory: 3664kb
input:
99 1 86 73 11 6 6 57 73 29 57 66 78 66 73 86 66 11 66 1 6 66 78 6 78 1 66 44 73 73 6 29 11 56 44 11 6 11 6 6 1 11 86 56 6 66 6 56 29 6 6 29 1 66 6 66 29 44 6 44 66 78 29 66 11 78 66 73 29 57 66 57 57 66 73 66 66 44 6 6 57 1 73 86 86 29 6 6 6 6 66 6 66 78 1 6 66 57 66 6 56
output:
0
result:
ok single line: '0'
Test #40:
score: 0
Accepted
time: 2ms
memory: 3604kb
input:
100 57 68 18 26 65 33 24 47 34 65 100 45 20 63 10 39 92 5 98 90 49 82 60 86 63 56 99 42 1 44 9 9 82 94 18 53 60 14 60 90 49 16 66 45 93 9 83 82 70 30 21 5 97 5 97 63 65 16 38 66 70 25 63 1 63 92 26 11 87 29 35 51 29 71 83 85 33 20 78 34 37 10 26 34 19 93 87 39 89 36 14 53 67 59 97 67 63 56 26 73 58
output:
671
result:
ok single line: '671'
Subtask #3:
score: 1
Accepted
Test #41:
score: 1
Accepted
time: 1ms
memory: 3600kb
input:
999 99 186 77 54 713 480 809 362 3 851 331 486 118 799 51 389 460 61 983 340 909 910 913 403 467 935 479 511 855 694 118 372 477 613 639 452 573 800 213 279 567 868 361 90 544 722 296 385 953 192 566 913 401 944 63 298 987 776 91 468 548 967 893 281 768 28 97 375 890 123 991 309 583 887 17 285 803 6...
output:
127
result:
ok single line: '127'
Test #42:
score: 0
Accepted
time: 1ms
memory: 3672kb
input:
1000 162 825 922 847 249 631 217 226 944 811 527 189 449 403 998 754 332 72 720 487 453 687 613 32 644 248 540 497 728 449 930 934 399 508 607 292 91 890 874 312 506 65 907 844 730 436 486 741 712 559 917 30 67 600 230 768 41 695 64 486 631 891 611 921 697 68 271 302 960 857 874 508 744 936 303 746 ...
output:
1070
result:
ok single line: '1070'
Test #43:
score: 0
Accepted
time: 3ms
memory: 3576kb
input:
1000 341 702 477 654 659 703 96 907 461 256 8 353 250 943 506 125 171 257 493 444 321 398 120 542 86 275 875 217 792 957 16 710 945 981 418 839 410 683 501 829 539 285 94 179 985 958 847 291 139 388 151 495 429 944 699 89 767 671 411 683 589 921 356 148 527 309 866 584 928 855 418 634 312 656 1000 3...
output:
6940
result:
ok single line: '6940'
Test #44:
score: 0
Accepted
time: 3ms
memory: 3632kb
input:
1000 115 446 380 488 267 936 145 268 961 488 213 985 268 423 854 426 191 340 488 191 380 268 423 488 732 862 786 694 397 628 268 343 488 426 862 965 268 268 355 220 58 488 488 946 966 841 423 718 709 862 488 854 268 488 423 488 488 268 446 446 268 162 203 700 423 854 10 220 268 205 181 709 960 267 3...
output:
-1
result:
ok single line: '-1'
Test #45:
score: 0
Accepted
time: 3ms
memory: 3688kb
input:
1000 142 675 682 584 885 484 904 505 948 141 484 560 700 788 867 505 976 248 540 94 96 885 90 875 700 551 228 928 337 44 760 224 547 215 505 784 680 118 990 117 473 960 505 427 96 11 592 484 523 529 477 287 411 859 45 734 503 700 484 548 242 333 106 657 612 947 295 299 25 976 123 3 192 436 241 505 4...
output:
3737
result:
ok single line: '3737'
Test #46:
score: 0
Accepted
time: 3ms
memory: 3604kb
input:
1000 2 966 966 995 995 966 966 995 966 995 995 995 966 966 966 995 995 995 995 995 966 995 966 966 966 995 966 966 966 966 966 966 966 995 995 966 995 995 995 995 995 966 966 995 966 966 966 966 995 995 995 995 995 995 995 995 966 966 995 995 995 966 995 995 966 995 995 995 995 995 995 995 995 995 9...
output:
1
result:
ok single line: '1'
Test #47:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
998 30 306 679 306 940 306 940 449 303 940 733 100 765 212 687 100 940 31 471 177 97 348 634 306 306 682 574 634 100 306 679 554 306 765 452 42 306 449 940 31 306 518 634 319 733 590 634 765 306 306 574 31 306 940 940 679 687 574 306 634 761 306 518 634 679 306 940 574 733 574 682 634 634 634 679 57...
output:
-1
result:
ok single line: '-1'
Test #48:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
1000 26 63 462 994 847 728 459 994 994 6 350 63 241 648 331 264 331 462 206 416 89 969 850 567 241 669 568 275 994 89 462 849 774 481 421 89 63 838 838 567 774 462 89 806 447 558 750 102 753 152 42 89 421 847 462 375 48 89 462 6 459 806 462 462 3 89 585 89 89 849 913 319 994 780 994 838 462 967 568 ...
output:
111
result:
ok single line: '111'
Test #49:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
998 557 883 627 332 967 181 734 843 638 839 82 192 574 6 540 895 819 694 505 372 904 676 800 240 752 38 808 755 949 730 827 368 209 689 417 417 372 189 928 712 410 503 437 885 557 253 275 533 257 397 67 98 709 812 314 730 426 211 857 568 105 244 260 426 752 202 944 781 604 868 996 240 854 394 566 62...
output:
87985
result:
ok single line: '87985'
Test #50:
score: 0
Accepted
time: 3ms
memory: 3608kb
input:
1000 4 980 848 413 980 413 980 413 413 413 848 848 413 413 848 980 413 980 980 413 413 980 413 980 848 980 848 980 413 980 848 413 848 980 413 980 980 980 413 980 413 848 848 848 848 413 848 413 413 848 413 413 848 413 848 413 848 413 848 848 980 980 413 848 980 848 980 413 848 980 413 980 848 848 4...
output:
-1
result:
ok single line: '-1'
Test #51:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
1000 1 428 377 389 428 114 934 96 250 934 748 292 428 292 748 555 934 555 934 389 934 934 292 934 934 292 428 292 555 413 106 640 428 114 292 934 292 114 934 428 215 389 292 389 934 934 748 292 292 292 428 114 934 96 106 215 934 934 106 106 292 934 428 640 106 934 292 555 106 292 934 934 413 934 934...
output:
0
result:
ok single line: '0'
Test #52:
score: 0
Accepted
time: 2ms
memory: 3636kb
input:
996 20 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 472 4...
output:
12357
result:
ok single line: '12357'
Test #53:
score: 0
Accepted
time: 4ms
memory: 3652kb
input:
1000 19 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 674 ...
output:
10831
result:
ok single line: '10831'
Test #54:
score: 0
Accepted
time: 2ms
memory: 3612kb
input:
1000 500 416 237 221 14 26 42 339 159 89 379 123 207 125 98 155 484 268 441 53 267 8 487 78 226 154 102 328 62 81 395 182 338 200 299 446 169 250 357 105 243 111 121 16 403 415 313 201 143 419 418 245 75 443 31 290 380 366 80 424 304 116 332 310 18 233 301 429 133 312 498 38 255 214 435 145 428 41 1...
output:
43103
result:
ok single line: '43103'
Test #55:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1000 300 832 899 725 708 91 397 53 337 383 959 771 428 782 136 392 235 39 510 758 568 17 797 801 363 53 268 355 86 658 853 88 433 169 234 839 856 285 467 80 564 994 476 789 864 68 49 628 482 751 720 390 26 939 720 353 119 538 827 782 995 590 900 548 847 233 936 216 656 127 446 45 507 446 864 967 572...
output:
15423
result:
ok single line: '15423'
Test #56:
score: 0
Accepted
time: 3ms
memory: 3672kb
input:
1000 570 493 476 615 195 881 259 391 283 935 139 247 297 389 945 711 840 279 631 748 146 108 773 40 562 514 24 539 119 363 218 698 172 92 151 521 724 42 626 10 723 705 283 233 184 90 947 739 643 416 267 913 687 505 190 633 151 243 771 76 967 60 132 932 638 416 153 616 731 505 490 565 768 133 69 68 7...
output:
62565
result:
ok single line: '62565'
Subtask #4:
score: 1
Accepted
Test #57:
score: 1
Accepted
time: 3ms
memory: 3688kb
input:
1000 377 72 618 368 188 789 704 222 38 400 334 83 577 867 394 174 581 53 168 326 31 168 753 587 953 22 776 487 327 807 115 924 85 763 322 356 835 168 710 549 615 97 753 465 327 149 508 33 403 789 237 171 594 676 77 461 948 323 554 341 575 526 889 146 522 537 467 100 117 927 427 12 367 567 756 8 661 ...
output:
11006
result:
ok single line: '11006'
Test #58:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
1000 846 2 619 89 896 802 373 818 374 449 145 765 156 658 544 252 795 448 363 952 97 724 382 759 92 150 840 455 55 482 692 187 239 425 638 374 94 715 888 43 389 727 293 301 638 744 734 243 757 270 874 439 301 455 959 511 187 203 888 163 12 184 733 195 13 606 375 728 502 125 176 311 560 880 139 302 3...
output:
-1
result:
ok single line: '-1'
Test #59:
score: 0
Accepted
time: 3ms
memory: 3668kb
input:
996 537 414 33 424 641 788 639 101 239 766 547 690 588 700 54 624 535 888 37 704 263 733 775 219 176 844 512 995 675 321 813 582 141 557 232 579 268 974 744 322 549 511 380 974 515 281 647 30 498 500 289 21 415 656 413 958 510 835 132 913 5 465 728 675 748 65 281 791 340 974 752 502 339 33 139 862 8...
output:
35598
result:
ok single line: '35598'
Test #60:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
1000 182 314 553 766 209 786 100 931 786 904 931 531 940 75 314 786 392 234 620 119 548 100 100 214 786 656 614 843 614 214 640 614 940 786 904 531 914 656 614 782 311 738 971 786 209 940 914 856 112 948 314 398 786 902 314 656 214 786 548 614 635 234 262 214 613 314 613 466 269 757 400 58 466 738 3...
output:
23615
result:
ok single line: '23615'
Test #61:
score: 0
Accepted
time: 3ms
memory: 3608kb
input:
1000 1 491 952 19 116 788 197 784 757 672 101 125 192 787 6 758 939 784 99 143 366 293 786 987 283 888 624 199 758 283 775 159 505 347 952 227 28 234 97 957 876 537 234 363 482 108 713 393 1000 653 164 551 934 639 686 457 159 613 428 263 101 274 947 723 879 153 384 86 517 101 991 101 961 389 414 589...
output:
0
result:
ok single line: '0'
Test #62:
score: 0
Accepted
time: 3ms
memory: 3604kb
input:
995 6 716 855 964 273 716 273 127 716 855 602 273 127 127 273 716 716 273 273 273 964 273 964 716 602 716 602 127 273 716 273 964 964 716 716 855 716 602 273 127 964 716 602 855 716 273 602 716 855 964 716 716 127 273 818 273 127 818 716 855 602 716 273 127 602 602 964 716 716 818 818 716 716 716 71...
output:
6
result:
ok single line: '6'
Test #63:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1000 36 790 904 961 505 404 228 369 448 538 228 790 790 668 867 790 790 896 790 228 345 768 489 228 345 790 345 822 644 717 790 790 228 228 381 768 605 500 454 574 790 790 345 822 454 383 345 411 574 722 266 822 252 228 120 790 499 983 543 70 896 768 949 363 404 345 228 345 896 768 363 228 454 228 7...
output:
482
result:
ok single line: '482'
Test #64:
score: 0
Accepted
time: 3ms
memory: 3616kb
input:
1000 50 381 786 704 48 918 493 423 138 259 918 893 259 482 609 591 728 535 984 771 259 700 291 381 728 138 975 259 199 918 632 799 400 237 259 591 259 686 526 642 259 51 62 463 259 517 440 694 923 620 34 407 486 180 950 934 259 869 359 948 869 482 20 728 371 5 259 497 259 932 493 492 259 923 621 493...
output:
407
result:
ok single line: '407'
Test #65:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
999 2 431 431 431 444 444 444 444 444 444 431 444 444 444 444 431 431 444 444 431 444 431 444 444 444 431 444 431 444 431 431 444 444 431 431 444 431 431 431 444 444 431 444 431 431 444 444 444 431 431 431 444 431 444 444 444 431 444 444 444 431 431 431 431 431 431 444 431 444 431 431 431 431 431 44...
output:
2
result:
ok single line: '2'
Test #66:
score: 0
Accepted
time: 2ms
memory: 3668kb
input:
1000 4 201 182 766 182 488 535 201 242 880 214 488 766 488 214 535 488 766 242 214 488 201 182 214 214 488 488 242 182 182 488 488 182 214 214 214 488 214 182 766 242 182 201 488 242 214 214 214 214 201 182 488 214 535 242 214 242 488 201 182 242 766 535 488 214 766 488 214 214 488 488 880 214 880 8...
output:
1
result:
ok single line: '1'
Test #67:
score: 0
Accepted
time: 3ms
memory: 3664kb
input:
1000 3 135 552 424 438 966 391 70 424 424 700 700 115 391 878 700 391 391 939 700 700 700 391 391 839 70 552 135 643 892 700 904 70 966 391 391 700 700 70 700 391 458 811 827 700 904 115 700 424 115 904 70 438 424 458 904 70 70 966 371 700 424 904 904 700 135 878 135 371 904 700 391 424 432 700 391 ...
output:
0
result:
ok single line: '0'
Test #68:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1000 21 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 204 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 614 ...
output:
-1
result:
ok single line: '-1'
Test #69:
score: 0
Accepted
time: 3ms
memory: 3540kb
input:
1000 500 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 777 777 777 777 777 777 777 777 777 777...
output:
211905
result:
ok single line: '211905'
Test #70:
score: 0
Accepted
time: 3ms
memory: 3688kb
input:
1000 500 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632 632...
output:
249001
result:
ok single line: '249001'
Test #71:
score: 0
Accepted
time: 3ms
memory: 3472kb
input:
1000 400 91 542 224 230 839 904 320 91 606 192 688 473 853 446 494 774 199 792 381 835 562 67 392 904 791 871 291 308 996 425 310 182 317 104 823 893 741 662 115 708 602 139 716 688 501 882 629 672 853 244 381 786 791 180 899 80 102 504 509 118 891 3 277 743 230 191 391 252 148 871 585 790 339 966 5...
output:
28166
result:
ok single line: '28166'
Subtask #5:
score: 1
Accepted
Test #72:
score: 1
Accepted
time: 17ms
memory: 3752kb
input:
150000 147511 20013 129288 120431 119918 21332 2835 129697 93674 124550 91660 111515 83582 135585 126610 13497 124807 34740 26908 79904 45042 7498 76762 65906 42593 11931 8660 121164 97528 10572 3077 105962 91620 60450 149852 131021 106923 20614 40788 7525 15882 91667 126604 48960 127510 22444 10320...
output:
-1
result:
ok single line: '-1'
Test #73:
score: 0
Accepted
time: 9ms
memory: 3744kb
input:
149998 53284 46081 127740 81899 58514 8805 61066 111491 67041 22838 85043 12503 13159 60735 27883 105485 122039 127303 132220 37496 58268 135377 105645 148761 47827 122507 129494 73957 123592 91831 106083 127672 92410 89647 52943 86371 34335 63111 40030 113316 145695 485 25148 80492 67944 59098 5147...
output:
210763882
result:
ok single line: '210763882'
Test #74:
score: 0
Accepted
time: 13ms
memory: 3796kb
input:
150000 69068 41556 10954 53691 35892 84584 84943 76498 149971 22307 100547 26763 122847 85135 95391 15057 142116 11908 108085 6666 6756 28332 19929 2644 40337 2104 133100 98606 106729 54282 107660 114582 97594 51473 97894 32516 149306 137006 39809 139911 36666 130840 142638 107092 8189 95338 2918 14...
output:
484691128
result:
ok single line: '484691128'
Test #75:
score: 0
Accepted
time: 17ms
memory: 3756kb
input:
149999 5870 30728 44452 93561 97615 140928 9025 17331 26795 130662 82291 98196 128079 9493 33442 74353 95203 79804 70756 141158 70143 92838 22835 135465 140697 33442 33442 130641 37381 114513 31601 146027 117117 3851 141988 23909 104771 104118 83186 80757 26795 124666 105293 125351 143421 33442 1212...
output:
71525754
result:
ok single line: '71525754'
Test #76:
score: 0
Accepted
time: 18ms
memory: 3828kb
input:
149995 60877 139761 77701 106694 24496 142728 65013 17541 136975 114770 14501 95412 92733 137839 71307 28700 133978 105882 112646 69742 126033 57887 71307 18794 99863 131190 18652 137839 14858 144923 93368 20723 58270 18794 114368 18794 57527 44858 75098 5482 44647 18794 18019 18019 97685 23060 7999...
output:
-1
result:
ok single line: '-1'
Test #77:
score: 0
Accepted
time: 17ms
memory: 3780kb
input:
150000 51271 61855 41031 6214 128303 13504 5448 128732 61184 97680 100425 41154 11503 58798 144109 134746 312 81693 89883 90629 110312 62531 98807 80830 52422 111570 54106 40094 78852 145361 78142 113078 78199 25811 102935 78551 135776 72537 132969 73652 79498 66968 125626 140458 48798 36307 38767 1...
output:
44736443
result:
ok single line: '44736443'
Test #78:
score: 0
Accepted
time: 18ms
memory: 3696kb
input:
149998 1 122049 122049 124192 124192 124192 122049 122049 124192 124192 124192 124192 124192 124192 124192 124192 124192 122049 124192 124192 122049 122049 124192 122049 122049 122049 122049 124192 122049 122049 122049 124192 122049 124192 124192 124192 124192 124192 124192 122049 122049 122049 1220...
output:
0
result:
ok single line: '0'
Test #79:
score: 0
Accepted
time: 17ms
memory: 3660kb
input:
150000 16 145220 89986 24932 67863 47242 145220 83565 145220 24932 89986 37813 37813 145220 135987 83565 83565 90016 145220 83565 51473 89986 47242 51473 47242 145220 47242 145220 145220 37813 148379 83565 90016 145220 47242 67863 37813 145220 51473 89986 37813 37813 51473 75296 145220 145220 145220...
output:
-1
result:
ok single line: '-1'
Test #80:
score: 0
Accepted
time: 8ms
memory: 3748kb
input:
149996 36 75143 28960 29380 73548 28960 13494 80878 74727 28062 5785 126610 80878 133723 149446 74727 44926 28960 17352 28960 132667 87161 5785 83872 80878 103411 87161 40997 75725 13494 28960 80878 134652 75143 95716 132667 26125 12436 43586 95716 109983 108411 90085 75312 115290 12436 134652 10841...
output:
307
result:
ok single line: '307'
Test #81:
score: 0
Accepted
time: 13ms
memory: 3684kb
input:
149996 8 82805 90617 139292 16239 92079 139292 142099 27319 117576 82805 1906 142099 82805 65806 111098 117576 82805 105429 27319 142099 26374 141723 121965 142099 123190 57509 25092 121965 111098 82805 117576 142099 129644 21437 46995 82805 476 143248 82805 141723 84132 82805 126853 75355 79931 142...
output:
3
result:
ok single line: '3'
Test #82:
score: 0
Accepted
time: 7ms
memory: 3704kb
input:
150000 1771 16850 84394 31924 26798 16850 78567 137939 136949 120038 137939 2716 16850 129927 11812 144207 92191 122054 55383 16850 2163 137939 21202 136099 16850 16850 53710 106043 9668 65076 109887 35791 137939 92191 2163 107693 122054 137939 129927 16850 16850 137939 133136 65076 68283 109569 186...
output:
-1
result:
ok single line: '-1'
Test #83:
score: 0
Accepted
time: 17ms
memory: 3600kb
input:
150000 20 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92665 92...
output:
1900486
result:
ok single line: '1900486'
Test #84:
score: 0
Accepted
time: 13ms
memory: 3884kb
input:
150000 37500 105648 105648 105648 105648 105648 105648 56313 105648 77585 105648 105648 105648 147264 105648 105648 105648 105648 105648 15883 105648 105648 105648 105648 105648 149878 105648 105648 105648 105648 105648 105648 105648 105648 139266 38852 105648 105648 105648 105648 115022 105648 1056...
output:
3079257594
result:
ok single line: '3079257594'
Test #85:
score: 0
Accepted
time: 16ms
memory: 3508kb
input:
150000 37500 26285 20784 21207 14961 23821 20609 13588 19309 20997 26049 21931 30241 21433 34266 22354 19549 18219 12801 1380 8610 23001 21719 19889 28095 37216 15611 3192 25200 28399 32789 34894 21737 18864 2539 26514 23373 20929 33665 29963 17256 31821 22101 5593 3391 4004 36231 33261 35525 17075 ...
output:
420778227
result:
ok single line: '420778227'
Test #86:
score: 0
Accepted
time: 9ms
memory: 3816kb
input:
150000 70394 146113 130741 82511 130741 45744 82511 80984 82511 82511 82511 34119 82511 45744 82511 123893 71456 130741 123893 82511 96763 40959 6500 123893 142484 121156 45744 130741 107699 45744 130741 130741 45744 82511 45744 30440 45744 123893 6568 82511 123893 45744 40103 82511 45744 82511 1077...
output:
-1
result:
ok single line: '-1'
Test #87:
score: 0
Accepted
time: 12ms
memory: 3800kb
input:
150000 15000 36926 124801 128404 143467 104852 97662 28725 14011 139599 62991 17626 44883 123651 132777 129554 38535 110101 81727 107222 141996 8190 1365 124611 64624 19280 37114 81762 74533 148257 96752 117503 149848 127097 136699 37828 33098 79502 107816 78263 77742 61691 66694 36906 131656 9479 8...
output:
109313667
result:
ok single line: '109313667'
Test #88:
score: 0
Accepted
time: 12ms
memory: 3732kb
input:
150000 50000 9618 97860 109763 9424 95737 58952 99721 25924 78553 109300 149557 41506 90133 148639 75651 10625 12520 61621 133033 102019 24555 59756 89548 20529 49679 114844 32280 72613 136830 142166 117514 108477 14116 119553 107172 53250 131079 58341 100675 70667 22568 56680 70188 127355 69679 142...
output:
-1
result:
ok single line: '-1'
Test #89:
score: 0
Accepted
time: 11ms
memory: 3832kb
input:
150000 5700 95183 8564 4381 2978 45547 22407 93317 54976 14287 39472 84849 12339 142394 126919 9348 69591 21430 120229 138878 93682 40389 123808 77983 43011 139209 84735 111726 28935 77510 82909 37447 16460 12259 72477 115821 144081 9854 86269 142793 76530 95787 45653 143360 69553 128785 116337 1304...
output:
16108426
result:
ok single line: '16108426'
Subtask #6:
score: 1
Accepted
Test #90:
score: 1
Accepted
time: 6ms
memory: 3820kb
input:
150000 16268 45663 22764 145717 73404 120581 133645 73726 46644 81229 10386 20331 43715 132147 64236 15040 44577 147069 5381 36093 28434 64452 64857 65304 138204 23110 71044 135987 19501 37432 146816 29348 140957 119480 110334 5711 135167 47857 92067 105803 118559 66491 116853 19894 91420 105788 766...
output:
5332150
result:
ok single line: '5332150'
Test #91:
score: 0
Accepted
time: 12ms
memory: 3800kb
input:
150000 58138 64406 29083 126858 56468 115855 24075 22879 95107 12618 144018 117558 137792 47739 112244 62857 77690 20700 124850 19651 3434 74395 105632 134821 115763 85368 73381 49004 106932 32274 123287 74406 40468 56955 119365 88106 83103 15901 62166 83884 22476 98667 73265 17022 64704 128442 1993...
output:
270412421
result:
ok single line: '270412421'
Test #92:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
149999 88773 114607 130245 23661 62719 18493 96530 4166 5094 104876 1610 55850 124193 37650 86878 145839 16947 60365 19204 108092 41766 6552 111695 146885 110496 75505 101589 144869 36295 1862 147799 130843 15114 111052 16123 139894 97932 95929 17370 17610 30689 142991 104172 123222 87640 62534 8334...
output:
1141512510
result:
ok single line: '1141512510'
Test #93:
score: 0
Accepted
time: 12ms
memory: 3684kb
input:
150000 12093 9075 10100 96022 36053 54426 93875 28636 116482 48727 110618 8466 54797 110060 18193 102213 109984 68500 119179 44292 109443 90014 90163 130822 9075 102646 60437 54500 97492 47712 133437 30065 28019 47508 109847 50939 13690 64707 17331 10162 85835 102213 113507 51824 39116 20752 67489 5...
output:
143392222
result:
ok single line: '143392222'
Test #94:
score: 0
Accepted
time: 15ms
memory: 3756kb
input:
150000 2656 130267 66199 101433 13596 149466 101511 117746 105325 22523 47072 124887 3995 127917 38549 35541 93650 74059 71444 32251 78563 94948 18603 82999 81307 68149 113429 136929 127031 115137 141484 143720 46870 145791 38984 10413 102873 117563 38778 128296 52930 13144 116202 70633 64354 30924 ...
output:
616069
result:
ok single line: '616069'
Test #95:
score: 0
Accepted
time: 16ms
memory: 3472kb
input:
150000 1 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 87287 872...
output:
0
result:
ok single line: '0'
Test #96:
score: 0
Accepted
time: 15ms
memory: 3692kb
input:
149996 1 119533 39269 103766 39269 39269 39269 39269 119533 119533 119533 119533 39269 119533 103766 119533 119533 142778 39269 119533 119533 142778 119533 39269 103766 142778 119533 142778 119533 103766 142778 39269 39269 39269 119533 103766 119533 119533 142778 103766 119533 39269 119533 39269 103...
output:
0
result:
ok single line: '0'
Test #97:
score: 0
Accepted
time: 11ms
memory: 3696kb
input:
149997 15 106555 38095 106555 106555 96774 96774 106555 106555 36849 76818 106555 106555 106555 96774 35799 121969 100517 97713 66489 99457 109926 4793 36815 97713 76818 26896 36815 109926 96774 96774 36815 106555 53381 97713 96774 35799 106555 66489 96774 35587 28527 36815 76818 35587 76818 66489 1...
output:
104
result:
ok single line: '104'
Test #98:
score: 0
Accepted
time: 8ms
memory: 3760kb
input:
149996 37 128439 5046 121602 14567 468 468 128439 128439 128439 2902 68782 80120 18704 20870 468 468 468 53519 468 18704 41801 18704 51911 115928 46252 38070 128439 139059 71404 71322 51966 128439 18704 92572 27021 77587 468 39956 468 68782 468 468 83153 82309 468 143669 59628 36864 121993 128439 10...
output:
456
result:
ok single line: '456'
Test #99:
score: 0
Accepted
time: 17ms
memory: 3756kb
input:
149997 2 91866 73878 98098 114913 92098 42481 34966 71673 104255 134463 18945 88598 92098 79013 31060 88598 73961 92098 23468 68542 44388 146619 146619 42481 38800 104255 5616 55051 126461 65102 71643 92098 42481 95541 11668 42481 88598 109479 47543 70628 92098 111964 110712 9927 140446 42481 64334 ...
output:
0
result:
ok single line: '0'
Test #100:
score: 0
Accepted
time: 18ms
memory: 3748kb
input:
149996 2431 92503 24999 115534 143017 80447 125479 55852 88193 80503 106714 59191 83421 125479 18063 94129 107369 134199 83167 125479 38389 125733 128485 125479 86872 131352 59041 147279 108709 95806 36219 120478 143017 38518 135965 103950 130336 35320 114439 35320 83618 110013 89036 128839 114439 1...
output:
7941024
result:
ok single line: '7941024'
Test #101:
score: 0
Accepted
time: 16ms
memory: 3828kb
input:
149995 1000 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 146548 1...
output:
127778065
result:
ok single line: '127778065'
Test #102:
score: 0
Accepted
time: 5ms
memory: 3704kb
input:
150000 75000 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103 39103...
output:
5624850001
result:
ok single line: '5624850001'
Test #103:
score: 0
Accepted
time: 16ms
memory: 3688kb
input:
150000 37501 12429 1074 35627 12847 26300 19443 10039 10746 8593 12891 31822 21993 19898 652 34072 1581 11605 2027 35487 21130 31511 36461 41 27440 23989 24989 29375 11369 26309 28543 4641 15050 10780 23193 35143 20046 1530 25194 26995 8704 32324 24387 21218 23290 19956 11190 32271 8442 23038 11151 ...
output:
-1
result:
ok single line: '-1'
Test #104:
score: 0
Accepted
time: 10ms
memory: 3756kb
input:
150000 8135 141374 125739 38418 78192 141374 141374 78192 78192 148562 126858 141374 78192 125739 126858 126858 141374 125739 78192 126858 125739 149424 125739 125739 93864 78192 78192 37957 141374 141374 137844 140969 126858 141374 109451 126858 26530 126858 78192 108891 78192 126858 126858 141374 ...
output:
71247496
result:
ok single line: '71247496'
Test #105:
score: 0
Accepted
time: 19ms
memory: 3692kb
input:
150000 15001 15196 67940 62486 29491 66741 28486 124628 64215 20313 108355 115921 85523 73385 76153 125795 88017 58694 33328 138408 113351 144894 107539 43491 28442 39502 62711 54043 22844 45926 86124 109024 49810 138918 22944 20887 144499 62763 109659 148861 5446 72249 28617 18339 80879 52864 29512...
output:
-1
result:
ok single line: '-1'
Test #106:
score: 0
Accepted
time: 18ms
memory: 3748kb
input:
150000 50000 112035 131079 3399 131534 97853 119708 112915 49423 12030 148325 68897 145909 91624 42446 79215 137589 47228 103643 139834 13280 7281 143241 113849 38898 137406 58209 90887 132678 134562 132531 75862 141606 77490 44333 134268 23784 118547 23073 115402 88989 87312 90128 12659 104956 7735...
output:
882258470
result:
ok single line: '882258470'
Subtask #7:
score: 1
Accepted
Test #107:
score: 1
Accepted
time: 27ms
memory: 4080kb
input:
350000 143745 22495 119051 86566 52952 140626 136352 139304 116636 198220 186251 299272 324209 198571 73731 164604 101487 115025 212398 255691 324267 212615 178353 143289 190982 19429 43422 190613 113876 255255 202386 349575 15979 288044 329658 132393 130671 213263 187083 33817 107986 70006 258391 2...
output:
1800189492
result:
ok single line: '1800189492'
Test #108:
score: 0
Accepted
time: 28ms
memory: 4076kb
input:
350000 192566 289603 61454 18112 49326 7733 147045 313410 20414 306838 60980 155886 89077 9729 279141 174634 68694 304023 130066 330935 194346 75458 105306 150347 325298 259409 19116 181128 256708 81213 318449 126163 271107 210060 181786 247528 276013 147709 129287 81090 248726 55278 273017 101908 1...
output:
4844404901
result:
ok single line: '4844404901'
Test #109:
score: 0
Accepted
time: 38ms
memory: 3996kb
input:
350000 105539 212528 115549 325310 96491 161722 284119 63414 4599 167766 174922 174965 307570 323859 128824 242303 216987 146797 349423 88252 9296 89893 257986 286534 302002 112334 34532 117292 301923 311388 258308 252526 205059 61978 218228 349594 116290 82536 330841 96140 53425 2976 280641 178403 ...
output:
665478165
result:
ok single line: '665478165'
Test #110:
score: 0
Accepted
time: 34ms
memory: 3876kb
input:
350000 164 332910 216205 337138 189724 181881 226436 49234 216205 49961 135658 169729 193135 154822 4450 265269 171996 4450 30044 290637 19769 37653 30044 332910 4450 222882 108486 94138 123912 332910 277010 124380 74987 277010 323386 279160 207660 123912 4450 153338 168260 277010 79106 30044 31014 ...
output:
13054
result:
ok single line: '13054'
Test #111:
score: 0
Accepted
time: 37ms
memory: 3944kb
input:
349999 2132 64668 59028 41687 267770 51284 216383 152988 185833 341974 29235 67431 147304 174318 175994 344354 317384 175994 175994 77235 245707 175994 323407 326743 106270 233713 4576 169594 131344 175994 167250 322458 299453 201670 256946 106270 79314 150338 71837 149622 78841 176752 59028 316038 ...
output:
9711034
result:
ok single line: '9711034'
Test #112:
score: 0
Accepted
time: 28ms
memory: 3952kb
input:
350000 59141 5455 99464 21641 185376 186948 24104 270237 30695 46253 265604 215947 35163 257749 187986 330124 89183 159936 334629 252185 123363 124742 169069 186695 8840 22348 348065 253155 22348 133708 19795 346319 281222 19795 12388 137783 12388 253987 346430 164856 199572 51053 89518 54325 16165 ...
output:
-1
result:
ok single line: '-1'
Test #113:
score: 0
Accepted
time: 34ms
memory: 3992kb
input:
350000 77005 315282 46785 242544 149807 283951 242350 262961 100621 159872 62741 6293 4435 257694 276248 128625 115036 186711 39988 187715 2714 319976 70881 199162 96634 21597 224786 100621 33501 281635 266720 235562 100083 149166 49502 9179 119548 113366 59117 227496 224786 76379 264837 27008 22478...
output:
689100511
result:
ok single line: '689100511'
Test #114:
score: 0
Accepted
time: 22ms
memory: 3640kb
input:
349841 1 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 345400 3454...
output:
0
result:
ok single line: '0'
Test #115:
score: 0
Accepted
time: 24ms
memory: 3632kb
input:
349914 7 201348 273367 174586 273367 169494 236761 236761 174586 174586 75670 201348 169494 236761 169494 75670 174586 174586 169494 169494 75670 169494 75670 174586 169494 273367 75670 75670 169494 169494 169494 174586 75670 174586 169494 169494 236761 201348 169494 236761 273367 273367 75670 23676...
output:
-1
result:
ok single line: '-1'
Test #116:
score: 0
Accepted
time: 21ms
memory: 3672kb
input:
350000 6 279747 293301 344866 166252 42649 279747 344866 279747 293301 237441 163280 281868 289087 42649 166252 5356 158259 279747 170063 237441 279747 5356 279747 344866 279747 158259 293301 237441 199935 279747 344866 237441 309786 293301 279747 281868 158259 237441 42649 158259 151019 309786 1662...
output:
4
result:
ok single line: '4'
Test #117:
score: 0
Accepted
time: 31ms
memory: 3880kb
input:
349856 17 265715 192666 203016 289560 334837 192666 239553 25849 177268 208597 143170 143170 349449 223927 197431 4061 201792 334837 301785 201792 4061 177268 328197 132407 46092 349779 334837 156615 132407 219059 201792 337952 334837 334837 177268 211025 130085 132407 132407 82734 201792 265715 334...
output:
24
result:
ok single line: '24'
Test #118:
score: 0
Accepted
time: 38ms
memory: 3928kb
input:
350000 944 36577 144807 248175 201127 134599 30545 242327 139263 40822 123783 144807 162253 52444 348832 82082 268281 178337 144807 144411 207414 243987 224957 252441 171817 280847 317241 144807 74588 242327 144807 242327 36577 272201 211426 60116 87776 60116 319730 312358 173744 238622 242327 14441...
output:
-1
result:
ok single line: '-1'
Test #119:
score: 0
Accepted
time: 32ms
memory: 3916kb
input:
349866 2029 307363 49653 343129 169126 202558 42431 49653 49653 101546 66559 163947 303399 346065 58725 295609 269997 94513 171259 343129 195767 324275 343129 197548 76447 234293 343129 155321 38240 176115 246988 49653 268447 205051 342934 202558 208142 300434 343129 96766 343129 30120 38240 23671 1...
output:
6009944
result:
ok single line: '6009944'
Test #120:
score: 0
Accepted
time: 27ms
memory: 3768kb
input:
349996 9 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 168404 1684...
output:
1609474
result:
ok single line: '1609474'
Test #121:
score: 0
Accepted
time: 30ms
memory: 4008kb
input:
350000 175000 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574 251574...
output:
30624650001
result:
ok single line: '30624650001'
Test #122:
score: 0
Accepted
time: 28ms
memory: 3724kb
input:
350000 116666 64248 48257 111317 92450 83972 72312 9281 102519 33431 99223 10625 26717 9322 91692 69948 59526 108680 97358 27181 80063 71996 90770 56422 105035 33042 45219 77610 79259 54215 35305 29732 69682 113921 5725 34114 51821 115447 75790 100621 6747 68543 86687 10387 80226 72166 18215 24412 6...
output:
3403562907
result:
ok single line: '3403562907'
Test #123:
score: 0
Accepted
time: 31ms
memory: 4024kb
input:
350000 13012 161595 149667 161595 195471 149667 125432 239226 138478 125432 161595 161595 149667 148234 31480 161595 161595 125432 161595 125432 21798 161595 277189 125432 149667 149667 315188 161595 161595 118557 125432 149667 125432 149667 125432 349817 303984 125432 161595 161595 312184 161595 16...
output:
175341547
result:
ok single line: '175341547'
Test #124:
score: 0
Accepted
time: 35ms
memory: 3920kb
input:
350000 100000 228431 173716 35003 16913 318558 247340 244215 99854 68141 116798 311379 108934 135827 136384 166229 234817 97131 301086 205081 189107 36428 278879 126836 169955 128564 331293 132053 250357 198386 193001 90897 106259 38405 178141 2084 319983 190481 254488 148108 6609 64603 12429 210515...
output:
-1
result:
ok single line: '-1'
Test #125:
score: 0
Accepted
time: 30ms
memory: 3900kb
input:
350000 116666 9637 209971 242680 217327 335011 283173 30605 155704 348812 321772 190344 125583 302093 35182 252072 31563 202391 246601 227781 117747 226924 22487 276163 169569 197078 273666 190795 320545 15301 286327 220351 315394 200579 3836 56740 322637 177680 236956 156827 324789 277013 158698 26...
output:
1600617961
result:
ok single line: '1600617961'
Test #126:
score: 0
Accepted
time: 40ms
memory: 3896kb
input:
350000 57000 75713 9734 215625 205215 126049 101917 181123 98312 164904 137820 297206 344843 201057 163877 346954 57224 231046 210052 203009 183195 207547 279624 308767 23030 194473 326337 162113 283260 67735 46081 59485 293642 328754 62219 258313 322891 194216 162088 137625 141690 323749 230979 342...
output:
1506627874
result:
ok single line: '1506627874'
Subtask #8:
score: 1
Accepted
Test #127:
score: 1
Accepted
time: 51ms
memory: 3956kb
input:
349846 341410 228833 201823 210575 104632 331765 262972 332537 123204 96117 39621 66584 90854 296873 242780 311710 209898 324587 17346 246045 161432 18661 120674 75388 339996 234745 212967 176162 228704 189672 123704 276282 266240 243006 208225 303719 125896 236127 85064 304151 341797 116333 209838 ...
output:
-1
result:
ok single line: '-1'
Test #128:
score: 0
Accepted
time: 22ms
memory: 3976kb
input:
350000 136798 226410 325261 205567 275616 297369 95831 270036 60661 11958 14369 37343 89776 162873 142546 30733 64006 114863 199906 118591 2291 237230 237756 52095 170059 101828 327201 77587 208532 97667 334333 142890 75835 115351 5812 277545 54884 105219 234090 124883 67848 127814 337851 89607 8761...
output:
1541376323
result:
ok single line: '1541376323'
Test #129:
score: 0
Accepted
time: 35ms
memory: 3808kb
input:
349987 256788 280192 314934 101452 244357 183214 71835 228999 282907 89588 285844 324006 150191 68307 313973 141177 14891 14201 174421 9516 192806 153034 268061 341985 235013 74356 89366 75191 345987 134985 115387 8483 21686 12603 343513 138036 55919 159726 24689 32932 93398 145953 278134 127147 600...
output:
-1
result:
ok single line: '-1'
Test #130:
score: 0
Accepted
time: 26ms
memory: 3924kb
input:
349958 465 250351 321390 99751 167226 191358 8675 194392 218041 257241 250307 189110 218041 245686 99751 282063 293263 218041 238290 123331 238948 240899 325247 280860 254950 279273 99751 76970 8675 8675 218041 218041 21925 17788 176902 176902 149754 131936 91073 70109 218041 218041 339820 340496 31...
output:
164530
result:
ok single line: '164530'
Test #131:
score: 0
Accepted
time: 32ms
memory: 3876kb
input:
349874 10830 44373 254642 308490 169671 343630 85547 110683 233580 243528 166367 122621 314295 146491 151575 200335 53775 105646 343630 21015 32615 178330 71985 71985 75287 275838 95991 268044 311430 143080 341674 174717 165004 71985 186452 343630 122621 203805 134612 144825 309308 71985 62085 18009...
output:
332278612
result:
ok single line: '332278612'
Test #132:
score: 0
Accepted
time: 32ms
memory: 3916kb
input:
349958 85707 193557 5686 325988 289742 209594 307336 163146 302412 113283 128947 291776 209594 2049 53426 47563 53426 18687 86292 231147 259674 25644 293432 94910 328551 347937 53426 235021 276265 78154 58806 292702 73832 141787 344609 138735 45844 213027 174792 53426 134188 53426 53583 77761 53426 ...
output:
5249117393
result:
ok single line: '5249117393'
Test #133:
score: 0
Accepted
time: 33ms
memory: 3896kb
input:
349907 275493 56379 125353 221597 69696 69205 131907 346230 200663 130501 113996 40570 16973 186758 103238 234038 318418 21292 174821 232708 169266 272786 340624 167508 236841 47357 113259 127415 281696 227465 112768 222452 196638 213934 211129 163151 307441 275087 113608 332526 95267 79957 296310 1...
output:
8268642576
result:
ok single line: '8268642576'
Test #134:
score: 0
Accepted
time: 19ms
memory: 3656kb
input:
349927 1 142300 219741 142300 219741 219741 219741 142300 142300 219741 142300 142300 219741 219741 142300 142300 142300 142300 219741 219741 142300 142300 142300 142300 142300 142300 142300 219741 142300 142300 142300 219741 219741 142300 219741 142300 142300 142300 219741 142300 142300 142300 1423...
output:
0
result:
ok single line: '0'
Test #135:
score: 0
Accepted
time: 28ms
memory: 3716kb
input:
350000 8 302116 25379 183215 72860 245811 245811 154065 134462 299351 302116 302116 302116 245811 299351 299351 183215 245811 302116 245811 183215 245811 299351 245811 348976 245811 346309 299351 25379 245811 183215 134462 318894 25379 318894 299351 245811 58011 245811 183215 348976 183215 299351 34...
output:
3
result:
ok single line: '3'
Test #136:
score: 0
Accepted
time: 36ms
memory: 3840kb
input:
349922 46 277063 280276 79054 105734 42988 340006 280276 254468 280276 70027 243761 70027 284331 329476 331989 280276 329476 201662 280276 280276 141860 82260 70027 347524 71786 70027 50698 128337 71786 280276 280276 70027 71786 71786 70027 71786 343790 141860 280276 280276 278161 278161 168424 2781...
output:
2282
result:
ok single line: '2282'
Test #137:
score: 0
Accepted
time: 37ms
memory: 3920kb
input:
349980 5 316115 87763 212909 75274 187536 34931 289526 140386 247305 179046 212909 52034 192235 212909 281492 62157 52034 187536 212909 234726 21352 62157 328994 212909 212909 123582 1572 230505 316115 212909 212909 62157 316926 88819 234726 25177 40688 149312 233322 113212 88819 328994 25177 247403...
output:
0
result:
ok single line: '0'
Test #138:
score: 0
Accepted
time: 28ms
memory: 3956kb
input:
350000 108 99477 179185 179185 58541 265062 124663 158778 84143 274508 231448 306594 132304 156054 213757 278803 198687 109690 71523 179185 325467 329018 12370 334269 284571 238597 84143 179185 49995 130771 278803 326597 179185 303206 278803 79199 151358 278803 240041 124474 198687 179185 278803 175...
output:
2985
result:
ok single line: '2985'
Test #139:
score: 0
Accepted
time: 29ms
memory: 3952kb
input:
350000 728 234849 125322 283269 55881 21096 90917 7453 253415 227636 90753 240331 268373 103927 53929 268373 192081 284594 102476 300324 172020 314016 250666 329935 76967 164136 66230 319683 260307 268373 129540 38691 39673 234849 268373 2284 241960 32085 274697 323846 330525 3022 315311 260307 1331...
output:
247606
result:
ok single line: '247606'
Test #140:
score: 0
Accepted
time: 20ms
memory: 3876kb
input:
349995 1000 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 340154 3...
output:
290182809
result:
ok single line: '290182809'
Test #141:
score: 0
Accepted
time: 20ms
memory: 3952kb
input:
350000 116666 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129 274129...
output:
13603255210
result:
ok single line: '13603255210'
Test #142:
score: 0
Accepted
time: 26ms
memory: 3668kb
input:
350000 116665 20986 11053 39988 29276 74056 64341 24894 114381 9221 7383 77291 26114 37653 19598 8980 97567 68121 6509 17783 101522 42718 9261 64765 22618 21335 24673 51216 67677 48760 48710 25100 112458 41305 64133 114219 8838 80892 93241 44514 22904 14861 39093 39503 91916 42923 50508 62497 96896 ...
output:
3400402742
result:
ok single line: '3400402742'
Test #143:
score: 0
Accepted
time: 30ms
memory: 3924kb
input:
350000 154393 224819 81057 215890 147692 194204 81057 88749 194204 311935 45739 81057 146604 129205 81057 81057 81057 81057 81057 81057 6055 194204 194204 81057 194204 81057 204092 81057 242726 194204 81057 86338 194204 194204 292658 81057 194204 81057 81057 235226 81057 238574 342917 344706 305796 ...
output:
-1
result:
ok single line: '-1'
Test #144:
score: 0
Accepted
time: 31ms
memory: 3948kb
input:
350000 100001 156320 260025 295044 337432 315070 241742 207885 50865 113483 94196 241594 256455 15120 54085 96905 255701 64349 6771 25738 41739 31356 65641 216354 222717 249570 122971 129522 185926 204892 133821 213833 45783 274133 152268 286737 347404 36770 283849 148522 186037 123116 120919 156309...
output:
-1
result:
ok single line: '-1'
Test #145:
score: 0
Accepted
time: 23ms
memory: 3976kb
input:
350000 87500 252346 93009 221186 340966 128140 97916 262503 34911 178375 237685 336241 182856 312225 256670 181102 90061 338335 322224 212493 271099 208292 131243 77545 264367 120063 27490 109672 86506 69719 266580 333476 238989 192005 3176 89141 106473 210008 189062 113929 301776 311469 45964 26627...
output:
1385134469
result:
ok single line: '1385134469'
Subtask #9:
score: 1
Accepted
Test #146:
score: 1
Accepted
time: 54ms
memory: 4096kb
input:
499835 261883 76065 228334 237505 381520 413791 107774 426811 366955 370251 218859 270843 116791 497731 270703 375999 164848 488362 328552 66567 313536 404044 359344 420520 360708 338981 379637 468784 364143 181580 139495 85095 61983 344450 202091 201742 437633 175888 70040 496236 187794 18257 41580...
output:
8326750778
result:
ok single line: '8326750778'
Test #147:
score: 0
Accepted
time: 48ms
memory: 4024kb
input:
499593 247158 417363 376019 157128 267236 43448 221961 27864 111998 484660 44632 57675 445350 295960 431781 492131 193961 451484 369968 392610 217814 214558 289296 232723 232217 456726 71128 472348 57170 182521 252732 338503 387018 56555 106614 49755 14868 125906 230573 314943 403617 61998 274172 13...
output:
6819462226
result:
ok single line: '6819462226'
Test #148:
score: 0
Accepted
time: 53ms
memory: 4044kb
input:
499562 233167 428453 168969 464538 19841 198309 259459 346623 3230 444351 384426 68763 129029 74140 90587 323617 231360 1989 71236 180316 146985 280315 360230 346371 326033 21943 70503 442414 167692 284430 327705 403328 254422 165047 39094 128927 315007 254585 181598 324571 428643 482323 220907 4709...
output:
5601752180
result:
ok single line: '5601752180'
Test #149:
score: 0
Accepted
time: 42ms
memory: 4160kb
input:
500000 1 468042 76407 479372 124188 390706 47218 290279 351615 351615 351392 351615 351615 332457 309477 110811 32946 482117 449900 342342 10004 479372 154270 351615 104718 448747 161074 307481 102850 154057 91900 362707 479372 103481 283322 285989 49201 202241 482117 198914 117753 86657 75616 39070...
output:
0
result:
ok single line: '0'
Test #150:
score: 0
Accepted
time: 45ms
memory: 4236kb
input:
499776 198321 170301 362983 141276 431766 157413 399332 470697 429054 325842 166497 11617 426823 466683 166041 3021 32250 40439 193897 67189 323342 492627 422573 221335 125659 194938 25452 422573 41697 164412 493092 367796 245292 71647 427673 125659 253226 445905 410966 274376 417109 271866 113820 2...
output:
-1
result:
ok single line: '-1'
Test #151:
score: 0
Accepted
time: 42ms
memory: 3660kb
input:
500000 1 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 222078 2220...
output:
0
result:
ok single line: '0'
Test #152:
score: 0
Accepted
time: 33ms
memory: 3640kb
input:
500000 8 429838 334485 108790 108790 70244 374199 108790 70244 334485 334485 478058 374199 108790 334485 429838 108790 334485 108790 429838 334485 108790 232073 432742 334485 478058 232073 432742 429838 334485 334485 334485 232073 374199 374199 108790 374199 478058 334485 374199 429838 374199 232073...
output:
37
result:
ok single line: '37'
Test #153:
score: 0
Accepted
time: 39ms
memory: 3752kb
input:
500000 44 294035 158812 361817 353738 374027 144805 35948 361413 35948 276334 294035 35948 318993 361413 294035 361817 303322 905 294035 470263 361817 19074 361413 361413 381402 361413 381402 42176 361413 395356 361413 20568 20568 361413 99053 294035 318993 361817 361817 276334 264548 318993 361817 ...
output:
-1
result:
ok single line: '-1'
Test #154:
score: 0
Accepted
time: 31ms
memory: 4040kb
input:
500000 96 464500 326700 54763 372578 407960 475521 352612 189124 33629 136563 21257 491211 246111 307527 157206 372578 400542 372578 278885 375626 483330 228894 57792 217498 395652 136563 400542 227996 136563 372578 407960 400542 75955 372578 157206 400542 407960 216975 275917 303057 464500 416898 4...
output:
4997
result:
ok single line: '4997'
Test #155:
score: 0
Accepted
time: 41ms
memory: 4028kb
input:
499751 15 334275 350225 470833 134239 9528 337578 377541 91672 187679 134239 21539 291676 123615 58456 56118 392807 21539 170984 91672 422297 441645 377541 257588 115465 331466 50156 314007 377541 464631 138772 377541 304027 141328 377541 320948 293199 377541 296219 91672 156341 445611 27143 202268 ...
output:
6
result:
ok single line: '6'
Test #156:
score: 0
Accepted
time: 45ms
memory: 4068kb
input:
499601 17084 375272 73532 85558 404710 353748 246787 341553 64722 407593 152083 403354 152083 465956 273462 140444 107679 409459 140186 366417 425873 10281 394300 152083 332297 353748 404710 463848 486180 256457 314362 323918 139080 438054 124603 256 310969 441662 367853 141492 54338 371751 49100 12...
output:
-1
result:
ok single line: '-1'
Test #157:
score: 0
Accepted
time: 40ms
memory: 4020kb
input:
499974 75997 396674 147714 60733 456422 143996 11246 360289 385420 416980 381126 36326 293194 255799 67818 338620 249251 124072 141841 178914 261791 138346 499121 268934 368629 27245 457552 311173 412447 311263 468713 390097 91103 338318 229968 325971 419015 473196 499121 381126 462379 412691 9508 6...
output:
5265219721
result:
ok single line: '5265219721'
Test #158:
score: 0
Accepted
time: 46ms
memory: 4044kb
input:
499925 480925 97822 139086 342981 54921 222734 403294 638 129467 309668 403 152733 221712 36334 346657 251449 247882 290525 432962 371931 171957 347459 26349 173821 151340 75858 392175 161397 455088 375664 43860 363614 492241 381710 212288 133332 324028 425205 76438 36136 54524 88940 176787 322871 4...
output:
3762172818
result:
ok single line: '3762172818'
Test #159:
score: 0
Accepted
time: 40ms
memory: 3712kb
input:
499998 9 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 128261 1282...
output:
2296650
result:
ok single line: '2296650'
Test #160:
score: 0
Accepted
time: 36ms
memory: 4220kb
input:
500000 250000 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065 269065...
output:
62499500001
result:
ok single line: '62499500001'
Test #161:
score: 0
Accepted
time: 34ms
memory: 4068kb
input:
500000 500000 277071 156359 61053 139625 414745 298953 452837 283245 289836 398220 202355 198417 150708 115358 117846 15339 469075 372342 417582 491890 103659 99724 439393 101712 264936 410705 363973 211066 124268 224153 221108 340019 409517 342957 439692 17203 22823 74773 218031 429616 119107 49605...
output:
0
result:
ok single line: '0'
Test #162:
score: 0
Accepted
time: 52ms
memory: 3956kb
input:
500000 73733 33512 227364 33512 232437 159223 33512 33512 227364 346314 227364 145406 227364 227364 227364 329163 33512 227364 227364 393064 227364 33512 33512 471135 33512 33512 74786 152597 211163 33512 499736 33512 33512 267295 33512 245046 33512 227364 371046 227364 2532 33512 348958 227364 4580...
output:
6408925874
result:
ok single line: '6408925874'
Test #163:
score: 0
Accepted
time: 53ms
memory: 4116kb
input:
500000 500000 231275 21154 145957 354558 132041 338769 132922 246540 376889 99609 130389 497108 226201 484121 274926 278361 324266 226520 205379 403441 414835 467355 459272 345713 444968 104177 429710 52687 340830 86647 204378 447763 353688 193517 51936 482326 372412 20248 228726 268034 447815 45137...
output:
-1
result:
ok single line: '-1'
Test #164:
score: 0
Accepted
time: 48ms
memory: 4160kb
input:
500000 50000 302147 159114 401051 100746 445749 185870 204009 46054 477698 164913 418596 495881 231279 469701 138917 276831 217610 157775 43994 238185 462131 268847 393746 451951 452020 378355 114747 96687 169548 24280 300044 79995 411307 12864 382571 480495 5160 230133 475968 403982 70394 95701 319...
output:
272137202
result:
ok single line: '272137202'
Test #165:
score: 0
Accepted
time: 38ms
memory: 3692kb
input:
500000 2 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 62642 626...
output:
499998
result:
ok single line: '499998'
Subtask #10:
score: 1
Accepted
Test #166:
score: 1
Accepted
time: 39ms
memory: 4088kb
input:
500000 83406 359142 312122 348882 375183 453993 318759 465680 74621 307526 300247 430799 161656 130575 290125 431178 349656 416413 300561 173769 76721 36031 463103 410048 228227 288391 199450 302348 457097 33741 159039 376628 229000 471972 256445 74526 143717 431351 16156 488243 341675 376371 180751...
output:
213780471
result:
ok single line: '213780471'
Test #167:
score: 0
Accepted
time: 48ms
memory: 4088kb
input:
500000 410700 208162 287173 493605 41423 186159 248332 482529 59683 440647 54330 105212 116217 108364 161833 67468 92572 13305 334656 227620 464774 131004 189810 453538 361671 201585 216539 197111 402956 268376 385803 499714 76704 229232 267606 271215 42045 374191 470014 352647 275085 112863 445180 ...
output:
-1
result:
ok single line: '-1'
Test #168:
score: 0
Accepted
time: 36ms
memory: 3952kb
input:
500000 192003 193538 172661 320680 347587 173860 355915 479811 124535 343585 158856 230528 367065 413930 468025 295022 333469 340205 178009 269994 195243 316245 262896 475932 333590 214565 161101 173335 37954 5444 208171 360338 25018 473434 206781 426554 26698 479955 233103 418417 466444 145178 1719...
output:
2911600192
result:
ok single line: '2911600192'
Test #169:
score: 0
Accepted
time: 57ms
memory: 4168kb
input:
499963 11587 297054 77207 214853 41677 380932 173061 182223 16673 456222 86614 285386 348976 341762 242881 187636 86614 342056 323030 265942 448998 316741 288119 435028 285024 225021 26543 376686 225021 214853 409630 155115 357537 341762 357059 86614 34104 342056 280863 264736 30434 330844 342056 28...
output:
61587621
result:
ok single line: '61587621'
Test #170:
score: 0
Accepted
time: 47ms
memory: 4136kb
input:
500000 44707 498109 348556 247065 447470 348413 336294 429043 162920 321281 186265 371281 306435 350173 170476 433952 351850 478104 159545 471111 495853 221154 142934 4347 24750 222413 334166 137776 449422 310330 98768 34916 421295 424277 4204 440531 100359 403185 470319 384844 136414 287083 123957 ...
output:
194270071
result:
ok single line: '194270071'
Test #171:
score: 0
Accepted
time: 41ms
memory: 3620kb
input:
499519 1 181554 409150 181554 409150 181554 409150 181554 409150 181554 409150 409150 181554 181554 181554 409150 181554 409150 181554 409150 181554 181554 409150 181554 409150 181554 181554 409150 409150 181554 409150 409150 409150 181554 409150 181554 409150 409150 409150 409150 181554 181554 1815...
output:
0
result:
ok single line: '0'
Test #172:
score: 0
Accepted
time: 42ms
memory: 3668kb
input:
499971 7 119361 66221 138448 198828 90080 266323 90080 396081 66221 92228 66221 174934 415153 15698 431543 90080 411035 138448 90080 355813 411035 29870 90080 355813 138448 15698 66221 339002 90080 10821 437553 119361 352014 15698 437553 10821 15698 90080 90080 396081 176696 411035 411035 92228 3520...
output:
1
result:
ok single line: '1'
Test #173:
score: 0
Accepted
time: 28ms
memory: 3944kb
input:
499514 104 424128 202335 343559 89331 343559 56745 288465 47563 148893 288465 478206 260692 56745 141644 288465 11102 421330 288465 56745 421330 478206 488487 103128 172058 221047 141644 421330 81151 103128 288465 172058 204442 76381 288465 11102 288465 11102 478206 49 478206 303820 229973 11102 249...
output:
16538
result:
ok single line: '16538'
Test #174:
score: 0
Accepted
time: 82ms
memory: 4084kb
input:
500000 1 284180 389608 295634 321362 22588 26753 172551 309259 88639 66004 187189 478285 214511 389608 284180 284180 486092 262543 79659 220623 22617 389608 321362 321362 284180 400416 247653 494063 389608 247653 415852 280400 491946 57881 321362 389608 284180 343755 389608 190160 96165 88639 360101...
output:
0
result:
ok single line: '0'
Test #175:
score: 0
Accepted
time: 53ms
memory: 4092kb
input:
500000 5250 416422 467339 27223 109279 367871 181075 272291 230305 27223 105723 220090 170201 207304 233933 290501 61711 302239 54901 232330 252577 101570 187467 131622 414349 449262 180679 27223 421132 416422 292845 405837 389131 297077 395850 27223 237529 387311 416422 282491 69236 486275 387311 2...
output:
80072872
result:
ok single line: '80072872'
Test #176:
score: 0
Accepted
time: 53ms
memory: 4224kb
input:
500000 10674 93868 182241 457174 213031 296481 481161 149667 422233 486494 90483 159810 28523 213031 265980 408351 312624 234134 115919 344039 365500 359928 149667 172736 67827 64910 318490 32046 284352 189731 324070 370467 388152 339573 8980 35263 397535 117408 247725 457174 282349 353095 142147 23...
output:
88813978
result:
ok single line: '88813978'
Test #177:
score: 0
Accepted
time: 62ms
memory: 4020kb
input:
500000 215817 470876 479042 236057 235500 365603 107647 369519 230506 171663 177741 373785 486409 416584 459728 381468 360802 123917 464691 337064 332217 257767 324693 71838 354417 103054 333620 270681 164351 318326 420572 235036 335796 499878 80097 481294 333056 353747 21127 295699 369519 416584 22...
output:
18435896201
result:
ok single line: '18435896201'
Test #178:
score: 0
Accepted
time: 48ms
memory: 3676kb
input:
499865 2 478210 478210 114519 114519 478210 114519 478210 114519 114519 114519 478210 114519 114519 114519 114519 478210 114519 478210 478210 478210 114519 114519 478210 478210 114519 478210 478210 478210 114519 114519 114519 478210 478210 114519 478210 114519 114519 478210 114519 478210 478210 4782...
output:
1
result:
ok single line: '1'
Test #179:
score: 0
Accepted
time: 32ms
memory: 4152kb
input:
500000 1000 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 293155 2...
output:
415018618
result:
ok single line: '415018618'
Test #180:
score: 0
Accepted
time: 41ms
memory: 4160kb
input:
500000 166666 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842 486842...
output:
27769268021
result:
ok single line: '27769268021'
Test #181:
score: 0
Accepted
time: 44ms
memory: 3876kb
input:
500000 250000 104726 53004 66869 134537 52352 233174 90083 245649 45280 14737 138466 29844 11770 2618 218171 233590 77566 244482 95030 106980 191390 54341 94328 79534 108441 160555 175037 248058 244375 185329 86190 183048 134329 6624 109553 95143 99006 229485 30279 88746 198977 196428 63688 190034 2...
output:
10450078426
result:
ok single line: '10450078426'
Test #182:
score: 0
Accepted
time: 54ms
memory: 4072kb
input:
500000 135946 117010 117010 117010 117010 117010 117010 33876 117010 117010 117010 388704 117010 117010 258518 117010 46337 117010 117010 117010 117010 117010 301606 117010 117010 117010 117010 117010 117010 117010 117010 117010 117010 83432 117010 117010 117010 365095 117010 117010 117010 117010 10...
output:
-1
result:
ok single line: '-1'
Test #183:
score: 0
Accepted
time: 42ms
memory: 4088kb
input:
500000 250001 74640 302965 43087 247750 185193 466750 36743 84333 39097 133729 489801 494260 356959 117925 385127 228613 421290 317179 148920 95140 321184 442595 372846 400360 194648 202167 16298 172808 335108 477093 478978 181959 68091 391714 267484 443408 341790 353237 353593 83000 11954 463514 20...
output:
-1
result:
ok single line: '-1'
Test #184:
score: 0
Accepted
time: 50ms
memory: 4092kb
input:
500000 71428 205751 417790 319442 57797 185677 396396 466697 37891 137105 352930 218181 493029 366979 313210 225645 122420 348458 206879 225325 81566 96982 425716 473317 337361 240246 313353 138170 107077 199573 339862 31063 161311 152949 170145 182864 134723 198566 214841 337681 462427 487962 38683...
output:
650163438
result:
ok single line: '650163438'