QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#290642 | #435. Painting Walls | MoRanSky | 100 ✓ | 158ms | 16752kb | C++23 | 1.2kb | 2023-12-25 06:15:04 | 2023-12-25 06:15:08 |
Judging History
answer
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;
const int N = 100005, M = 50005, INF = 0x3f3f3f3f;
int f[N], q[N], g[2][M], len[2][M];
vector<int> d[N];
int minimumInstructions(
int n, int m, int K, std::vector<int> c,
std::vector<int> a, std::vector<std::vector<int> > b) {
memset(f, 0x3f, sizeof f);
memset(g, -1, sizeof g);
for (int i = 0; i < K; i++) d[i].clear();
for (int i = 0; i < m; i++) {
for (int j = 0; j < a[i]; j++) {
d[b[i][j]].push_back(i);
}
}
int hh = 0, tt = -1;
for (int i = 0; i < n; i++) {
bool ok = false;
for (int j = 0; j < d[c[i]].size(); j++) {
int u = d[c[i]][j];
g[i & 1][u] = i, len[i & 1][u] = 1;
if (i && g[(i - 1) & 1][(u + m - 1) % m] == i - 1) len[i & 1][u] += len[(i - 1) & 1][(u + m - 1) % m];
if (len[i & 1][u] >= m) ok = true;
}
if (ok) {
while (hh <= tt && q[hh] < i - m) hh++;
if (i < m) f[i] = 1;
else if (hh <= tt) f[i] = f[q[hh]] + 1;
if (f[i] != INF) {
while (hh <= tt && f[q[tt]] >= f[i]) tt--;
q[++tt] = i;
}
}
}
return f[n - 1] == INF ? -1 : f[n - 1];
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Accepted
Test #1:
score: 0
Accepted
time: 2ms
memory: 6916kb
input:
1 1 1 0 1 0
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 2ms
memory: 6816kb
input:
500 3 3 1 1 1 2 1 2 1 1 2 2 2 0 2 1 1 2 1 2 0 1 0 0 2 0 1 2 0 0 1 1 0 1 1 2 1 0 1 1 0 0 1 1 2 1 0 0 2 0 2 0 0 1 0 2 1 2 2 2 1 0 0 1 1 1 2 1 2 2 2 0 2 2 1 2 2 1 1 1 0 2 2 0 1 1 2 1 1 2 2 0 1 0 2 1 1 1 2 2 2 1 0 0 1 2 1 2 1 1 1 2 1 1 0 2 2 2 0 2 0 2 0 0 0 0 0 1 0 2 1 0 2 0 1 2 1 1 0 2 1 0 0 1 1 1 1 0 ...
output:
-1
result:
ok single line: '-1'
Test #3:
score: 0
Accepted
time: 2ms
memory: 6928kb
input:
500 4 4 0 2 2 0 0 3 0 1 1 3 3 1 3 0 3 1 0 1 2 2 2 3 2 3 0 1 0 2 3 0 2 2 0 3 0 1 3 0 3 0 2 3 3 3 2 2 3 0 1 2 3 2 1 0 3 0 0 1 0 3 2 0 3 1 2 3 2 3 3 3 1 0 2 1 2 1 0 1 1 1 0 2 2 1 0 1 0 2 2 1 1 2 2 3 0 3 3 3 3 2 3 1 2 2 1 1 1 1 2 3 3 3 2 3 3 2 3 2 0 3 3 1 0 1 0 3 3 2 1 1 3 1 1 0 1 1 0 3 2 3 0 3 3 1 2 0 ...
output:
-1
result:
ok single line: '-1'
Test #4:
score: 0
Accepted
time: 2ms
memory: 6880kb
input:
500 5 5 4 0 1 1 0 2 1 4 3 1 4 4 3 2 3 4 4 1 0 1 3 0 2 3 3 3 1 3 2 4 1 2 4 4 2 3 2 0 3 0 3 4 3 2 4 0 2 1 3 2 3 1 4 3 4 4 1 2 2 3 0 1 2 3 3 3 1 0 4 0 2 2 4 0 3 2 0 4 2 4 2 2 1 4 4 4 1 1 0 1 0 4 4 4 1 1 4 3 4 4 1 0 4 4 3 3 0 1 2 0 0 2 4 3 2 0 2 4 3 1 1 1 0 0 1 4 3 0 1 1 3 2 4 3 0 4 1 0 4 1 4 4 3 0 2 4 ...
output:
-1
result:
ok single line: '-1'
Test #5:
score: 0
Accepted
time: 2ms
memory: 6844kb
input:
500 200 100000 23850 14340 23982 225 32373 81401 53147 37813 31092 29575 69560 58911 43095 82241 64285 19469 57349 51377 38528 27031 10292 35608 29378 3494 47057 48050 88179 81383 81442 12908 53262 22741 91184 95884 78021 98713 69455 51055 7633 12 63476 99501 76017 89922 94666 19114 4813 86738 70896...
output:
3
result:
ok single line: '3'
Test #6:
score: 0
Accepted
time: 2ms
memory: 6848kb
input:
500 200 100000 59895 19146 35199 898 3393 61193 36812 13987 36307 87339 18135 98886 75135 62583 95303 6732 86185 44012 59200 41583 52423 33077 41162 20410 98979 15598 15577 41331 81994 58797 55697 23492 24947 26546 36280 96146 42425 51821 42258 72466 48369 23494 91295 52955 90485 47218 14464 62832 3...
output:
3
result:
ok single line: '3'
Test #7:
score: 0
Accepted
time: 0ms
memory: 6856kb
input:
500 200 100000 87822 85400 77887 32512 69806 75418 60917 81225 99030 31686 21256 83393 34600 59010 83176 95097 69836 15382 57043 26592 54614 7503 74562 90832 82434 86522 20992 81136 68342 35309 42181 45973 91575 58791 47293 13487 61883 75845 45660 30958 91585 86513 35847 68994 21073 11002 13941 5706...
output:
3
result:
ok single line: '3'
Test #8:
score: 0
Accepted
time: 0ms
memory: 6856kb
input:
500 200 100000 56109 75760 39107 56917 5240 16975 70913 31922 87259 28039 56100 9401 95179 96144 50296 2783 53719 40350 23516 17272 95775 14412 67086 76063 41769 83919 8879 19009 87724 79646 89865 82026 72884 74244 40319 32399 11006 98966 64755 64649 72776 55705 3131 93584 78515 24303 11778 65185 56...
output:
3
result:
ok single line: '3'
Test #9:
score: 0
Accepted
time: 0ms
memory: 6848kb
input:
500 200 100000 23431 18626 2556 35339 51760 14494 71999 73008 14837 45207 96977 30652 26496 95980 76200 63566 4880 32706 92228 23887 29484 731 97665 99808 2393 41213 75762 14230 72720 88810 5431 23718 83626 58907 66763 91261 10628 15366 94452 2280 22734 29785 98393 57141 4374 35971 36901 28579 38072...
output:
3
result:
ok single line: '3'
Test #10:
score: 0
Accepted
time: 0ms
memory: 6932kb
input:
500 200 100000 52196 17851 23782 92155 42419 81497 71507 65719 44761 73250 11626 38233 82246 45975 33020 30687 92638 32241 18946 52402 87678 43767 86362 67442 49199 80640 23295 96499 16024 84434 52568 80385 10241 94476 30907 72982 42871 99296 7494 21776 1422 11712 73311 56113 42986 69292 52550 32018...
output:
3
result:
ok single line: '3'
Test #11:
score: 0
Accepted
time: 2ms
memory: 6796kb
input:
500 198 100000 65857 17439 77011 92939 30455 50969 14165 42723 5587 28043 27452 55636 22433 26403 56469 91261 60413 78778 66312 27104 10265 17369 44153 20136 75568 61248 89484 3109 98799 14986 72926 44407 67215 94989 27685 92946 77435 20913 97724 63603 39119 76030 9548 20172 58102 10822 67969 65555 ...
output:
-1
result:
ok single line: '-1'
Test #12:
score: 0
Accepted
time: 2ms
memory: 6924kb
input:
2 1 1 0 0 1 0
output:
2
result:
ok single line: '2'
Test #13:
score: 0
Accepted
time: 2ms
memory: 6824kb
input:
500 197 100000 40709 56310 52263 74407 30629 70113 70724 76962 173 85160 53773 77626 15393 91561 77503 52864 52657 82924 92836 8945 29252 66723 36507 22417 23101 62864 44423 91351 94963 94408 92202 694 95823 90452 80376 99875 1030 45142 55130 36362 58618 32529 99581 30109 70268 3352 20042 99877 9305...
output:
-1
result:
ok single line: '-1'
Test #14:
score: 0
Accepted
time: 2ms
memory: 6984kb
input:
500 199 100000 47468 87001 7912 28230 36550 1504 63370 34901 36017 39619 72717 27524 48946 96988 92309 52601 20466 25390 21948 40934 12628 71994 19367 97481 13599 74640 14108 71163 40883 44500 28098 78697 76733 47625 65880 80055 55269 93165 96619 48472 28273 17142 56991 29482 93671 64351 6558 60052 ...
output:
-1
result:
ok single line: '-1'
Test #15:
score: 0
Accepted
time: 2ms
memory: 6792kb
input:
2 1 2 0 1 1 0
output:
-1
result:
ok single line: '-1'
Test #16:
score: 0
Accepted
time: 2ms
memory: 6816kb
input:
2 1 2 0 1 2 0 1
output:
2
result:
ok single line: '2'
Test #17:
score: 0
Accepted
time: 0ms
memory: 6812kb
input:
2 2 2 0 1 1 1 1 0
output:
1
result:
ok single line: '1'
Test #18:
score: 0
Accepted
time: 2ms
memory: 6888kb
input:
3 2 2 1 0 1 1 0 1 1
output:
2
result:
ok single line: '2'
Test #19:
score: 0
Accepted
time: 0ms
memory: 6812kb
input:
500 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
500
result:
ok single line: '500'
Test #20:
score: 0
Accepted
time: 0ms
memory: 6892kb
input:
500 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
500
result:
ok single line: '500'
Test #21:
score: 0
Accepted
time: 2ms
memory: 6804kb
input:
500 2 2 1 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 1 1 0 0 1 0 0 1 1 0 1 1 1 0 1 1 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 ...
output:
-1
result:
ok single line: '-1'
Subtask #2:
score: 0
Accepted
Test #22:
score: 0
Accepted
time: 15ms
memory: 10612kb
input:
500 200 100000 43773 40354 2348 52596 62314 89070 43591 1761 54688 6485 17304 56821 36 36327 32247 51209 74080 85034 19128 45821 41096 74616 95383 41097 42368 1703 71263 45273 86316 3332 86662 41554 26490 26341 48653 30964 66532 75488 33898 97982 27906 26546 14311 22085 6620 80880 55703 13418 59470 ...
output:
-1
result:
ok single line: '-1'
Test #23:
score: 0
Accepted
time: 14ms
memory: 10744kb
input:
500 200 100000 84694 44242 55961 99409 24543 86124 6654 14607 68759 99912 99199 13710 63077 78271 61584 94335 55304 7288 47318 53792 9187 22947 41863 18922 75291 8375 18955 11355 35533 97430 88906 48238 8781 32443 31594 95259 77806 97248 53588 16647 80317 54518 68166 14970 52235 19631 4574 73609 240...
output:
-1
result:
ok single line: '-1'
Test #24:
score: 0
Accepted
time: 7ms
memory: 10728kb
input:
500 200 100000 40048 83440 86456 66697 38418 52723 60081 1152 77998 11648 51123 38607 45386 75629 26089 52260 51878 81338 85848 25198 99343 85880 45144 69646 62311 34717 90518 17980 77605 442 20982 7003 3263 57391 84622 81753 61591 53521 71360 32077 32418 11216 43885 94004 85531 76318 6037 94562 967...
output:
-1
result:
ok single line: '-1'
Subtask #3:
score: 0
Accepted
Test #25:
score: 0
Accepted
time: 0ms
memory: 7040kb
input:
20000 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
20000
result:
ok single line: '20000'
Test #26:
score: 0
Accepted
time: 7ms
memory: 7964kb
input:
20000 2000 100000 726 6000 26732 22386 43885 62134 72814 97411 15724 62687 50743 1947 53102 1137 54800 9523 77010 71425 33465 5874 70881 64653 41853 33355 32958 10250 73839 38337 18434 57549 49867 86673 56898 79773 35899 5895 55025 56003 71954 12510 79665 55069 29060 68752 87410 98298 94569 66676 53...
output:
10
result:
ok single line: '10'
Test #27:
score: 0
Accepted
time: 6ms
memory: 7980kb
input:
20000 2000 100000 48577 45452 66447 67702 18339 93173 72872 75655 55634 49180 28768 18283 38962 59396 12151 74386 48559 74850 35773 98495 80726 33474 66201 46766 52486 89435 51968 44179 31626 92710 49306 17393 4676 85373 22860 62209 14720 43627 80001 84608 53820 28474 32548 15215 10735 42522 2101 72...
output:
10
result:
ok single line: '10'
Test #28:
score: 0
Accepted
time: 0ms
memory: 7912kb
input:
20000 2000 100000 5056 22935 91764 34684 42518 5152 8255 90660 75145 50063 79076 2524 78434 66235 59666 61384 64049 17854 91921 983 96530 61526 13731 89845 20459 29575 29655 70560 34508 86947 67495 58315 4047 21110 23360 63975 87410 28251 66147 78322 71527 76244 71689 25854 55549 40329 19440 61817 3...
output:
10
result:
ok single line: '10'
Test #29:
score: 0
Accepted
time: 10ms
memory: 10620kb
input:
20000 2000 100000 59983 96476 15124 91126 94129 5045 83621 42090 36823 33682 2140 87872 16088 64991 5686 99029 62013 24498 88356 62457 30183 99234 33445 73940 3495 49008 81827 68045 10904 47903 13523 18515 64463 24087 62498 82922 48881 79805 37907 98947 85183 37572 19928 71398 93257 77025 90741 5423...
output:
-1
result:
ok single line: '-1'
Test #30:
score: 0
Accepted
time: 10ms
memory: 10980kb
input:
20000 2000 100000 48143 27024 35668 56980 39638 47376 23530 45743 30685 20125 86392 24998 88334 27307 14219 58482 44542 17489 79516 66863 4487 91749 91118 68207 7750 66225 58963 51734 23456 11291 37708 65546 33952 5417 69405 22462 38572 28682 1489 10847 38293 6814 94243 65761 96524 67082 23219 60661...
output:
-1
result:
ok single line: '-1'
Test #31:
score: 0
Accepted
time: 13ms
memory: 10900kb
input:
20000 2000 100000 96496 26242 71425 60172 25736 57537 50507 76476 69841 49255 5991 46158 45891 8758 91066 57511 72810 9703 68883 31203 95028 41055 61893 99049 59016 98219 34515 28130 73161 33755 64157 98856 66529 70562 51506 33461 46132 56558 53688 70037 95039 11270 33923 33422 99523 51571 59346 260...
output:
-1
result:
ok single line: '-1'
Test #32:
score: 0
Accepted
time: 3ms
memory: 7048kb
input:
20000 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
20000
result:
ok single line: '20000'
Test #33:
score: 0
Accepted
time: 0ms
memory: 6968kb
input:
20000 2 2 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 1 1 0 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 0 0 1 1 1 0 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 1 1 0 1 0 1 ...
output:
-1
result:
ok single line: '-1'
Test #34:
score: 0
Accepted
time: 3ms
memory: 6968kb
input:
20000 3 3 2 2 0 0 2 1 1 0 0 1 1 2 0 2 0 0 2 1 2 0 1 1 1 0 0 2 1 0 1 1 1 0 0 2 2 0 0 2 0 0 2 2 1 1 1 0 2 0 0 0 1 1 1 0 2 2 0 0 0 1 1 1 1 2 0 1 2 2 0 1 2 0 2 1 1 0 2 1 2 1 0 2 2 0 2 1 0 2 0 2 1 1 2 0 1 2 0 0 2 0 1 0 0 1 0 1 0 2 2 0 2 0 0 0 2 0 0 0 2 0 0 2 0 1 0 0 1 1 0 1 1 1 0 0 1 2 1 2 2 0 1 1 2 0 1 ...
output:
-1
result:
ok single line: '-1'
Test #35:
score: 0
Accepted
time: 3ms
memory: 7048kb
input:
20000 4 4 1 3 3 3 3 1 3 0 2 3 3 3 3 2 0 3 1 2 1 0 1 2 2 3 2 2 1 2 1 0 3 1 3 3 0 1 1 0 2 0 3 0 0 2 2 0 3 0 3 0 3 0 1 1 1 3 2 0 0 1 1 2 0 2 0 0 0 0 1 0 0 3 0 3 1 2 3 1 2 0 1 3 3 1 2 0 3 3 0 1 0 2 3 1 3 3 1 1 1 3 1 1 2 2 0 0 0 1 1 2 2 1 1 2 1 1 2 2 1 2 1 1 0 0 2 0 0 1 3 2 2 2 2 1 3 1 2 3 0 2 3 2 3 3 0 ...
output:
-1
result:
ok single line: '-1'
Test #36:
score: 0
Accepted
time: 3ms
memory: 6972kb
input:
20000 5 5 1 4 4 0 3 1 3 4 1 2 2 2 3 4 4 1 4 0 2 1 0 2 1 3 3 0 3 4 3 2 0 1 3 0 3 2 3 1 4 1 1 0 3 0 1 4 1 4 0 1 4 0 3 0 4 0 3 4 0 3 0 0 1 1 2 0 3 0 1 2 4 3 0 2 1 2 2 4 3 0 2 0 2 0 0 2 3 2 2 1 1 0 1 3 4 0 2 4 3 3 2 1 3 1 1 4 3 3 4 0 4 4 4 3 2 4 0 2 4 3 0 3 1 3 3 1 1 3 1 0 2 0 4 1 3 2 1 0 4 2 1 2 1 2 1 ...
output:
-1
result:
ok single line: '-1'
Test #37:
score: 0
Accepted
time: 7ms
memory: 7836kb
input:
20000 2000 100000 80731 24323 38291 69847 58285 71076 74786 65988 43465 76064 19635 12332 48271 98421 30754 55735 24306 92274 12660 41840 70116 71048 62782 1089 19622 61295 23966 8287 67630 75687 3092 56313 38375 10489 25884 52508 36148 7634 5366 4962 10691 58508 59867 5943 43863 44920 74489 60576 9...
output:
10
result:
ok single line: '10'
Test #38:
score: 0
Accepted
time: 0ms
memory: 7972kb
input:
20000 2000 100000 66355 77318 1793 57248 72270 76834 8356 48792 52193 76055 2008 67116 13154 19535 28071 34716 65775 96973 49957 37710 62872 30282 55316 27786 4245 4028 20901 20605 1833 91088 74694 31165 93089 96957 96120 94854 24103 8667 22310 48575 82118 49368 95422 78834 87059 20158 29955 84074 5...
output:
10
result:
ok single line: '10'
Test #39:
score: 0
Accepted
time: 0ms
memory: 7912kb
input:
20000 2000 100000 95639 99403 40635 31767 19306 9567 37153 60920 89186 85631 84400 3350 99823 88043 94598 89348 28596 44961 90145 7041 46974 31013 94312 82780 59093 60157 93437 18761 73482 51685 76069 95336 57842 20985 51642 83050 87340 78478 36099 54882 81052 89175 63785 83549 89360 12649 309 37269...
output:
10
result:
ok single line: '10'
Subtask #4:
score: 0
Accepted
Test #40:
score: 0
Accepted
time: 6ms
memory: 7524kb
input:
90737 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
90737
result:
ok single line: '90737'
Test #41:
score: 0
Accepted
time: 24ms
memory: 14348kb
input:
60596 38990 84068 36493 50000 70779 34501 22318 50821 30473 67672 43510 67974 521 23709 67847 4091 49363 53836 63826 66402 77770 6077 9211 47942 49527 202 15326 46884 66648 68435 10829 8707 77152 58938 10876 70195 77490 34536 69140 72026 8932 2969 3459 32153 25015 22720 60557 80939 73764 58204 73146...
output:
-1
result:
ok single line: '-1'
Test #42:
score: 0
Accepted
time: 20ms
memory: 13712kb
input:
69937 34168 87033 84635 10989 67040 66828 29651 41735 84010 26237 49659 38945 86824 39880 62102 80282 49062 53426 45966 47787 6735 17037 46246 73957 60931 65859 77742 1268 36628 36507 48514 3992 27477 24975 43988 60374 31371 3009 28014 12078 48603 67061 60600 65165 2962 66572 27213 56808 23104 23088...
output:
-1
result:
ok single line: '-1'
Test #43:
score: 0
Accepted
time: 13ms
memory: 11412kb
input:
73738 19130 71104 60311 59340 26993 54248 24757 5502 37260 30097 20721 25062 33923 15328 18368 2073 45 66372 37040 63451 1549 1714 58000 39836 29749 29578 2170 38562 60698 33854 15518 18934 60867 27635 38215 12990 7213 16894 23100 53207 61116 26994 70236 52616 55868 16803 42944 19271 35776 67642 890...
output:
-1
result:
ok single line: '-1'
Test #44:
score: 0
Accepted
time: 3ms
memory: 7664kb
input:
100000 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
100000
result:
ok single line: '100000'
Test #45:
score: 0
Accepted
time: 3ms
memory: 7664kb
input:
100000 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
100000
result:
ok single line: '100000'
Test #46:
score: 0
Accepted
time: 8ms
memory: 7252kb
input:
100000 2 2 0 1 0 1 1 0 1 1 1 0 1 0 0 1 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 1 1 0 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 0 1 0 1 1...
output:
-1
result:
ok single line: '-1'
Test #47:
score: 0
Accepted
time: 8ms
memory: 7196kb
input:
100000 3 3 2 1 1 1 0 2 1 0 2 1 0 1 0 2 2 2 0 2 2 2 1 0 0 1 2 2 2 2 1 0 2 0 1 2 1 1 0 1 1 0 1 1 2 0 0 0 2 2 2 0 2 2 2 1 2 1 0 2 2 2 1 1 1 1 2 1 2 0 1 2 0 1 2 1 1 2 0 0 1 2 2 0 0 0 1 2 1 1 1 1 0 1 2 2 2 0 0 0 2 2 1 2 0 1 0 1 2 0 2 0 2 2 0 1 2 2 1 2 1 1 1 1 1 1 0 1 2 2 2 1 1 1 1 1 0 0 1 2 2 0 1 0 1 2 1...
output:
-1
result:
ok single line: '-1'
Test #48:
score: 0
Accepted
time: 7ms
memory: 7204kb
input:
100000 4 4 1 3 2 1 0 0 1 3 0 2 1 3 2 2 3 1 2 1 0 2 2 3 1 0 2 3 2 2 0 0 0 1 3 2 3 1 0 0 0 2 2 0 2 2 3 0 2 3 1 1 2 2 2 2 0 0 0 2 3 3 0 2 3 2 2 1 0 3 2 3 1 3 3 2 0 0 3 0 3 1 1 2 1 0 0 3 1 0 2 1 1 3 2 2 3 3 0 1 1 3 0 3 3 0 3 1 3 3 0 0 2 3 2 0 0 0 3 1 2 1 0 0 2 3 0 2 0 1 0 3 0 0 1 2 0 2 0 3 2 2 1 2 3 3 0...
output:
-1
result:
ok single line: '-1'
Test #49:
score: 0
Accepted
time: 3ms
memory: 7132kb
input:
100000 5 5 1 2 2 4 4 2 1 4 3 0 3 1 3 4 0 3 2 4 1 1 0 4 0 3 4 2 3 1 4 1 4 0 4 2 0 0 0 4 0 3 0 1 3 1 3 1 3 3 4 3 0 3 3 3 3 2 4 4 3 2 2 2 2 3 0 1 3 3 2 1 3 0 2 4 3 3 0 1 0 1 3 3 4 3 2 3 2 4 0 1 3 2 4 3 3 4 1 4 1 0 4 4 3 3 4 1 2 1 2 2 3 3 1 1 0 2 0 3 1 0 2 1 1 4 0 2 3 2 4 1 3 1 2 1 3 4 0 0 3 1 3 4 1 0 0...
output:
-1
result:
ok single line: '-1'
Test #50:
score: 0
Accepted
time: 20ms
memory: 16580kb
input:
100000 50000 100000 2781 68544 48547 45491 25679 4674 79220 74845 8206 6434 92699 35083 59726 31698 60872 93205 69365 86784 41182 27677 31456 57201 40827 77422 75963 77172 63436 78005 40056 60545 6941 94882 54663 6538 77405 33630 17970 19524 9885 4505 70912 84912 5327 18520 45981 72632 42545 29717 6...
output:
2
result:
ok single line: '2'
Test #51:
score: 0
Accepted
time: 0ms
memory: 7252kb
input:
56774 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
56774
result:
ok single line: '56774'
Test #52:
score: 0
Accepted
time: 28ms
memory: 16620kb
input:
100000 50000 100000 18375 22840 27976 55367 77371 43358 86464 50766 76157 76350 49560 38698 17603 20643 39857 30982 61604 21150 25712 82498 68276 11503 99395 88585 2621 36350 39463 44253 14599 8335 77046 17012 57469 65919 80302 43984 9249 86747 95058 86849 88756 48288 13438 53722 78121 62809 80602 4...
output:
2
result:
ok single line: '2'
Test #53:
score: 0
Accepted
time: 20ms
memory: 16568kb
input:
100000 50000 100000 89887 47938 81541 45341 6117 39081 93169 42886 34337 131 48937 11404 53578 69688 48404 98072 86981 39162 98879 34837 86458 75551 56105 50606 58009 80407 40787 58862 49507 30189 78722 53817 10360 34884 50852 21449 4084 78643 19772 27247 42378 53510 33858 51823 31944 97802 64704 82...
output:
2
result:
ok single line: '2'
Test #54:
score: 0
Accepted
time: 24ms
memory: 16740kb
input:
100000 50000 100000 82857 90881 29695 63435 58867 64672 38945 58817 15836 86545 28973 65515 60085 79652 51934 54458 30893 8277 1232 29041 59805 90584 40769 85626 68621 12281 2065 61619 45210 25821 66419 42925 60218 4776 54312 47022 62654 40341 53 74882 5868 85970 28943 6890 55715 15634 40628 28708 3...
output:
2
result:
ok single line: '2'
Test #55:
score: 0
Accepted
time: 16ms
memory: 16556kb
input:
100000 50000 100000 57705 142 15205 33773 47742 12497 60690 18863 22674 4359 51573 45105 42718 55233 72893 34255 81862 78903 28807 58087 36809 27502 24770 72113 91439 31668 92881 91015 64633 70770 31749 2280 73341 93058 59351 53336 30820 78511 69554 93320 50416 19918 50956 23838 62546 4063 81730 245...
output:
2
result:
ok single line: '2'
Test #56:
score: 0
Accepted
time: 25ms
memory: 16676kb
input:
100000 50000 100000 68765 84254 44647 64689 96144 16348 75451 35511 95647 6758 13881 66670 20035 605 69081 36373 72633 29561 43832 88961 18012 16979 8543 82668 44814 87309 53042 87724 17841 21558 51798 53311 45125 96885 90564 17496 44206 54737 35148 29113 99514 6046 67201 26086 77729 5231 48992 3239...
output:
2
result:
ok single line: '2'
Test #57:
score: 0
Accepted
time: 22ms
memory: 15696kb
input:
100000 43267 100000 25886 19811 70902 98722 65857 3350 42839 29288 37977 59097 52073 26601 73578 55493 30216 73814 73151 10271 41493 33168 34373 81784 86612 93765 49584 66498 20027 26199 92288 52561 24157 40816 99126 65727 66132 45449 76404 40154 65519 92060 26040 2581 13839 41383 30894 68576 77003 ...
output:
-1
result:
ok single line: '-1'
Test #58:
score: 0
Accepted
time: 30ms
memory: 15656kb
input:
100000 43279 100000 88837 75756 65015 46155 5515 68857 4848 6384 96646 48934 90609 33578 77067 87205 44674 37053 54381 1956 15713 92720 2246 46929 4516 52595 91903 59460 33182 81506 97750 35887 23852 45362 83376 32995 2227 76562 19641 72539 98084 20631 86613 30177 46138 79499 72981 58357 69815 46892...
output:
-1
result:
ok single line: '-1'
Test #59:
score: 0
Accepted
time: 21ms
memory: 15776kb
input:
100000 43268 100000 67997 71587 57808 42164 7383 13128 37722 69353 50548 34615 91474 82421 84046 15646 51406 65137 53 54449 54742 13359 26180 33354 48539 99124 38406 6058 65102 57242 49913 36613 26262 10655 2625 33623 8141 59236 63337 31780 9110 12937 62064 61227 65984 81292 86759 85255 8929 12955 4...
output:
-1
result:
ok single line: '-1'
Test #60:
score: 0
Accepted
time: 8ms
memory: 7124kb
input:
98444 2 2 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 1 1 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 1 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 0 1 1 1 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 1 1 1 0 0 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1 0 0 0 0 ...
output:
-1
result:
ok single line: '-1'
Test #61:
score: 0
Accepted
time: 6ms
memory: 6992kb
input:
65408 3 3 2 1 1 0 0 0 2 1 0 0 2 2 0 2 0 0 1 0 2 0 0 1 1 0 0 1 0 0 2 2 0 1 0 1 1 1 1 1 2 0 2 2 2 0 0 1 2 0 0 0 2 2 2 1 2 0 1 0 0 2 1 0 1 2 2 2 2 2 1 0 2 0 2 2 0 2 0 2 0 2 2 1 2 0 0 2 0 0 0 0 1 2 1 0 2 2 2 2 0 0 1 0 2 0 0 0 1 2 0 1 2 0 0 0 0 0 2 0 2 2 2 2 2 0 1 0 0 0 1 0 2 0 1 2 0 2 0 0 2 0 0 1 1 0 0 ...
output:
-1
result:
ok single line: '-1'
Test #62:
score: 0
Accepted
time: 5ms
memory: 7096kb
input:
59419 4 4 1 1 0 3 2 0 1 2 0 1 2 3 1 0 1 3 2 3 3 0 0 3 2 0 0 3 0 1 1 3 2 0 2 1 3 1 3 0 3 3 2 0 1 3 3 0 3 0 0 0 2 2 3 0 3 1 0 3 0 0 3 3 1 1 2 2 0 0 2 1 0 3 2 1 1 0 3 3 1 2 1 3 0 1 3 3 3 2 1 0 2 0 1 0 1 1 0 0 2 1 2 0 3 2 2 0 1 3 0 3 3 0 0 3 3 2 1 0 3 3 2 1 1 2 0 1 2 1 0 1 0 3 1 1 1 2 2 0 2 3 0 3 1 1 0 ...
output:
-1
result:
ok single line: '-1'
Test #63:
score: 0
Accepted
time: 3ms
memory: 7200kb
input:
99824 5 5 1 0 0 3 2 0 1 1 4 4 3 2 2 3 1 1 4 3 2 4 0 0 0 1 2 1 3 1 1 2 4 1 3 4 1 3 3 1 3 3 0 1 3 4 0 3 1 4 0 2 4 3 1 3 1 1 3 0 0 4 0 0 1 1 1 3 1 1 1 1 2 3 0 0 0 4 1 4 4 0 1 1 1 1 1 2 2 1 2 0 0 2 3 0 4 2 0 0 1 3 2 3 0 0 1 1 2 4 0 2 3 4 1 4 1 1 4 0 2 1 3 2 2 0 3 1 3 1 1 0 4 0 0 0 4 1 1 1 2 0 4 1 4 4 4 ...
output:
-1
result:
ok single line: '-1'
Test #64:
score: 0
Accepted
time: 24ms
memory: 15916kb
input:
86292 48530 99056 76669 83147 3511 16120 57837 60692 69786 11796 179 2634 33406 14557 8468 12268 2514 98832 57980 76492 13403 15749 57665 51160 63589 93102 26246 22507 39180 64852 86725 26450 89177 84136 1877 83853 80851 55825 83706 3433 31691 32983 40480 57898 43229 28967 36164 20712 73614 64477 72...
output:
2
result:
ok single line: '2'
Test #65:
score: 0
Accepted
time: 14ms
memory: 11500kb
input:
55493 24269 89906 81500 89875 63800 41844 9706 79845 46726 59751 85155 55334 40754 84937 77905 17221 24799 73124 20135 80261 80580 45702 6219 63801 40423 71591 57888 12262 80275 15171 3837 58318 87743 29739 32831 11376 33396 14359 53258 86763 17524 37979 33843 73229 62653 1140 58019 39587 83527 1757...
output:
3
result:
ok single line: '3'
Test #66:
score: 0
Accepted
time: 16ms
memory: 14280kb
input:
55623 45787 81989 68046 77132 12180 61072 77330 50702 27350 10673 18363 64547 38715 18940 21861 65805 23665 14235 48151 46854 49827 7468 73941 14069 30475 57958 43108 12181 56854 7369 19559 59639 47796 34315 10070 40568 7571 863 68453 2826 29012 22130 34411 62853 70768 80048 28825 44089 40030 74363 ...
output:
2
result:
ok single line: '2'
Subtask #5:
score: 0
Accepted
Test #67:
score: 0
Accepted
time: 2ms
memory: 6828kb
input:
2 2 1 0 0 1 0 1 0
output:
1
result:
ok single line: '1'
Test #68:
score: 0
Accepted
time: 2ms
memory: 6836kb
input:
412 159 85469 61709 43383 24915 1743 85237 79396 67934 60204 9114 57096 46143 37391 39285 55688 11312 67254 55177 25859 5699 84808 28113 6356 7644 31684 45668 21221 73787 74371 6532 64857 63114 68506 55646 75027 70678 43144 44716 74179 51493 43858 36594 9611 50537 62281 20747 21198 60301 66097 66677...
output:
3
result:
ok single line: '3'
Test #69:
score: 0
Accepted
time: 2ms
memory: 6836kb
input:
439 162 63801 1717 56222 10057 20404 28094 4796 9392 52294 2940 35424 19605 46863 7472 61432 19326 5702 25133 35304 37366 51835 47697 1671 44304 14383 11573 17022 5019 43712 47603 23321 47186 35664 35144 3818 57617 57746 61991 35337 38133 46607 50541 45813 31831 10151 58163 47896 14616 21285 61463 5...
output:
3
result:
ok single line: '3'
Test #70:
score: 0
Accepted
time: 0ms
memory: 6848kb
input:
290 129 55950 49626 26041 49517 260 27571 33120 43881 51515 54468 22867 42272 51549 1453 23089 30785 53037 53681 25726 27142 2176 47027 50981 42378 42031 33247 4248 47735 6953 11159 15961 33410 48732 25505 287 6601 16149 51533 27210 12686 2212 11717 49057 33173 39702 17961 23472 5395 19129 50732 553...
output:
3
result:
ok single line: '3'
Test #71:
score: 0
Accepted
time: 2ms
memory: 6840kb
input:
375 155 97988 58793 19899 43072 37633 27652 16060 3223 67530 70159 5398 70901 84903 42597 5913 89365 41130 95832 48018 96314 5758 17955 6213 3880 7386 89622 31955 7459 6005 91192 84456 8044 48620 82790 56069 40997 71703 33083 91375 89392 1927 10765 7753 90458 17839 62989 23205 48113 21842 63740 3391...
output:
3
result:
ok single line: '3'
Test #72:
score: 0
Accepted
time: 2ms
memory: 6856kb
input:
335 176 79264 1523 27988 48472 24373 30832 15844 58362 9170 5767 24612 43850 8354 29068 56395 10393 52292 13766 54301 26611 11949 1777 13231 9585 47156 49593 17194 33670 72209 26822 67174 6719 69941 75440 43838 49426 65160 39260 30359 53557 71706 30751 8085 72698 38141 49646 24657 60486 54718 49946 ...
output:
2
result:
ok single line: '2'
Test #73:
score: 0
Accepted
time: 0ms
memory: 6848kb
input:
306 4 87564 75815 67285 53959 4884 79940 31220 68773 20200 69873 48339 3016 72137 62999 45018 30561 25849 41400 7895 62870 54147 67368 12662 5850 58718 49610 73308 16818 65904 21471 72802 52697 62499 84787 10145 46060 18988 29269 63962 14734 36917 80828 54026 7834 75997 22490 72900 76714 79073 11356...
output:
-1
result:
ok single line: '-1'
Test #74:
score: 0
Accepted
time: 2ms
memory: 6820kb
input:
306 4 306 29 295 45 254 208 289 93 228 173 182 262 22 167 62 145 223 216 31 238 267 42 93 297 199 245 42 130 256 61 188 269 177 15 250 75 140 266 218 171 160 107 107 3 273 268 187 168 234 172 74 273 117 50 292 184 122 11 77 154 215 81 286 284 163 117 297 29 8 160 208 73 45 262 275 165 111 266 195 55...
output:
77
result:
ok single line: '77'
Test #75:
score: 0
Accepted
time: 2ms
memory: 6940kb
input:
314 164 75298 18231 19787 15390 56627 48237 34433 35996 163 25802 40037 44136 13177 27788 11192 57216 3227 40254 19256 18358 62545 30239 49670 62190 59301 11333 1171 234 69576 73057 55333 1407 14994 42877 6648 5205 67305 2258 45689 21842 57904 45974 67351 71960 47703 49406 39856 34746 40327 57133 54...
output:
-1
result:
ok single line: '-1'
Test #76:
score: 0
Accepted
time: 0ms
memory: 6848kb
input:
314 165 314 124 6 285 202 142 282 92 196 294 261 199 186 93 31 16 104 84 293 12 199 85 101 95 90 306 100 116 172 171 169 229 1 195 92 73 212 265 257 86 209 313 288 44 123 244 157 269 182 62 204 259 38 58 283 154 176 255 258 269 176 92 100 307 305 259 241 205 221 159 132 96 69 2 85 36 210 96 264 282 ...
output:
2
result:
ok single line: '2'
Test #77:
score: 0
Accepted
time: 0ms
memory: 6904kb
input:
425 83 94546 56894 27886 377 75105 54504 5104 3879 6553 48712 56289 8616 80208 10365 91662 43657 15802 39291 15369 30860 21085 8900 56763 12149 62832 53910 27163 36435 38039 68315 75658 72421 5493 44570 9413 23707 41807 17731 24629 8570 17858 427 73145 57190 34220 6219 35672 31613 2189 45744 4393 28...
output:
-1
result:
ok single line: '-1'
Test #78:
score: 0
Accepted
time: 0ms
memory: 6816kb
input:
2 2 2 0 1 1 0 1 0
output:
-1
result:
ok single line: '-1'
Test #79:
score: 0
Accepted
time: 0ms
memory: 6884kb
input:
314 54 92037 16802 46430 41255 57991 53218 8420 73050 56543 59101 39481 73253 52075 23585 80937 47410 5334 75876 54648 80175 91752 1754 3559 86540 49790 18416 85540 37528 23025 45126 25390 84181 67583 32365 45035 41408 76640 68146 49915 68318 21065 60518 20211 26466 72330 59019 12557 34845 82584 808...
output:
8
result:
ok single line: '8'
Test #80:
score: 0
Accepted
time: 0ms
memory: 6812kb
input:
500 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
250
result:
ok single line: '250'
Test #81:
score: 0
Accepted
time: 2ms
memory: 6816kb
input:
500 31 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
17
result:
ok single line: '17'
Test #82:
score: 0
Accepted
time: 2ms
memory: 6876kb
input:
500 43 2 0 0 0 0 1 1 0 0 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 1 1 1 0 1 1 1 1 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0...
output:
-1
result:
ok single line: '-1'
Test #83:
score: 0
Accepted
time: 0ms
memory: 6896kb
input:
500 51 3 1 2 2 2 1 2 1 1 0 0 1 2 2 2 0 1 2 0 2 1 0 2 0 0 0 2 0 2 0 1 2 1 2 2 0 0 2 1 2 1 0 2 1 1 1 0 1 0 1 1 0 1 0 2 2 0 0 0 2 1 2 0 2 0 1 1 0 2 2 2 2 1 1 0 1 0 1 1 0 0 0 0 1 0 0 1 0 2 2 2 2 0 1 0 1 2 1 0 2 2 2 0 2 2 2 2 0 1 2 0 1 0 1 0 2 0 2 1 2 0 0 1 2 2 1 1 1 2 0 0 2 2 1 2 1 0 0 0 1 1 0 2 1 1 2 2...
output:
-1
result:
ok single line: '-1'
Test #84:
score: 0
Accepted
time: 2ms
memory: 6896kb
input:
500 57 4 1 0 0 1 3 3 3 3 1 0 2 2 3 3 3 3 0 1 1 1 2 1 1 0 3 1 3 2 0 3 3 2 2 1 1 3 1 2 0 1 3 1 2 0 0 3 1 3 2 0 0 1 2 3 0 2 0 0 3 2 2 3 1 1 3 3 3 0 2 0 2 3 3 2 1 3 0 3 0 2 1 2 3 3 2 1 0 1 1 0 2 3 0 2 2 2 2 0 2 3 0 3 0 1 3 0 2 3 1 1 2 3 3 3 3 2 0 0 2 3 0 0 1 1 0 0 3 2 0 1 0 3 1 3 0 2 0 0 0 0 3 2 3 0 0 0...
output:
-1
result:
ok single line: '-1'
Test #85:
score: 0
Accepted
time: 2ms
memory: 6812kb
input:
500 62 5 0 3 2 2 4 4 0 4 1 2 3 2 2 1 2 0 4 1 3 1 2 3 4 4 1 4 3 4 2 2 0 2 2 2 4 1 0 4 4 4 1 3 2 0 3 3 0 0 1 1 1 4 2 3 0 3 4 3 2 3 3 1 0 0 1 3 2 1 3 1 1 1 2 4 1 0 4 4 2 4 4 1 2 3 4 2 2 3 1 3 3 4 2 4 3 3 3 2 0 4 0 2 0 0 0 1 1 4 4 3 0 2 2 2 4 3 2 1 0 1 2 2 0 0 1 4 4 4 1 2 4 1 2 0 0 0 3 2 0 3 3 2 0 1 2 2...
output:
-1
result:
ok single line: '-1'
Test #86:
score: 0
Accepted
time: 2ms
memory: 6916kb
input:
500 200 100000 55001 52914 54089 90937 51297 56717 89440 78548 87457 86237 16284 15899 15998 77469 33032 72098 12721 70392 66311 74072 45484 88354 97688 36517 92398 2390 14453 82746 38889 81838 93578 95500 39884 16191 85905 56475 67931 25934 24252 28449 84062 84909 83737 87218 74357 8781 89747 10423...
output:
3
result:
ok single line: '3'
Test #87:
score: 0
Accepted
time: 2ms
memory: 6784kb
input:
500 200 100000 57632 36574 3418 91889 67055 80408 7736 52671 59045 10406 23330 92903 58967 78321 4387 25401 19995 43317 60253 73465 45212 83214 71918 38019 99852 34112 82636 66943 76577 99291 53543 86774 7912 49877 79615 89866 11303 82547 73682 22306 93160 58194 22148 74907 76875 90530 38946 48722 2...
output:
3
result:
ok single line: '3'
Test #88:
score: 0
Accepted
time: 2ms
memory: 6864kb
input:
500 200 100000 54103 61674 37646 41053 44326 54500 51270 3336 96576 22872 36889 23880 56317 62159 33600 14249 69928 22063 97067 45889 70301 49263 76567 18681 44629 3367 77687 18868 69589 4397 26350 65593 13523 31974 17520 39192 98509 1423 98191 39251 82603 89217 38893 55446 11366 75455 63112 77930 1...
output:
3
result:
ok single line: '3'
Test #89:
score: 0
Accepted
time: 2ms
memory: 6812kb
input:
2 2 2 0 1 1 0 2 0 1
output:
1
result:
ok single line: '1'
Test #90:
score: 0
Accepted
time: 2ms
memory: 6856kb
input:
500 200 100000 90805 72794 82254 33664 69966 77936 48091 718 45411 4145 53080 41671 77494 30319 83341 40638 58371 5055 33507 82945 99035 50318 33522 45637 20608 17201 42044 43517 1016 95558 78030 13033 265 71732 23363 79121 39169 70040 69179 6965 45427 58687 7517 23967 29060 61687 94148 44828 94677 ...
output:
3
result:
ok single line: '3'
Test #91:
score: 0
Accepted
time: 0ms
memory: 6860kb
input:
500 200 100000 79550 91054 98620 1790 95424 75331 81983 3560 51252 78787 9818 62016 44854 9715 4589 96081 32233 874 39835 30051 64037 551 77689 99894 10754 99398 68204 75039 19881 38023 51114 11796 40154 82422 59252 24329 35056 84275 12505 94635 53300 51930 35958 65612 66572 57464 48109 94885 81970 ...
output:
3
result:
ok single line: '3'
Test #92:
score: 0
Accepted
time: 2ms
memory: 6864kb
input:
500 200 100000 12439 93517 66763 20657 91877 41132 82425 24059 81145 23832 46096 80387 8586 44188 64708 28089 33349 39671 92648 64696 15381 99790 55244 99948 36005 4596 55818 59985 91054 13869 70242 9218 37424 11073 76307 85096 75539 90243 62885 90961 67874 94321 6978 27867 58496 31742 67080 12485 6...
output:
3
result:
ok single line: '3'
Test #93:
score: 0
Accepted
time: 0ms
memory: 6924kb
input:
500 200 100000 69267 81722 22354 98744 33561 50176 93988 12597 67852 6 38548 97045 54975 38520 62217 44940 49717 83259 40434 58434 66710 41944 61094 77513 20183 38243 71067 44724 54594 96086 35409 53775 72279 13370 96822 18166 29933 59116 71525 96747 67134 36326 93499 81518 34306 32632 40740 77563 2...
output:
-1
result:
ok single line: '-1'
Test #94:
score: 0
Accepted
time: 2ms
memory: 6852kb
input:
500 200 500 66 271 379 489 324 369 461 258 60 167 374 323 65 463 387 209 357 64 338 95 116 80 26 105 431 46 282 74 372 312 64 355 102 69 350 350 276 43 340 323 139 40 355 131 112 497 142 414 244 332 243 98 284 51 175 261 292 162 294 176 114 19 379 314 225 120 417 444 243 194 278 497 408 277 406 346 ...
output:
3
result:
ok single line: '3'
Test #95:
score: 0
Accepted
time: 2ms
memory: 6972kb
input:
500 197 100000 17127 38897 92138 99337 38901 4113 27661 80395 29735 92046 84400 30958 38018 58060 56060 73044 22325 32527 97821 34770 40542 62931 47709 71210 14991 8381 97505 13747 76550 71263 35531 5377 55818 18369 33046 9444 41990 85924 90697 62527 80289 15999 56036 43804 6857 60787 35087 69719 24...
output:
-1
result:
ok single line: '-1'
Test #96:
score: 0
Accepted
time: 0ms
memory: 6856kb
input:
500 200 500 209 420 107 453 417 88 281 61 200 362 468 373 292 40 485 365 476 485 173 49 477 51 352 483 13 17 27 119 104 354 3 36 134 129 99 188 74 252 121 112 306 64 485 84 279 486 328 414 110 354 116 305 393 471 302 198 261 468 179 45 359 364 313 205 113 396 89 112 275 328 355 55 255 325 11 381 419...
output:
3
result:
ok single line: '3'
Test #97:
score: 0
Accepted
time: 0ms
memory: 6880kb
input:
500 200 100000 34732 4138 60443 74604 2014 19066 7017 46524 17499 93515 37243 5826 16299 59806 41205 50907 63520 23943 20962 49859 80519 87137 21078 83237 3330 66027 16862 29939 23810 88561 96087 88504 14094 64502 38087 23427 2022 40376 26390 28043 80025 92225 16186 76062 3219 34288 12978 17082 5757...
output:
-1
result:
ok single line: '-1'
Test #98:
score: 0
Accepted
time: 0ms
memory: 6836kb
input:
500 200 500 194 175 373 401 380 404 307 480 354 115 482 215 77 69 248 243 390 343 189 433 7 438 450 46 260 101 54 242 164 268 51 354 123 479 70 99 10 46 93 454 374 215 399 276 260 29 333 237 417 348 410 299 322 331 408 101 208 467 128 155 71 32 37 166 418 173 353 90 73 24 258 39 499 372 258 484 264 ...
output:
3
result:
ok single line: '3'
Test #99:
score: 0
Accepted
time: 2ms
memory: 6812kb
input:
281 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
141
result:
ok single line: '141'
Test #100:
score: 0
Accepted
time: 2ms
memory: 6824kb
input:
329 27 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
13
result:
ok single line: '13'
Test #101:
score: 0
Accepted
time: 2ms
memory: 6804kb
input:
258 32 2 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 0 0 1 1 0 1 1 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 0 1 1 0 0 1 1 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 1 1 1...
output:
-1
result:
ok single line: '-1'
Test #102:
score: 0
Accepted
time: 2ms
memory: 6752kb
input:
345 29 3 2 0 2 2 2 2 0 0 2 0 2 0 1 2 1 2 0 1 0 2 2 1 0 1 2 0 2 0 0 1 2 1 1 1 1 1 2 1 1 1 1 1 0 2 0 2 1 1 0 2 0 1 0 1 2 0 0 1 2 1 0 2 0 1 1 2 0 2 0 2 1 2 0 1 2 0 1 0 0 1 2 0 0 1 2 2 0 1 1 1 0 0 0 0 1 1 2 0 1 0 2 1 2 2 2 1 0 0 0 2 2 1 1 2 2 2 0 1 1 1 2 2 0 1 0 2 1 1 1 1 2 0 0 0 0 2 0 2 1 0 0 1 0 0 0 1...
output:
-1
result:
ok single line: '-1'
Test #103:
score: 0
Accepted
time: 2ms
memory: 6872kb
input:
449 8 4 2 2 3 3 2 2 3 3 3 1 1 3 1 1 0 0 3 1 2 2 1 2 0 3 2 1 3 1 0 3 1 3 3 2 3 0 2 3 2 0 3 3 2 1 2 2 0 1 0 0 2 2 2 0 1 3 3 0 3 2 0 3 3 2 0 3 3 3 1 2 2 2 1 0 3 2 2 1 2 0 2 1 2 3 1 2 2 2 0 2 2 1 1 2 2 3 3 2 1 0 0 0 1 0 0 0 3 3 3 3 0 3 0 2 0 0 1 3 3 0 3 2 2 0 1 0 1 0 2 0 1 3 3 0 3 1 1 2 2 3 0 0 2 0 0 3 ...
output:
57
result:
ok single line: '57'
Test #104:
score: 0
Accepted
time: 0ms
memory: 6808kb
input:
372 46 5 4 2 4 0 0 4 0 4 0 3 0 4 1 1 3 3 1 4 2 1 1 0 0 4 2 2 4 0 1 4 4 2 4 2 4 0 3 1 2 0 4 4 4 0 2 4 0 0 0 4 3 1 1 2 4 2 3 3 2 1 4 2 3 1 3 3 2 1 1 1 4 0 3 4 2 4 0 2 3 3 3 0 2 1 0 0 1 4 0 4 1 2 2 4 1 2 4 0 1 3 3 1 2 1 3 1 1 0 4 0 4 3 2 1 1 2 4 3 4 1 2 3 1 4 3 1 4 3 1 3 3 4 4 1 2 1 1 4 0 2 2 3 4 2 3 3...
output:
-1
result:
ok single line: '-1'
Subtask #6:
score: 0
Accepted
Test #105:
score: 0
Accepted
time: 0ms
memory: 6912kb
input:
253 186 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
2
result:
ok single line: '2'
Test #106:
score: 0
Accepted
time: 3ms
memory: 6996kb
input:
338 107 79642 59849 76829 9531 57280 28662 30413 77255 70553 30786 29898 73465 74311 810 57904 30982 18951 78809 77722 44406 75608 78822 20946 6025 16539 61207 31673 20749 65973 26760 29863 47055 25607 9524 31978 65382 29107 69412 50740 11841 29533 20199 22302 75226 75033 38251 29576 58027 63616 270...
output:
4
result:
ok single line: '4'
Test #107:
score: 0
Accepted
time: 3ms
memory: 7004kb
input:
339 187 98249 86843 41658 59976 17913 38318 83897 59222 52535 92865 49929 82999 81416 54047 41983 16386 27858 73653 41466 82614 87174 35519 6835 34923 75522 94314 98198 22748 39523 21578 84075 7878 16292 7631 3833 90198 93669 89337 4549 25873 49690 62879 85149 80527 83968 34894 76881 59856 51705 400...
output:
2
result:
ok single line: '2'
Test #108:
score: 0
Accepted
time: 14ms
memory: 9452kb
input:
288 114 69745 38720 45313 21452 7506 46620 48161 28211 7838 51747 337 29693 38930 54308 23581 14367 47574 29701 23696 65921 1867 12516 60838 30659 51934 30094 41304 45692 67437 39545 15410 35508 5327 5945 3622 53283 4987 21006 66740 32967 48425 15854 42887 8311 56773 59433 24134 51709 60975 28506 41...
output:
-1
result:
ok single line: '-1'
Test #109:
score: 0
Accepted
time: 13ms
memory: 9516kb
input:
347 3 86348 51150 73658 9707 61425 25972 9249 71016 27038 79473 11436 7131 25447 27462 69168 13993 75983 38063 14464 33630 21574 42109 37447 1844 57729 40437 73881 37377 31127 32043 15529 42045 44131 35549 34785 25448 22465 65804 61382 13882 11137 75675 82480 50998 29210 1435 84520 4993 21373 53462 ...
output:
-1
result:
ok single line: '-1'
Test #110:
score: 0
Accepted
time: 10ms
memory: 10384kb
input:
347 33 96375 53201 87989 22639 7910 39600 7269 10900 36988 41177 35680 17517 37876 49946 14937 28002 47058 28366 57863 76172 59771 48320 14189 16523 91155 35274 57961 24279 87741 29724 14843 89273 28494 91857 63006 42700 60151 49673 52836 21693 6667 14209 32305 91681 3938 18153 49010 12376 50295 415...
output:
-1
result:
ok single line: '-1'
Test #111:
score: 0
Accepted
time: 2ms
memory: 6844kb
input:
500 200 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
3
result:
ok single line: '3'
Test #112:
score: 0
Accepted
time: 0ms
memory: 6844kb
input:
500 200 2 0 0 1 1 1 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 0 0 1 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1 1 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 1 0 1 0 0 1 0 1 0 1 1 1 1 1 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 ...
output:
3
result:
ok single line: '3'
Test #113:
score: 0
Accepted
time: 0ms
memory: 6888kb
input:
500 200 3 2 1 2 0 2 2 0 1 1 1 2 1 2 1 2 2 1 1 1 0 2 1 2 2 1 2 0 0 0 2 2 0 0 1 2 1 2 1 1 0 0 0 1 2 2 0 0 0 2 2 0 0 0 1 2 1 0 1 2 0 2 0 1 1 1 2 2 1 0 0 0 1 1 0 2 1 2 0 1 0 1 0 0 1 1 2 2 1 0 0 0 1 2 0 0 0 2 0 0 0 0 2 2 2 1 0 1 2 1 0 2 1 2 1 2 2 0 1 2 0 1 1 1 2 2 1 0 0 2 1 0 1 1 1 2 0 0 2 2 0 1 2 1 0 0 ...
output:
3
result:
ok single line: '3'
Test #114:
score: 0
Accepted
time: 2ms
memory: 6848kb
input:
500 200 4 3 3 1 3 2 1 3 0 0 1 2 1 2 1 0 3 1 2 3 0 3 2 1 3 3 3 2 3 0 2 2 0 0 1 3 2 2 2 0 3 2 2 3 0 0 2 0 0 3 2 2 3 3 3 3 2 3 0 0 0 3 0 0 3 2 3 3 1 3 3 3 0 1 2 1 1 2 0 0 1 0 0 0 2 0 2 0 0 2 0 0 3 2 0 3 3 1 1 0 3 3 1 0 0 3 1 0 3 0 0 0 1 0 2 0 1 2 2 3 1 1 0 2 3 0 1 2 1 0 2 0 3 0 3 2 0 2 3 2 0 0 1 3 3 3 ...
output:
3
result:
ok single line: '3'
Test #115:
score: 0
Accepted
time: 2ms
memory: 6856kb
input:
500 200 5 3 3 2 0 3 0 0 4 4 2 4 1 1 2 4 4 4 4 1 2 3 2 0 3 1 2 3 4 4 0 4 1 1 2 2 1 3 2 1 3 1 0 2 1 3 3 4 3 1 3 2 0 1 0 4 0 2 0 2 1 0 1 0 3 3 0 2 2 2 0 4 4 2 1 0 2 1 3 2 1 0 4 1 4 3 0 0 2 3 2 3 3 3 1 3 4 1 0 3 1 0 0 0 3 2 3 0 4 2 0 0 3 4 2 3 0 2 3 2 1 4 0 0 3 4 2 3 2 4 1 1 1 2 0 3 2 3 4 3 2 1 2 4 0 0 ...
output:
3
result:
ok single line: '3'
Test #116:
score: 0
Accepted
time: 2ms
memory: 6928kb
input:
477 40 2 0 1 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 1 1 1 1 0 1 1...
output:
12
result:
ok single line: '12'
Test #117:
score: 0
Accepted
time: 0ms
memory: 7044kb
input:
500 200 100000 22808 16252 38602 1860 73199 4626 84024 34082 44513 42242 60367 33187 8268 87252 11338 22595 82055 19223 70892 88888 75162 52675 215 62181 13732 34648 42141 44926 85117 54946 96376 90469 22703 34381 39825 58035 32945 55358 58460 99158 41422 21996 16881 50162 23894 12736 23410 70381 13...
output:
3
result:
ok single line: '3'
Test #118:
score: 0
Accepted
time: 0ms
memory: 7104kb
input:
500 200 100000 24805 78108 7889 35900 17604 93366 60120 23288 47282 45036 51890 48242 31348 20582 37228 32870 74966 79435 81313 62611 58327 2491 44874 72416 9165 78223 13895 95306 994 80029 75203 86148 20055 18386 83681 77274 17916 57171 13759 82602 95374 32946 69997 54788 41610 15066 59429 20604 31...
output:
3
result:
ok single line: '3'
Test #119:
score: 0
Accepted
time: 0ms
memory: 7048kb
input:
500 200 100000 13756 33641 43031 28571 74227 82489 14243 4030 20342 33296 60669 66670 24950 88291 69006 83860 30860 68547 24367 7421 60574 83914 63955 9689 20491 55267 10634 52058 36507 48763 91972 7710 58892 20559 51368 10182 30887 56037 37437 10490 60427 32521 3403 33208 35392 73599 24363 55513 19...
output:
3
result:
ok single line: '3'
Test #120:
score: 0
Accepted
time: 0ms
memory: 7052kb
input:
500 200 100000 8701 14528 43976 97995 95359 84077 95901 86841 6806 90286 44358 15331 47095 21924 50828 86357 94588 63119 36732 13716 13299 69053 88681 22490 83187 46105 58005 44854 19504 77773 30566 12881 31547 22259 2556 69204 83912 27536 53508 57531 99377 70810 18704 56023 11425 48028 74575 48652 ...
output:
3
result:
ok single line: '3'
Test #121:
score: 0
Accepted
time: 3ms
memory: 7052kb
input:
500 200 100000 1022 51210 29895 47533 1567 28660 17248 37532 10984 39124 98934 79361 2903 84649 16345 27247 88117 56057 75915 56510 65593 24058 71653 48910 45544 32862 66753 38616 79009 36462 8012 17231 87387 66533 16884 87605 89665 7984 41873 89615 58095 97513 24410 52408 57626 6299 65515 34373 466...
output:
3
result:
ok single line: '3'
Test #122:
score: 0
Accepted
time: 0ms
memory: 7008kb
input:
500 200 100000 94579 70516 68759 66276 22217 62401 60329 73473 42401 7009 85926 44254 9139 57923 276 45020 12254 90138 71000 92616 74290 75645 53530 8961 98002 74527 42471 21000 22248 11188 30304 48491 37241 419 9238 8815 62465 68900 7395 952 96191 35239 26894 92529 38504 9815 58660 20894 14013 7941...
output:
3
result:
ok single line: '3'
Test #123:
score: 0
Accepted
time: 12ms
memory: 10616kb
input:
500 200 100000 71796 14149 79333 83925 12530 4023 79297 46165 45526 6894 61941 64441 8528 15899 24427 36595 51537 83254 49691 65732 27629 4698 1199 6740 74748 99380 59834 36846 62462 60719 38912 22409 32274 13426 46037 86438 69476 15975 85612 85683 57453 95683 31760 70254 43885 35703 60665 9725 1864...
output:
-1
result:
ok single line: '-1'
Test #124:
score: 0
Accepted
time: 15ms
memory: 10552kb
input:
500 200 100000 30783 11364 61305 4909 6266 43964 85346 28355 8586 95727 25902 46135 60153 79263 2273 67293 83426 30069 67934 31366 79846 11508 82080 80899 26614 49835 26592 41494 5619 20466 22022 74141 54592 6353 96501 15890 48599 21733 29161 35627 14648 21912 68012 28335 64872 40937 89203 91465 906...
output:
-1
result:
ok single line: '-1'
Test #125:
score: 0
Accepted
time: 12ms
memory: 10572kb
input:
500 200 100000 25170 42431 45482 9467 88237 3055 55986 93772 67506 47572 55402 35411 96665 27285 65743 56320 80544 26053 62862 62185 16934 81240 54180 64034 3682 67090 48136 69180 29554 34502 40069 58044 23443 9300 69862 13701 46385 13240 98671 58204 40736 47499 19605 59991 91805 87227 26241 26420 4...
output:
-1
result:
ok single line: '-1'
Test #126:
score: 0
Accepted
time: 2ms
memory: 6848kb
input:
489 124 3 0 2 2 0 2 2 2 2 0 1 2 2 0 0 1 1 1 1 1 0 2 2 0 0 1 1 1 0 2 0 1 2 0 1 1 1 0 0 1 1 2 1 1 0 1 0 2 2 2 0 2 0 0 2 2 0 2 0 1 1 1 2 2 2 2 0 1 1 2 2 1 2 2 1 1 1 1 1 2 1 1 1 1 2 1 1 2 0 1 1 1 2 0 1 2 2 1 2 1 1 0 2 0 0 2 2 0 0 0 2 2 2 2 0 0 2 2 0 1 0 2 1 2 1 1 1 1 0 0 2 1 0 0 1 0 0 2 0 0 2 1 0 0 1 2 ...
output:
4
result:
ok single line: '4'
Test #127:
score: 0
Accepted
time: 0ms
memory: 6796kb
input:
497 71 4 3 1 1 0 0 3 0 0 0 1 0 3 0 0 3 3 0 3 3 0 0 0 3 2 0 0 2 0 3 2 1 2 1 2 1 0 3 1 3 1 1 3 2 0 1 2 1 3 3 3 1 0 2 1 3 0 1 0 1 0 1 3 0 3 0 1 1 3 2 2 2 1 3 2 0 0 0 0 2 0 2 2 0 3 1 3 0 1 3 2 1 0 3 2 0 1 2 1 0 3 3 3 1 1 2 0 0 2 0 2 0 1 2 2 1 0 1 1 0 3 1 0 3 3 2 1 3 2 1 3 1 2 0 0 0 1 0 3 2 1 0 3 3 1 0 1...
output:
7
result:
ok single line: '7'
Test #128:
score: 0
Accepted
time: 2ms
memory: 6840kb
input:
449 118 5 3 4 4 1 1 1 2 0 0 0 4 4 0 4 2 4 3 3 3 4 4 4 0 4 1 3 4 1 1 2 1 4 0 3 1 3 0 3 4 2 2 2 0 0 4 0 3 4 3 2 1 0 2 0 1 4 1 2 2 3 0 4 1 4 4 4 1 2 1 0 2 1 2 1 1 0 1 3 3 3 1 1 4 0 4 3 4 3 3 3 3 2 2 0 4 1 3 4 3 1 3 2 3 1 3 0 3 1 3 2 4 4 1 1 3 1 1 3 3 4 3 1 1 4 0 0 4 4 0 2 0 4 3 1 3 1 0 3 0 3 4 1 1 1 0 ...
output:
4
result:
ok single line: '4'
Test #129:
score: 0
Accepted
time: 0ms
memory: 7052kb
input:
433 184 84762 27449 50348 60300 10054 16512 68749 31488 23084 84407 16971 22458 45407 76450 43615 51405 13012 42473 70672 3212 23694 63340 56010 16738 36215 69538 57017 18580 44222 59692 48069 49202 17551 21743 82109 14629 53088 47499 28970 46641 38229 16225 61023 38746 76050 5966 15368 58266 32255 ...
output:
3
result:
ok single line: '3'
Test #130:
score: 0
Accepted
time: 3ms
memory: 6976kb
input:
420 152 69616 39566 53855 4910 68189 9130 22340 10865 54824 63491 47317 15052 34694 35830 37635 59263 3572 1209 16082 57108 61506 33963 20584 1140 65861 26553 69423 9666 68313 66113 22601 21962 46770 716 53939 44800 57586 62245 31635 16483 28105 56886 55206 64290 39153 67730 19829 14930 53842 41493 ...
output:
3
result:
ok single line: '3'
Test #131:
score: 0
Accepted
time: 3ms
memory: 6988kb
input:
390 77 60403 60001 19934 38286 47054 47918 56246 31348 19132 44862 16426 39725 48962 46373 15011 38871 58022 19555 119 31147 17701 56691 24898 39946 26654 5841 5878 33136 567 21059 28551 44378 26099 22296 2410 26418 49887 30383 59589 3328 32444 8053 45110 51170 30353 45202 17244 6000 3192 33064 3365...
output:
6
result:
ok single line: '6'
Test #132:
score: 0
Accepted
time: 0ms
memory: 6976kb
input:
382 16 70210 65084 25931 15009 11892 56975 22132 60337 28425 39652 7675 5434 66985 1079 43669 24282 53238 47984 8537 13866 24222 30323 41221 6107 67097 52381 14696 38981 4542 12259 919 17 58790 6407 59961 17582 38400 64001 29965 10611 48705 42155 10736 39238 32268 27943 42072 35135 53428 47666 60749...
output:
24
result:
ok single line: '24'
Subtask #7:
score: 0
Accepted
Test #133:
score: 0
Accepted
time: 0ms
memory: 7004kb
input:
19884 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
9942
result:
ok single line: '9942'
Test #134:
score: 0
Accepted
time: 4ms
memory: 7992kb
input:
10844 693 69989 3766 7738 34207 10943 7719 63191 50098 8090 44613 31296 6069 21422 31348 9369 60012 35886 67356 63574 78 10086 10641 5445 12976 28314 31058 40047 44847 25293 48140 43030 38832 53510 46139 54738 13191 2305 39259 42361 55795 42283 27940 14768 17603 69488 65873 1095 16615 28281 40333 40...
output:
16
result:
ok single line: '16'
Test #135:
score: 0
Accepted
time: 10ms
memory: 8128kb
input:
12598 91 90004 66698 27721 2800 22239 28479 72252 22341 17276 61776 82210 21916 46700 27407 59536 12941 67282 17211 223 40707 81803 35170 1668 14041 39273 58529 4050 64799 89699 66102 84525 76395 8529 86318 42358 27129 11860 81979 23116 44186 44029 52105 61890 39191 22363 13100 79115 61524 46187 199...
output:
139
result:
ok single line: '139'
Test #136:
score: 0
Accepted
time: 8ms
memory: 7836kb
input:
14314 1500 95533 39071 79806 52841 9044 39539 77263 38128 48536 8625 31329 19594 16415 80198 95329 6252 62455 69025 65800 64028 31077 23365 5752 60050 94624 65602 57373 69813 65099 35328 18771 80612 14065 20282 68437 4668 31186 20966 77917 89396 55814 22566 75633 43564 45600 6576 77620 30764 51550 3...
output:
10
result:
ok single line: '10'
Test #137:
score: 0
Accepted
time: 14ms
memory: 9364kb
input:
11818 1965 63190 25212 20879 37791 17788 44358 31560 13378 33025 61479 46049 17651 57882 44060 26646 61895 36028 31668 41669 26342 52915 61292 41525 23968 50561 48582 20035 18273 57437 40136 45434 105 60555 22392 45078 19439 53095 54626 48957 20970 37846 5751 20694 18388 54365 33631 45708 24239 1874...
output:
-1
result:
ok single line: '-1'
Test #138:
score: 0
Accepted
time: 2ms
memory: 7108kb
input:
11818 1965 11818 2874 9224 10094 4582 9056 3944 2199 3948 11715 4851 6654 5613 1060 1976 7524 7671 11358 8739 11579 1419 10506 6380 1214 7849 4503 1933 7669 9320 9641 6895 3748 8968 3324 4452 8440 10185 10333 2093 7304 9886 7747 6797 3184 138 5180 3929 8463 3272 9359 1176 10601 4448 8285 7303 3072 5...
output:
7
result:
ok single line: '7'
Test #139:
score: 0
Accepted
time: 8ms
memory: 9396kb
input:
11455 566 56803 56784 36686 4995 30664 9770 6227 8904 23263 2884 20177 34564 23823 23997 42131 37416 937 18216 34382 22737 51333 30984 10780 49336 53269 33063 648 5027 33611 4638 27047 5338 29153 39990 6450 13752 53443 8958 42451 16607 28151 3960 45871 41372 19449 44732 6025 26821 6706 18934 12519 1...
output:
-1
result:
ok single line: '-1'
Test #140:
score: 0
Accepted
time: 2ms
memory: 7256kb
input:
11455 566 11455 2097 4627 3364 1578 2594 8714 11363 4514 4076 5862 3078 4737 4325 9945 8322 5011 780 5269 216 5909 10161 8287 9216 8886 7715 3565 10020 5052 6678 9686 1868 4234 1086 2345 7335 8315 5268 2237 9731 2305 1549 6036 608 2881 5892 2527 10037 2573 2910 5318 10663 9449 7036 9240 10272 121 42...
output:
21
result:
ok single line: '21'
Test #141:
score: 0
Accepted
time: 10ms
memory: 9936kb
input:
18693 156 78986 11374 72723 35208 65510 45318 12953 40883 50374 14854 25915 43695 9172 8660 72272 34811 41394 56574 36769 19320 63199 67067 35284 9804 5050 37303 47128 21350 52526 15499 38558 28449 27482 62888 59642 11555 8497 21277 68204 71347 47604 36714 5295 5581 16013 29059 45565 30850 8380 2532...
output:
-1
result:
ok single line: '-1'
Test #142:
score: 0
Accepted
time: 5ms
memory: 7492kb
input:
18693 156 18693 3972 2310 1874 17766 5939 16469 17313 12634 5947 5325 12355 5025 13757 7230 14699 5071 14564 13876 630 13794 6595 8698 7029 13184 6473 3276 13465 5734 14688 12201 10639 3178 8694 4148 15303 2092 14736 13976 18178 7702 9848 2290 8074 14147 12622 12913 5295 14511 11985 15191 16200 7626...
output:
120
result:
ok single line: '120'
Test #143:
score: 0
Accepted
time: 2ms
memory: 7644kb
input:
15499 17 57247 24498 51123 50164 38937 14898 37188 2186 26400 29255 11619 47742 54342 7075 55387 39544 54980 33200 8718 40126 19827 2763 45157 20146 32099 9689 15562 37064 39162 18368 19556 6267 52507 51185 42311 53295 7953 3835 38680 4802 23768 17981 8809 37373 38561 4720 12283 36627 26272 23866 17...
output:
1273
result:
ok single line: '1273'
Test #144:
score: 0
Accepted
time: 21ms
memory: 6996kb
input:
14505 618 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
24
result:
ok single line: '24'
Test #145:
score: 0
Accepted
time: 7ms
memory: 7860kb
input:
18531 534 81103 48443 38248 34799 56299 74672 37104 46386 51931 18210 21430 75380 58203 30375 18035 76096 14421 72620 65702 67627 29804 51337 63140 46563 7753 9474 79098 50156 27471 72558 8747 22312 28986 36887 60772 39184 58875 74125 74002 76385 61727 66024 13100 77951 66869 35849 43316 19030 76715...
output:
54
result:
ok single line: '54'
Test #146:
score: 0
Accepted
time: 5ms
memory: 7512kb
input:
13509 133 75663 41492 36207 56526 73782 27226 34180 63836 13867 30545 8800 47349 19253 59844 48900 59275 1172 10534 71218 63560 35641 12302 57706 53701 26234 8959 70 72833 25902 67975 28516 22764 16374 24302 34608 9434 24199 44701 54935 24249 12264 60120 64019 27205 6093 57092 42582 55708 27322 5298...
output:
151
result:
ok single line: '151'
Test #147:
score: 0
Accepted
time: 0ms
memory: 7608kb
input:
14018 192 53798 46528 41829 5275 7541 37813 6082 12945 49858 7657 23016 45637 34561 36189 19026 42920 52902 40379 1463 29097 30399 2266 2606 17248 23933 39050 15144 8333 19526 10920 36919 46310 10031 39289 26282 8007 22220 30710 3830 12550 17258 6256 32026 34961 47030 3378 22053 42621 35599 8582 157...
output:
112
result:
ok single line: '112'
Test #148:
score: 0
Accepted
time: 3ms
memory: 7000kb
input:
20000 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
10000
result:
ok single line: '10000'
Test #149:
score: 0
Accepted
time: 33ms
memory: 7060kb
input:
20000 632 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
32
result:
ok single line: '32'
Test #150:
score: 0
Accepted
time: 20ms
memory: 7128kb
input:
20000 801 2 1 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 ...
output:
-1
result:
ok single line: '-1'
Test #151:
score: 0
Accepted
time: 20ms
memory: 7088kb
input:
20000 905 3 0 2 0 0 1 1 0 2 1 0 1 0 1 2 1 2 1 2 2 2 2 1 2 1 2 2 1 2 1 2 1 2 0 0 2 0 0 2 1 1 0 2 0 2 0 2 2 1 2 0 2 2 1 1 2 2 1 0 2 1 1 1 2 1 2 0 1 1 2 2 1 1 0 0 0 1 0 2 1 2 2 0 2 0 1 1 1 2 1 1 1 0 1 0 2 0 0 1 2 0 2 0 0 1 1 0 0 2 1 1 1 2 2 0 2 0 0 0 0 1 1 2 1 0 2 1 0 2 1 0 1 2 1 2 0 0 1 0 2 2 0 2 0 2 ...
output:
-1
result:
ok single line: '-1'
Test #152:
score: 0
Accepted
time: 23ms
memory: 7128kb
input:
20000 988 4 2 3 0 2 3 2 2 1 2 3 2 1 3 1 2 3 0 1 3 3 1 1 3 1 0 1 3 3 0 3 2 0 0 1 1 0 2 0 0 2 2 2 0 3 1 3 0 3 3 3 1 0 0 2 3 0 1 0 2 2 0 3 3 1 2 1 0 2 2 1 0 2 1 2 3 0 2 3 1 2 0 2 0 2 3 3 0 1 3 1 1 3 0 2 0 2 3 2 1 0 2 3 2 0 0 0 3 3 3 0 1 2 1 2 1 2 0 3 3 0 3 3 3 2 0 3 3 3 0 1 2 2 1 1 0 2 2 2 0 0 1 2 3 3 ...
output:
-1
result:
ok single line: '-1'
Test #153:
score: 0
Accepted
time: 16ms
memory: 7076kb
input:
20000 1063 5 3 4 4 3 3 4 0 4 0 3 0 2 0 3 0 4 4 3 2 1 0 1 4 4 2 4 4 0 2 2 2 2 3 4 4 3 3 4 2 3 3 1 3 1 2 3 2 1 4 1 4 4 3 0 2 1 4 4 2 2 0 1 2 3 2 3 2 3 3 0 1 0 3 4 4 0 1 2 4 0 4 2 1 3 3 2 1 4 4 3 0 2 0 4 3 0 4 1 1 4 0 4 1 2 3 1 0 3 0 2 3 3 1 3 2 3 1 4 2 1 1 1 2 3 2 4 1 3 1 2 0 1 4 1 1 2 2 4 2 0 0 0 2 1...
output:
-1
result:
ok single line: '-1'
Test #154:
score: 0
Accepted
time: 6ms
memory: 8332kb
input:
20000 2000 100000 58089 84599 26664 74493 70970 19747 76279 31930 21778 2356 16794 67718 88886 69243 46673 79730 27251 78700 83788 63063 82600 76889 64719 96453 87847 21814 53420 94224 13680 2071 85436 61087 44616 27912 34435 82059 2963 67575 6441 38608 10963 53714 73833 16141 52309 75584 15587 4132...
output:
10
result:
ok single line: '10'
Test #155:
score: 0
Accepted
time: 14ms
memory: 7028kb
input:
12290 643 2 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 1 0 1 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 0 1 1 1 0 0 0 1 0 ...
output:
-1
result:
ok single line: '-1'
Test #156:
score: 0
Accepted
time: 9ms
memory: 8452kb
input:
20000 2000 100000 11776 4233 24656 81621 67520 72243 11572 75655 41730 71496 21548 35220 83010 30336 6449 46173 65781 15857 71218 27177 95921 41934 12129 78827 68705 92132 94165 63913 45672 27788 99091 59225 96990 14663 53827 33177 18181 52680 77494 20667 11215 33812 48251 90684 76454 86011 33505 65...
output:
10
result:
ok single line: '10'
Test #157:
score: 0
Accepted
time: 12ms
memory: 8360kb
input:
20000 2000 100000 69633 84128 40720 97759 1803 58657 51164 83394 89200 86810 69256 8043 35163 83609 40016 59402 66347 84815 33478 25339 66029 93846 72848 34214 81374 48186 87361 6597 19919 6540 76104 57049 87114 27528 10703 60209 91221 51945 34131 99152 73871 42557 39144 64775 78156 62649 62344 3257...
output:
10
result:
ok single line: '10'
Test #158:
score: 0
Accepted
time: 12ms
memory: 8400kb
input:
20000 2000 100000 43901 16538 8387 54247 66550 15138 94309 48124 77910 80571 24571 3369 91651 33999 27817 67464 16679 68808 76990 32975 2964 15268 91496 1629 39013 1087 56845 24308 3155 2034 60165 52975 54330 96507 19110 86333 46841 44688 73337 37080 19433 4290 83307 59218 33711 47562 68455 41485 98...
output:
10
result:
ok single line: '10'
Test #159:
score: 0
Accepted
time: 8ms
memory: 8388kb
input:
20000 2000 100000 39464 8493 98393 64155 18957 13375 59225 59927 99600 94029 77822 55582 6316 15380 31475 26422 4557 1123 88648 75639 60775 7037 77595 3206 58859 85692 86194 63798 35799 94902 6934 81219 95604 24835 36284 80597 43416 81754 44866 83854 41897 5809 15627 83550 43227 46648 2450 41826 618...
output:
10
result:
ok single line: '10'
Test #160:
score: 0
Accepted
time: 12ms
memory: 8416kb
input:
20000 2000 100000 97921 87939 69296 4056 11718 50038 1207 5529 17961 54650 50055 77031 38562 98039 80099 78268 35644 83157 88670 35271 62097 69098 28242 747 73672 52910 21579 43004 37232 15715 46492 57615 85360 32138 65717 1411 80086 78670 20051 58144 73904 56848 75961 88334 12435 82022 63470 35430 ...
output:
10
result:
ok single line: '10'
Test #161:
score: 0
Accepted
time: 21ms
memory: 10856kb
input:
20000 2000 100000 16589 538 88329 92878 23369 96808 29521 67849 98797 12507 83647 23822 13309 55415 60863 53677 10251 56945 97792 25739 65019 80012 68186 72128 80575 69994 71051 873 31778 95414 77389 44787 23244 83088 98418 11227 49565 42039 61033 36281 32449 88088 66305 49214 95874 79670 8289 94632...
output:
-1
result:
ok single line: '-1'
Test #162:
score: 0
Accepted
time: 6ms
memory: 7664kb
input:
20000 2000 20000 1968 13552 1836 18018 19391 1832 9915 19104 13710 7494 5483 16116 914 1645 6288 16406 10648 19893 3730 6942 2632 14918 20 13843 5541 7342 4680 14952 15903 5651 6981 18392 5052 2296 6988 8144 19466 4168 8080 1172 276 16326 7687 4714 7688 4592 8017 8895 17828 14020 12153 12771 884 698...
output:
10
result:
ok single line: '10'
Test #163:
score: 0
Accepted
time: 17ms
memory: 10844kb
input:
20000 2000 100000 65079 66944 3104 46806 48811 97185 91598 82547 4189 56813 14927 17577 14659 52410 35526 6957 24630 97793 48472 47758 57264 25895 41347 62700 49761 60022 53635 26453 29464 41936 95389 18298 12404 40548 64902 40070 11529 40466 42323 98819 73738 91116 35346 1432 68640 14199 91866 5844...
output:
-1
result:
ok single line: '-1'
Test #164:
score: 0
Accepted
time: 6ms
memory: 7660kb
input:
20000 2000 20000 17286 16372 10938 16663 1677 17371 15408 7918 6624 12933 971 740 16433 6305 19715 5277 1514 1304 17508 6002 8231 13761 7829 178 414 12496 12427 68 5433 11421 1054 581 17362 2914 233 14410 7956 2301 12384 18838 6400 4971 5554 14642 11986 1732 9245 17278 8486 1673 14915 199 15012 1095...
output:
10
result:
ok single line: '10'
Test #165:
score: 0
Accepted
time: 21ms
memory: 10924kb
input:
20000 2000 100000 53059 8548 82382 3309 52045 51813 84612 87778 14351 23081 99168 68437 15713 88623 87418 63146 21643 93020 20843 15085 7838 59821 17885 97604 1540 62952 6661 92927 58717 91378 67284 85985 55552 7885 57713 45356 93369 1934 42142 36469 41028 94297 93004 9888 20320 72596 70738 14475 68...
output:
-1
result:
ok single line: '-1'
Test #166:
score: 0
Accepted
time: 11ms
memory: 7088kb
input:
11523 675 3 2 0 1 1 1 0 2 2 1 2 0 2 2 0 2 0 2 2 0 0 0 0 0 1 0 0 0 2 2 1 2 1 0 0 0 2 1 2 2 1 0 0 2 2 1 2 2 0 2 1 2 2 1 1 0 1 2 2 0 0 0 1 1 0 0 2 0 0 0 2 0 2 1 2 0 0 2 1 1 0 1 1 0 1 2 0 1 2 0 0 0 1 0 0 2 1 0 2 1 0 2 2 2 0 2 0 2 2 2 1 1 1 1 2 0 1 0 0 2 0 1 0 2 0 1 1 0 1 2 2 1 1 2 2 1 1 0 0 1 2 2 1 1 0 ...
output:
-1
result:
ok single line: '-1'
Test #167:
score: 0
Accepted
time: 6ms
memory: 7668kb
input:
20000 2000 20000 16077 3233 13303 8690 17450 11236 16334 17871 2087 13310 16730 16554 5994 12549 9178 5710 9308 14468 18632 10394 2306 4387 14744 6433 15394 9241 5959 296 12512 7313 4471 572 10961 5886 15624 11529 2102 13552 11769 16953 16641 5400 16370 6336 11188 13234 17503 9003 19965 1801 14112 1...
output:
10
result:
ok single line: '10'
Test #168:
score: 0
Accepted
time: 7ms
memory: 8032kb
input:
20000 2000 100000 11628 64692 6830 51019 91616 80824 80830 91596 57453 9335 45600 71086 1688 24842 72958 33344 25085 79826 76740 54123 1804 55817 78075 38693 21642 64878 10421 5816 23844 5815 42525 11107 84654 79909 92710 67832 14538 42036 70752 26923 14693 55743 93327 23594 30651 78571 46025 5278 1...
output:
15
result:
ok single line: '15'
Test #169:
score: 0
Accepted
time: 3ms
memory: 7888kb
input:
20000 1000 100000 43823 40537 58948 72748 70134 62911 27059 21211 59010 99792 6138 65609 50922 13377 69573 86483 6541 46394 91027 65042 91300 44591 32863 51595 71195 83015 33134 50470 15772 80529 28650 16961 69373 77554 85736 41609 15983 15677 19320 23371 90467 3907 51801 36883 12050 90121 86095 999...
output:
30
result:
ok single line: '30'
Test #170:
score: 0
Accepted
time: 0ms
memory: 7884kb
input:
20000 666 100000 66511 69784 27516 35694 33098 92078 56326 74340 87530 6552 16968 10150 25473 47178 18399 2315 85014 57635 58840 21404 1710 60341 70748 31224 18139 50920 97979 49721 60901 76439 72425 87943 76179 88206 29305 994 30461 18508 33708 65404 94513 36707 80813 8758 74778 75039 83440 8065 90...
output:
44
result:
ok single line: '44'
Test #171:
score: 0
Accepted
time: 7ms
memory: 7856kb
input:
20000 500 100000 25429 83209 60762 62734 96210 84325 53152 89433 79343 73375 96332 98334 98649 65930 89060 13139 23049 60516 72878 27 32714 80735 33804 84045 82813 14764 13069 21848 53666 34332 90264 26628 61873 24717 75184 65287 10382 90009 35757 76783 96628 62457 26625 35465 61417 5861 84721 80606...
output:
57
result:
ok single line: '57'
Test #172:
score: 0
Accepted
time: 12ms
memory: 7032kb
input:
15383 730 4 0 0 3 1 3 2 3 0 3 1 3 1 0 2 1 0 2 1 2 2 3 2 0 3 2 0 2 2 3 3 0 2 2 0 0 2 0 3 0 1 2 3 0 3 0 1 3 3 3 3 3 3 2 1 2 3 1 3 1 1 2 0 0 3 2 2 3 2 0 3 3 3 0 0 1 3 3 2 2 3 0 2 3 0 0 2 1 3 1 1 3 1 1 2 2 3 0 3 1 3 3 3 3 2 0 3 1 2 0 2 1 3 0 1 3 2 0 1 0 3 2 1 0 0 1 0 3 2 0 3 0 1 1 2 1 1 1 2 1 0 2 3 3 0 ...
output:
-1
result:
ok single line: '-1'
Test #173:
score: 0
Accepted
time: 6ms
memory: 7084kb
input:
10781 949 5 4 2 3 1 3 2 3 3 4 1 4 2 0 0 1 1 2 3 2 1 4 4 4 2 2 0 1 3 1 4 0 4 1 1 1 0 1 4 2 3 2 0 3 2 3 1 4 3 0 3 3 2 2 2 1 3 2 3 4 4 2 3 0 2 3 3 1 1 3 3 0 3 2 0 3 3 4 0 2 1 3 2 2 1 4 2 1 0 2 2 2 0 2 2 2 4 3 4 0 3 1 3 1 0 4 0 4 2 3 4 4 2 0 0 2 0 3 2 0 0 4 1 4 1 0 4 2 4 0 2 0 4 4 3 1 2 4 0 0 1 0 3 2 3 ...
output:
-1
result:
ok single line: '-1'
Test #174:
score: 0
Accepted
time: 6ms
memory: 8184kb
input:
11066 998 98096 57169 59594 46425 61518 61030 75272 7464 4050 46188 77965 29046 83756 91712 89717 33704 53033 77637 25179 58049 74421 74830 41208 13515 22327 64164 10269 44343 55803 9056 3079 68270 19022 64772 62397 36527 79224 20395 30166 86109 96077 9936 78068 89949 24619 91639 61791 14755 59320 3...
output:
12
result:
ok single line: '12'
Test #175:
score: 0
Accepted
time: 8ms
memory: 8040kb
input:
10046 69 88746 5238 30282 88165 24351 23675 43721 35331 88454 71031 50576 12381 68049 23572 50274 10710 44165 46959 6482 33174 7704 42302 45874 60865 63440 18503 5503 21012 84936 59842 2776 11851 45266 80142 970 22672 73900 41231 9717 12433 33817 28070 33792 73615 46576 32434 64524 25663 78673 52849...
output:
146
result:
ok single line: '146'
Test #176:
score: 0
Accepted
time: 5ms
memory: 8152kb
input:
18173 727 93435 85773 12388 85169 8544 33883 3937 14407 1417 41046 43660 67094 41760 68572 50505 44775 75704 76599 583 78090 53674 46018 37230 35612 663 84710 55209 68584 20680 4843 1220 71084 8442 21502 30104 58956 67917 22885 12898 90481 83767 82282 23745 25793 11441 45782 73146 37860 80752 55780 ...
output:
25
result:
ok single line: '25'
Subtask #8:
score: 0
Accepted
Test #177:
score: 0
Accepted
time: 5ms
memory: 7224kb
input:
61996 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
30998
result:
ok single line: '30998'
Test #178:
score: 0
Accepted
time: 17ms
memory: 9932kb
input:
87876 2989 71762 53635 24079 57065 51620 70154 4829 13478 16596 14257 55746 53704 3473 6466 23882 51283 47191 18163 67215 41064 603 49192 34095 31720 11184 27097 71045 24639 2664 20626 58121 48010 58327 1547 7428 40828 8905 70496 14578 54766 63322 23574 13046 20344 6575 50096 67702 58252 55381 31165...
output:
-1
result:
ok single line: '-1'
Test #179:
score: 0
Accepted
time: 21ms
memory: 9756kb
input:
87876 2989 87876 62743 62203 33997 63687 18486 45286 57026 19105 36544 55032 58822 70774 47052 11655 80991 14353 7766 61584 2262 29872 29562 57929 63493 13364 63274 14687 86420 18091 77640 58630 55640 51924 26287 35843 68848 17806 7498 67866 18479 65605 62877 36468 58399 84057 52804 29611 2893 32176...
output:
30
result:
ok single line: '30'
Test #180:
score: 0
Accepted
time: 25ms
memory: 10996kb
input:
77644 17631 52657 25129 8216 45827 18160 28122 33477 40336 2432 41573 5066 22901 42147 30420 46173 7678 3952 25160 23220 13886 30181 31258 36257 39028 45910 25762 4765 44431 26210 2482 3295 36042 20206 14952 19610 32232 13802 19440 14812 22224 50799 35278 27619 668 43012 2056 27957 37234 20225 33883...
output:
-1
result:
ok single line: '-1'
Test #181:
score: 0
Accepted
time: 13ms
memory: 10784kb
input:
77644 17658 77644 32290 19326 29244 75551 19377 68685 69291 15139 64602 67314 61386 31145 4060 17458 69082 69422 43561 20545 5970 42704 30464 15249 71897 49149 68969 15750 19838 29242 14540 50593 65990 39676 69047 42505 34044 76842 9612 77405 41983 19577 43564 31157 56700 75144 51576 37332 13335 283...
output:
5
result:
ok single line: '5'
Test #182:
score: 0
Accepted
time: 13ms
memory: 9452kb
input:
66125 771 70249 67669 43954 63746 34029 34502 64884 67693 18188 64656 51747 25715 5869 26720 35516 21681 42823 52247 9538 49604 19430 9894 50629 68611 63417 11876 12272 20654 49713 59651 27566 52967 30683 55234 4737 4554 27187 48201 52299 67149 22315 36597 24262 40885 34837 63838 2295 39813 32660 18...
output:
-1
result:
ok single line: '-1'
Test #183:
score: 0
Accepted
time: 16ms
memory: 9028kb
input:
66125 771 66125 63536 35516 60777 36969 37923 26195 23851 6978 64211 51860 56946 9356 1204 34798 66057 41866 3565 27110 11027 16729 59219 47532 24888 64210 5764 9435 18080 19690 56737 28892 27116 65804 62755 18805 27428 43723 30053 64765 7996 47715 26346 53657 31443 9362 47372 21438 41445 31731 3256...
output:
86
result:
ok single line: '86'
Test #184:
score: 0
Accepted
time: 3ms
memory: 7324kb
input:
100000 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
50000
result:
ok single line: '50000'
Test #185:
score: 0
Accepted
time: 158ms
memory: 7280kb
input:
100000 632 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
159
result:
ok single line: '159'
Test #186:
score: 0
Accepted
time: 129ms
memory: 7320kb
input:
100000 887 2 0 0 0 0 1 0 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 0 1 0 0 0 0 1 0 1 1 1 1 0 1 1 1 0 1 0 1 0 0 0 1 0 0 1 1 1 0 1 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 0 1 1 1 1 1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 0 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 1 1 1 0 1 1...
output:
-1
result:
ok single line: '-1'
Test #187:
score: 0
Accepted
time: 88ms
memory: 7332kb
input:
100000 1091 3 2 0 2 0 0 1 0 0 1 2 2 1 2 0 0 1 2 2 2 0 1 1 2 0 2 2 1 2 0 2 0 2 0 2 1 0 2 2 1 2 0 1 2 0 1 1 0 2 0 1 0 0 0 2 2 2 1 0 2 2 0 0 2 0 2 2 0 1 0 1 2 2 0 2 0 0 2 2 0 2 2 0 2 0 0 1 0 1 1 0 2 0 1 2 0 1 2 0 1 2 2 2 0 0 1 1 2 0 2 0 2 0 2 0 1 1 0 0 2 0 2 2 2 2 2 0 2 1 2 1 1 0 2 1 1 2 2 1 1 0 1 0 0 ...
output:
-1
result:
ok single line: '-1'
Test #188:
score: 0
Accepted
time: 69ms
memory: 7072kb
input:
52023 486 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
108
result:
ok single line: '108'
Test #189:
score: 0
Accepted
time: 78ms
memory: 7380kb
input:
100000 1246 4 3 1 1 1 3 2 3 1 3 2 2 0 1 1 1 2 3 1 1 3 0 0 3 2 1 1 1 3 0 0 3 2 3 2 2 2 2 0 3 3 1 2 3 1 2 1 2 2 1 2 0 0 0 3 2 2 1 3 0 2 1 1 2 0 1 0 0 1 2 1 2 0 3 0 2 2 2 1 1 2 3 3 1 3 0 3 2 0 0 1 2 1 2 3 1 2 3 2 1 1 1 2 0 0 1 3 1 3 2 2 0 3 0 1 1 0 1 0 0 2 2 2 1 3 1 0 0 0 0 1 1 1 0 3 3 2 2 0 0 0 2 0 2 ...
output:
-1
result:
ok single line: '-1'
Test #190:
score: 0
Accepted
time: 65ms
memory: 7468kb
input:
100000 1394 5 0 1 2 2 1 4 2 0 3 2 4 2 4 1 2 4 2 4 1 1 1 4 2 3 2 4 0 2 4 0 2 4 4 3 2 4 2 3 1 3 4 0 1 1 1 2 0 4 0 2 4 2 0 1 0 4 1 4 0 4 0 1 1 4 1 4 1 1 3 2 1 4 1 3 1 0 0 0 0 1 1 3 1 2 1 3 3 4 3 1 0 1 3 1 4 0 3 1 1 1 3 3 4 1 0 1 4 4 0 2 2 4 0 1 3 1 4 1 2 2 0 4 1 4 4 0 4 1 1 3 0 1 4 0 3 4 2 0 0 1 1 3 0 ...
output:
-1
result:
ok single line: '-1'
Test #191:
score: 0
Accepted
time: 35ms
memory: 16656kb
input:
100000 50000 100000 13323 613 75403 52202 79326 10686 61796 83914 59373 30274 76374 98686 62311 53205 55983 30131 84987 86690 45218 14339 71384 99268 31775 73007 15519 57889 38028 85610 72888 90432 3387 13524 54060 36299 81769 30418 21127 49871 31125 38626 45476 90143 33353 96577 57202 41521 19253 9...
output:
2
result:
ok single line: '2'
Test #192:
score: 0
Accepted
time: 31ms
memory: 16668kb
input:
100000 50000 100000 2610 94588 9156 99520 59764 43332 75453 87669 59749 7009 16980 30849 60430 73986 87746 97242 13221 16499 70470 70043 51712 64529 60815 27048 41742 91804 91784 40329 14118 27781 1761 59958 21991 42550 38135 57593 41657 61203 18894 48326 8682 23556 76615 20997 93961 84629 61275 216...
output:
2
result:
ok single line: '2'
Test #193:
score: 0
Accepted
time: 28ms
memory: 16676kb
input:
100000 50000 100000 33365 77502 90674 31735 78182 32685 1886 9606 73166 97797 27926 89597 10399 22147 70864 26813 6857 26355 55220 80346 70097 80298 43185 63096 88799 13841 7599 51860 99327 50942 90307 26937 58010 73717 2210 77408 40427 4616 76884 75082 84623 35131 48703 4252 15118 43065 60424 31820...
output:
2
result:
ok single line: '2'
Test #194:
score: 0
Accepted
time: 27ms
memory: 16656kb
input:
100000 50000 100000 49165 97306 85020 36078 759 75334 22403 24007 4013 5501 53628 38728 98924 40018 79674 26747 36249 45880 41951 47088 26055 34783 73801 32425 68148 47496 65920 75363 57973 18435 58645 72833 51094 3465 6722 39178 46417 64295 98970 45250 76963 15694 73189 98866 93467 20462 51317 1733...
output:
2
result:
ok single line: '2'
Test #195:
score: 0
Accepted
time: 28ms
memory: 16628kb
input:
100000 50000 100000 47321 35427 92717 85098 86268 16873 88393 53550 29631 51690 4321 55513 46277 46141 80218 4808 74712 64228 53019 56105 43231 46575 7750 39834 20016 86393 73595 50175 69572 19098 90109 22590 78722 52274 81736 8365 9397 99515 80266 62344 16082 62994 35586 7262 46372 70066 69992 4077...
output:
2
result:
ok single line: '2'
Test #196:
score: 0
Accepted
time: 35ms
memory: 16752kb
input:
100000 50000 100000 65278 11100 21816 4739 50178 11426 34532 77034 93240 14890 3309 58930 63151 47142 53264 67166 37313 12661 70518 49891 96008 79810 846 47149 59347 15815 26811 79914 67165 16459 14402 24462 27533 66352 46544 1878 4424 93559 30058 76201 72946 75605 22819 95522 24158 42673 68160 1637...
output:
2
result:
ok single line: '2'
Test #197:
score: 0
Accepted
time: 33ms
memory: 15592kb
input:
100000 47829 100000 54972 20156 64234 64973 97450 87466 52810 60723 97207 25720 90626 11711 8061 69717 20244 73535 85892 72160 11040 8948 86602 36073 77091 83141 89964 12813 32911 80467 18460 37680 96413 34279 87205 6745 3877 31612 54435 25784 97119 99130 17176 80824 57917 48171 45461 14644 68314 62...
output:
-1
result:
ok single line: '-1'
Test #198:
score: 0
Accepted
time: 28ms
memory: 15256kb
input:
100000 50000 100000 33195 79122 37314 2471 52290 20500 19369 12123 15835 19111 47570 49249 12884 27291 20599 81087 15399 66697 56249 1769 82669 12272 42300 10944 17809 10688 50061 25638 81338 44327 18698 67154 43189 91394 64088 78014 91810 82201 8822 6684 71338 93538 92912 35493 59653 44856 28021 45...
output:
2
result:
ok single line: '2'
Test #199:
score: 0
Accepted
time: 70ms
memory: 7264kb
input:
75239 738 2 1 1 1 1 0 1 0 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 1 1 1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 0 ...
output:
-1
result:
ok single line: '-1'
Test #200:
score: 0
Accepted
time: 26ms
memory: 15636kb
input:
100000 47815 100000 27184 9510 14347 14506 50899 16687 10039 60494 9414 37642 14791 73220 57330 48677 98182 62315 32518 20889 43654 15518 81451 51978 49325 70256 17752 28220 38902 47521 58915 28245 31410 69109 14042 79490 42840 201 91684 12044 28770 12761 53724 1343 17959 76837 69551 3598 17401 1311...
output:
-1
result:
ok single line: '-1'
Test #201:
score: 0
Accepted
time: 32ms
memory: 15204kb
input:
100000 50000 100000 55904 82201 23805 83389 89690 89390 54467 66020 71754 99942 35101 12551 64518 94718 97939 80275 42345 63457 18746 62664 30424 69613 39272 43952 23675 25064 2811 43484 44554 81448 83061 84143 15390 22764 23092 59245 77473 6833 11848 9690 99320 47358 73350 51815 70711 788 1555 7013...
output:
2
result:
ok single line: '2'
Test #202:
score: 0
Accepted
time: 25ms
memory: 15660kb
input:
100000 47824 100000 55803 87286 14969 46055 68751 73876 44241 35813 16521 89217 55936 12026 51559 49887 57934 44092 83882 73285 92489 22983 79735 25299 83212 51200 59930 27070 19096 84431 74394 76371 99314 91727 42826 91351 15815 99009 55141 5704 3479 24171 82354 88946 84498 34850 93578 44338 69526 ...
output:
-1
result:
ok single line: '-1'
Test #203:
score: 0
Accepted
time: 27ms
memory: 15336kb
input:
100000 50000 100000 32709 47482 38660 55451 7444 25624 55201 24315 90150 52488 44828 39315 21049 31682 99149 16526 23719 1804 24050 71164 72874 26429 19206 92006 2720 13671 78494 85003 36159 66828 59470 49976 91834 8095 78251 7936 85893 14848 78812 31046 82616 20320 52800 97964 58827 94497 77124 847...
output:
2
result:
ok single line: '2'
Test #204:
score: 0
Accepted
time: 33ms
memory: 16580kb
input:
100000 50000 100000 35131 9394 10678 55190 64276 65484 27028 88752 82952 23922 55802 26644 95931 80310 86319 51593 904 15791 48725 74450 66748 10144 77645 56904 65668 90414 76120 94014 67350 92717 64580 67257 95881 35629 250 26218 42626 85636 29170 22233 10220 45745 85048 95152 83864 14039 63331 823...
output:
2
result:
ok single line: '2'
Test #205:
score: 0
Accepted
time: 38ms
memory: 13408kb
input:
100000 25000 100000 1349 4601 9974 19093 76212 48250 91303 11986 22052 15014 95057 58605 98177 30352 88552 38604 62056 75171 60531 71723 80670 42166 60843 28046 46293 46296 14215 3745 30808 6389 57659 70805 51053 2741 46885 74615 4079 4754 54468 32278 11269 38490 19705 24094 96707 67002 19235 9321 7...
output:
6
result:
ok single line: '6'
Test #206:
score: 0
Accepted
time: 28ms
memory: 12920kb
input:
100000 16666 100000 23352 88163 13320 55283 10437 5888 26779 77447 91997 22485 80482 79307 23924 67609 44575 52268 22344 53392 36027 4609 78382 93091 48903 82076 37384 23855 45800 47960 84629 70100 70414 76549 8979 73855 36359 15368 25136 9399 25184 26836 93002 20089 550 11767 36617 28095 83258 507 ...
output:
9
result:
ok single line: '9'
Test #207:
score: 0
Accepted
time: 22ms
memory: 12624kb
input:
100000 12500 100000 4299 96833 21878 8111 71550 37092 73515 6732 83740 71381 25046 58506 87615 31889 32436 66135 69765 3269 85004 95609 35151 39461 32639 37817 4480 86307 25226 79555 23832 34892 70340 47483 5018 15733 87299 16239 95480 94201 91107 73543 50190 18308 71240 45001 93970 65945 87684 2118...
output:
12
result:
ok single line: '12'
Test #208:
score: 0
Accepted
time: 98ms
memory: 7320kb
input:
99087 932 3 1 2 1 2 2 1 1 0 1 2 1 2 1 0 2 1 0 0 1 0 1 2 2 2 1 0 1 0 1 2 0 2 1 0 0 1 0 1 0 1 0 1 1 1 2 1 1 2 2 0 1 1 0 1 0 0 0 2 1 1 2 2 2 1 2 1 1 1 0 1 1 2 0 1 2 0 2 2 0 0 2 1 0 1 0 1 0 1 2 0 1 2 1 0 0 0 0 1 2 2 2 1 1 1 0 2 1 1 0 0 0 2 0 1 1 0 1 2 0 1 0 1 2 0 1 2 1 2 0 0 1 1 2 2 0 2 0 0 2 0 2 0 0 2 ...
output:
-1
result:
ok single line: '-1'
Test #209:
score: 0
Accepted
time: 45ms
memory: 7268kb
input:
65091 1078 4 2 2 2 0 2 0 1 0 3 0 3 0 3 3 3 3 3 1 2 3 0 3 2 3 0 2 1 0 1 0 0 2 1 2 2 0 0 2 1 0 1 3 1 3 1 3 1 1 1 0 3 3 1 2 1 2 1 2 1 1 2 3 1 2 1 2 2 0 3 0 0 0 3 3 1 1 3 2 1 2 1 0 1 0 2 2 2 1 3 2 0 1 3 3 0 0 3 0 3 1 3 1 0 1 2 3 3 0 3 1 1 1 0 3 3 1 1 0 3 2 2 2 1 2 3 1 2 0 0 1 0 2 2 3 1 1 1 3 3 2 3 0 3 1...
output:
-1
result:
ok single line: '-1'
Test #210:
score: 0
Accepted
time: 37ms
memory: 7284kb
input:
62392 1124 5 1 1 3 3 1 0 1 0 4 3 1 3 2 1 2 3 0 1 2 1 2 3 1 2 1 4 4 2 2 3 4 4 2 3 4 1 2 3 0 1 0 2 4 2 4 3 1 2 3 0 3 1 3 1 3 0 2 0 1 4 0 2 3 2 4 2 1 3 1 2 1 4 1 2 4 2 2 3 1 2 4 0 0 1 2 2 4 3 3 0 4 4 0 4 1 3 4 4 2 0 2 2 2 4 3 1 0 0 2 1 1 2 4 4 0 4 2 1 0 1 1 0 1 3 0 3 4 1 0 1 2 3 0 2 0 1 1 4 1 0 0 3 0 1...
output:
-1
result:
ok single line: '-1'
Test #211:
score: 0
Accepted
time: 13ms
memory: 9844kb
input:
51663 5561 58143 56378 36969 30270 23615 23030 4625 41515 19402 45603 34308 51598 50685 32946 38134 34390 3704 15548 47859 22095 7699 12957 50414 37282 7955 30483 30763 11427 29966 55908 30041 55956 42277 15660 21486 35683 57261 54385 4408 21382 42151 6857 26364 52010 53164 55845 50444 30488 27822 3...
output:
10
result:
ok single line: '10'
Test #212:
score: 0
Accepted
time: 19ms
memory: 11164kb
input:
63638 20196 74622 62595 11801 37544 29611 29738 58672 8862 10258 15313 71576 49520 946 3656 60805 35899 24570 43396 2226 64437 61959 11712 32285 17444 64766 34792 33124 59988 47665 7346 71939 69068 61473 44199 25457 56727 30310 59028 15239 42707 14824 3309 48015 45318 38668 57417 70118 6383 72607 39...
output:
4
result:
ok single line: '4'
Test #213:
score: 0
Accepted
time: 18ms
memory: 10472kb
input:
61171 6599 74515 4426 64325 9820 74287 42601 22257 68745 69373 2893 41618 68173 173 44053 30006 66680 58284 64236 8479 69994 15598 47747 26362 11725 7746 72683 15814 5164 64838 27662 42448 33046 71358 34423 25097 48912 14228 40041 44837 43025 66728 63254 31859 45487 73362 38792 21726 66317 23593 432...
output:
10
result:
ok single line: '10'
Subtask #9:
score: 12
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Subtask #10:
score: 15
Accepted
Dependency #1:
100%
Accepted
Dependency #5:
100%
Accepted
Subtask #11:
score: 13
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Subtask #12:
score: 23
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Subtask #13:
score: 37
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Dependency #8:
100%
Accepted
Dependency #9:
100%
Accepted
Dependency #10:
100%
Accepted
Dependency #11:
100%
Accepted
Dependency #12:
100%
Accepted
Extra Test:
score: 0
Extra Test Passed