QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#72981 | #324. Passports | zhanjinghao | 100 ✓ | 660ms | 40600kb | C++14 | 3.1kb | 2023-01-21 12:03:13 | 2023-01-21 12:03:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
typedef long long int li;
const ll MAXN = 5e6 + 51;
struct Item {
ll l, r, t, x;
inline bool operator <(const Item &rhs)const {
return l < rhs.l;
}
inline bool operator >(const Item &rhs)const {
return t < rhs.t;
}
};
Item it[2][5051];
ll n, p, pt, ptt;
ll res[5051][2], prv[MAXN], f[MAXN], s[2];
inline ll read() {
register ll num = 0, neg = 1;
register char ch = getchar();
while (!isdigit(ch) && ch != '-') {
ch = getchar();
}
if (ch == '-') {
neg = -1;
ch = getchar();
}
while (isdigit(ch)) {
num = (num << 3) + (num << 1) + (ch - '0');
ch = getchar();
}
return num * neg;
}
inline void calc(ll x, ll tp) {
ll nxt, nx;
if (f[x] == 0x3f3f3f3f) {
return;
}
while (x) {
res[nx = it[1][nxt = prv[x]].x][0] = tp;
res[nx][1] = f[x] - it[1][nxt].t, x ^= (1 << (nx - 1));
}
}
int main() {
n = read(), p = read(), f[0] = 1;
for (register int i = 1; i <= n; i++) {
it[0][i].l = read(), it[0][i].r = it[0][i].l + read() - 1;
it[0][i].t = read(), it[0][i].x = i, it[1][i] = it[0][i];
}
sort(it[0] + 1, it[0] + n + 1), sort(it[1] + 1, it[1] + n + 1, greater<Item>());
for (register int i = 1; i < (1 << n); i++) {
f[i] = 0x3f3f3f3f;
}
for (register int i = 0; i < (1 << n); i++) {
if (f[i] == 0x3f3f3f3f) {
continue;
}
pt = f[i], s[0] = s[1] = 1;
for (register int j = 1; j <= n; j++) {
if (i & (1 << (it[1][j].x - 1))) {
continue;
}
while (1) {
while (s[0] <= n && it[0][s[0]].r < pt) {
s[0]++;
}
while (s[1] <= n && (it[0][s[1]].l < pt || !(i & (1 << (it[0][s[1]].x - 1))))) {
s[1]++;
}
if (s[0] <= n && it[0][s[0]].l <= pt) {
pt = it[0][s[0]].r + 1;
continue;
}
if (s[1] <= n && pt + it[1][j].t >= it[0][s[1]].l) {
pt = it[0][s[1]].r + 1;
continue;
}
break;
}
if (pt + it[1][j].t < it[1][j].l) {
ptt = i | (1 << (it[1][j].x - 1));
if (f[ptt] > pt + it[1][j].t) {
f[ptt] = pt + it[1][j].t, prv[ptt] = j;
}
}
}
}
if (p == 1) {
calc((1 << n) - 1, 1);
} else {
for (register int i = 0; i < (1 << n); i++) {
if (f[i] != 0x3f3f3f3f && f[(1 << n) - 1 - i] != 0x3f3f3f3f) {
calc(i, 1), calc((1 << n) - 1 - i, 2);
break;
}
}
}
if (!res[1][0]) {
return puts("NO"), 0;
}
puts("YES");
for (register int i = 1; i <= n; i++) {
printf("%d %d\n", res[i][0], res[i][1]);
}
}
詳細信息
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 2ms
memory: 5600kb
input:
1 1 3 1 1
output:
YES 1 1
result:
ok YES
Test #2:
score: 0
Accepted
time: 2ms
memory: 3428kb
input:
1 1 50 1 49
output:
NO
result:
ok NO
Test #3:
score: 0
Accepted
time: 2ms
memory: 5612kb
input:
2 1 5 1 3 10 1 3
output:
YES 1 1 1 6
result:
ok YES
Test #4:
score: 0
Accepted
time: 2ms
memory: 5408kb
input:
2 1 10 1 5 14 1 5
output:
NO
result:
ok NO
Test #5:
score: 0
Accepted
time: 2ms
memory: 5548kb
input:
2 1 33 2 3 52 3 3
output:
YES 1 1 1 4
result:
ok YES
Subtask #2:
score: 8
Accepted
Dependency #1:
100%
Accepted
Test #6:
score: 8
Accepted
time: 2ms
memory: 5564kb
input:
10 1 11 2 3 14 3 3 26 2 3 36 2 3 46 1 3 55 2 3 69 1 3 80 2 3 95 1 3 97 3 3
output:
YES 1 1 1 4 1 7 1 17 1 20 1 28 1 31 1 38 1 41 1 47
result:
ok YES
Test #7:
score: 0
Accepted
time: 2ms
memory: 5456kb
input:
10 1 4 2 4 19 4 4 26 2 4 32 3 4 44 7 4 54 1 4 65 2 4 70 4 4 80 7 4 90 9 4
output:
NO
result:
ok NO
Test #8:
score: 0
Accepted
time: 0ms
memory: 7644kb
input:
1 1 4 1 2
output:
YES 1 1
result:
ok YES
Test #9:
score: 0
Accepted
time: 0ms
memory: 5500kb
input:
2 1 6 2 2 8 3 2
output:
YES 1 1 1 3
result:
ok YES
Test #10:
score: 0
Accepted
time: 2ms
memory: 5800kb
input:
3 1 11 3 3 14 3 3 17 1 3
output:
YES 1 1 1 4 1 7
result:
ok YES
Test #11:
score: 0
Accepted
time: 0ms
memory: 5628kb
input:
4 1 8 2 3 10 3 3 17 4 3 25 4 3
output:
YES 1 1 1 4 1 13 1 21
result:
ok YES
Test #12:
score: 0
Accepted
time: 2ms
memory: 5624kb
input:
5 1 10 2 4 34 2 4 21 4 4 12 4 4 36 2 4
output:
YES 1 1 1 25 1 16 1 5 1 29
result:
ok YES
Test #13:
score: 0
Accepted
time: 2ms
memory: 5608kb
input:
6 1 38 2 4 31 4 4 6 3 4 22 4 4 45 4 4 35 3 4
output:
YES 1 9 1 13 1 1 1 17 1 40 1 26
result:
ok YES
Test #14:
score: 0
Accepted
time: 1ms
memory: 5604kb
input:
7 1 32 1 4 17 2 4 14 3 4 19 4 4 40 3 4 48 1 4 33 2 4
output:
YES 1 23 1 1 1 5 1 9 1 35 1 43 1 27
result:
ok YES
Test #15:
score: 0
Accepted
time: 1ms
memory: 7644kb
input:
8 1 16 4 1 23 2 1 27 3 1 11 2 1 30 1 1 7 4 1 31 1 1 20 3 1
output:
YES 1 1 1 2 1 3 1 4 1 13 1 5 1 25 1 14
result:
ok YES
Test #16:
score: 0
Accepted
time: 0ms
memory: 7900kb
input:
9 1 21 4 1 30 1 1 25 2 1 11 3 1 17 4 1 31 1 1 27 3 1 14 3 1 32 4 1
output:
YES 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9
result:
ok YES
Test #17:
score: 0
Accepted
time: 0ms
memory: 5612kb
input:
10 1 66 1 4 56 4 4 62 4 4 14 2 4 60 1 4 47 1 4 37 4 4 48 3 4 41 1 4 61 1 4
output:
YES 1 1 1 5 1 16 1 9 1 20 1 24 1 28 1 42 1 32 1 51
result:
ok YES
Subtask #3:
score: 7
Accepted
Dependency #2:
100%
Accepted
Test #18:
score: 7
Accepted
time: 1ms
memory: 5480kb
input:
10 2 2 1 1 9 1 1 13 3 1 25 1 1 29 3 1 53 1 1 56 1 1 87 1 1 90 1 1 94 2 1
output:
NO
result:
ok NO
Test #19:
score: 0
Accepted
time: 2ms
memory: 5612kb
input:
10 2 6 1 1 10 1 1 12 1 1 14 1 1 28 9 1 44 3 1 49 9 1 66 3 1 84 1 1 92 1 1
output:
YES 2 1 2 2 2 3 2 4 2 7 2 8 2 15 2 16 2 17 2 18
result:
ok YES
Test #20:
score: 0
Accepted
time: 0ms
memory: 5624kb
input:
1 2 6 3 4
output:
YES 2 1
result:
ok YES
Test #21:
score: 0
Accepted
time: 3ms
memory: 7688kb
input:
2 2 6 2 1 4 2 1
output:
YES 2 1 2 2
result:
ok YES
Test #22:
score: 0
Accepted
time: 2ms
memory: 5624kb
input:
3 2 3 4 1 11 3 1 7 4 1
output:
YES 1 1 2 1 2 2
result:
ok YES
Test #23:
score: 0
Accepted
time: 1ms
memory: 5604kb
input:
4 2 13 3 1 6 4 1 12 1 1 3 3 1
output:
YES 1 1 1 2 2 10 2 1
result:
ok YES
Test #24:
score: 0
Accepted
time: 2ms
memory: 5604kb
input:
5 2 10 4 2 19 2 2 21 1 2 14 2 2 8 2 2
output:
YES 1 1 2 1 2 16 2 3 2 5
result:
ok YES
Test #25:
score: 0
Accepted
time: 1ms
memory: 5608kb
input:
6 2 20 2 2 15 4 2 11 1 2 12 3 2 6 2 2 19 1 2
output:
YES 1 1 1 3 1 5 2 1 2 3 2 8
result:
ok YES
Test #26:
score: 0
Accepted
time: 0ms
memory: 5604kb
input:
7 2 28 3 3 23 2 3 25 3 3 13 3 3 5 4 3 16 3 3 31 4 3
output:
YES 1 1 1 4 2 9 1 9 2 1 2 12 2 19
result:
ok YES
Test #27:
score: 0
Accepted
time: 1ms
memory: 7836kb
input:
8 2 23 1 3 32 1 3 33 4 3 24 4 3 19 4 3 28 4 3 17 2 3 14 3 3
output:
YES 1 1 1 4 1 7 1 10 2 1 2 4 2 7 2 10
result:
ok YES
Test #28:
score: 0
Accepted
time: 2ms
memory: 5644kb
input:
9 2 19 3 3 33 2 3 32 1 3 35 2 3 22 2 3 24 4 3 18 1 3 28 4 3 17 1 3
output:
YES 1 1 1 4 1 7 1 10 2 1 2 4 2 7 2 10 2 13
result:
ok YES
Test #29:
score: 0
Accepted
time: 2ms
memory: 5592kb
input:
10 2 11 2 2 8 3 2 24 4 2 30 4 2 34 3 2 20 4 2 45 4 2 13 4 2 42 3 2 28 2 2
output:
YES 1 1 1 3 1 5 2 1 2 3 2 5 2 37 2 7 2 39 2 17
result:
ok YES
Subtask #4:
score: 12
Accepted
Dependency #2:
100%
Accepted
Test #30:
score: 12
Accepted
time: 6ms
memory: 5856kb
input:
16 1 1 2 1 15 3 1 20 1 3 47 1 1 49 2 3 63 1 2 65 3 1 69 1 3 70 1 3 72 1 2 73 2 2 75 1 2 80 3 3 83 3 3 91 3 2 95 2 3
output:
NO
result:
ok NO
Test #31:
score: 0
Accepted
time: 4ms
memory: 5664kb
input:
16 1 6 4 8 21 6 4 29 1 7 31 8 10 40 1 9 43 2 3 46 2 5 50 2 10 54 1 8 58 1 6 61 1 6 63 6 6 69 1 8 72 4 8 76 5 9 89 1 9
output:
NO
result:
ok NO
Test #32:
score: 0
Accepted
time: 2ms
memory: 5800kb
input:
10 1 44 1 1 41 2 1 35 4 2 33 2 1 30 3 2 43 1 4 45 3 1 39 2 1 15 3 4 18 3 4
output:
YES 1 1 1 2 1 3 1 5 1 21 1 23 1 27 1 28 1 6 1 10
result:
ok YES
Test #33:
score: 0
Accepted
time: 0ms
memory: 5612kb
input:
11 1 63 4 4 54 2 2 19 2 1 39 3 4 51 3 4 37 2 2 59 4 2 25 3 3 56 3 2 33 4 4 16 3 1
output:
YES 1 1 1 5 1 7 1 8 1 42 1 12 1 46 1 21 1 48 1 28 1 14
result:
ok YES
Test #34:
score: 0
Accepted
time: 2ms
memory: 5520kb
input:
12 1 19 3 3 24 3 4 55 1 3 61 4 3 56 2 4 67 3 1 32 4 4 22 2 3 58 3 3 70 4 3 51 4 2 36 2 1
output:
YES 1 1 1 4 1 8 1 27 1 38 1 65 1 11 1 15 1 42 1 45 1 48 1 30
result:
ok YES
Test #35:
score: 0
Accepted
time: 0ms
memory: 5636kb
input:
13 1 67 2 3 59 3 4 44 3 3 55 4 4 54 1 3 28 2 1 30 4 1 65 2 1 47 2 4 25 3 1 49 3 4 62 3 1 52 2 2
output:
YES 1 1 1 4 1 34 1 8 1 37 1 12 1 13 1 14 1 15 1 19 1 20 1 40 1 41
result:
ok YES
Test #36:
score: 0
Accepted
time: 4ms
memory: 5716kb
input:
14 1 32 4 2 47 4 1 46 1 1 57 1 1 37 1 4 38 2 2 36 1 2 41 2 1 43 3 1 31 1 2 40 1 1 53 4 1 17 3 3 51 2 3
output:
YES 1 1 1 3 1 4 1 20 1 5 1 9 1 11 1 21 1 22 1 23 1 25 1 26 1 13 1 27
result:
ok YES
Test #37:
score: 0
Accepted
time: 2ms
memory: 5696kb
input:
15 1 37 1 4 38 2 4 60 2 2 74 2 3 50 3 3 68 2 3 63 3 1 62 1 2 54 2 4 56 4 3 47 3 1 66 2 1 70 4 3 53 1 1 40 4 2
output:
YES 1 1 1 5 1 9 1 11 1 14 1 17 1 20 1 21 1 23 1 27 1 30 1 44 1 31 1 45 1 34
result:
ok YES
Test #38:
score: 0
Accepted
time: 4ms
memory: 5864kb
input:
16 1 45 4 3 52 2 3 25 3 2 49 3 1 75 3 3 70 3 1 65 2 2 54 4 3 42 3 1 60 2 3 69 1 1 67 2 3 62 3 3 58 1 3 73 2 3 59 1 1
output:
YES 1 1 1 4 1 7 1 9 1 10 1 13 1 14 1 16 1 19 1 20 1 23 1 28 1 31 1 34 1 37 1 40
result:
ok YES
Test #39:
score: 0
Accepted
time: 3ms
memory: 5608kb
input:
10 1 88 1 1 91 1 9 89 1 2 85 1 13 86 1 10 87 1 19 84 1 4 29 1 7 90 1 13 92 1 2
output:
YES 1 1 1 2 1 30 1 32 1 11 1 45 1 64 1 21 1 68 1 81
result:
ok YES
Test #40:
score: 0
Accepted
time: 3ms
memory: 5620kb
input:
11 1 85 1 4 91 1 12 36 1 1 82 1 1 83 1 13 88 1 14 86 1 7 89 1 5 87 1 10 84 1 6 90 1 5
output:
YES 1 37 1 1 1 13 1 14 1 15 1 41 1 28 1 55 1 60 1 70 1 76
result:
ok YES
Test #41:
score: 0
Accepted
time: 1ms
memory: 5788kb
input:
12 1 79 1 8 82 2 11 85 1 3 86 1 15 81 1 4 80 1 3 90 1 15 84 1 2 87 1 2 88 1 3 35 1 5 89 1 4
output:
YES 1 36 1 1 1 44 1 12 1 47 1 51 1 54 1 27 1 69 1 71 1 29 1 74
result:
ok YES
Test #42:
score: 0
Accepted
time: 3ms
memory: 5660kb
input:
13 1 75 1 5 81 1 2 41 1 2 77 1 3 89 1 7 76 1 15 88 1 5 83 4 14 78 1 1 80 1 4 82 1 1 87 1 11 79 1 1
output:
YES 1 1 1 6 1 8 1 10 1 13 1 20 1 35 1 42 1 56 1 57 1 61 1 62 1 73
result:
ok YES
Test #43:
score: 0
Accepted
time: 1ms
memory: 5856kb
input:
14 1 76 1 2 80 1 3 77 1 3 78 2 12 87 1 4 85 1 4 74 1 14 88 1 2 86 1 2 82 1 4 83 2 7 81 1 3 75 1 2 19 1 8
output:
YES 1 1 1 3 1 20 1 23 1 6 1 35 1 39 1 53 1 55 1 57 1 61 1 68 1 71 1 10
result:
ok YES
Test #44:
score: 0
Accepted
time: 6ms
memory: 5780kb
input:
15 1 72 4 7 77 1 2 81 1 7 84 1 4 79 1 6 76 1 1 71 1 4 30 1 8 83 1 1 78 1 2 80 1 4 87 1 2 85 1 5 82 1 13 86 1 1
output:
YES 1 1 1 8 1 10 1 17 1 31 1 37 1 38 1 21 1 42 1 43 1 45 1 49 1 51 1 56 1 69
result:
ok YES
Test #45:
score: 0
Accepted
time: 4ms
memory: 5836kb
input:
16 1 85 1 7 86 1 8 76 1 4 81 4 10 74 1 4 80 1 1 44 1 2 77 1 4 69 1 3 78 1 1 75 1 3 72 1 3 73 1 4 79 1 1 71 1 8 70 1 2
output:
YES 1 1 1 8 1 16 1 20 1 30 1 45 1 34 1 36 1 40 1 46 1 47 1 50 1 53 1 57 1 58 1 66
result:
ok YES
Subtask #5:
score: 13
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Test #46:
score: 13
Accepted
time: 9ms
memory: 5860kb
input:
16 2 5 2 3 7 3 1 16 2 1 19 2 1 23 2 1 26 2 2 35 3 1 40 1 2 42 2 2 57 1 3 68 1 2 72 1 1 85 2 3 87 1 2 91 3 3 95 3 1
output:
YES 1 1 2 1 2 2 2 3 2 10 2 4 2 21 2 11 2 13 2 28 2 44 2 38 2 31 2 46 2 48 2 51
result:
ok YES
Test #47:
score: 0
Accepted
time: 5ms
memory: 5564kb
input:
16 2 5 1 7 10 2 4 16 7 3 23 6 4 34 2 10 36 1 2 38 1 6 40 6 4 47 2 2 50 5 10 59 1 3 61 1 1 66 4 7 75 2 8 79 3 3 86 5 6
output:
NO
result:
ok NO
Test #48:
score: 0
Accepted
time: 2ms
memory: 5652kb
input:
10 2 37 5 5 42 4 1 18 3 1 13 5 2 51 1 4 21 5 2 31 5 4 48 3 3 36 1 2 46 2 4
output:
YES 1 1 1 6 1 7 1 8 2 1 2 5 2 12 2 7 2 10 2 26
result:
ok YES
Test #49:
score: 0
Accepted
time: 1ms
memory: 5780kb
input:
11 2 42 2 4 33 3 2 32 1 5 19 3 2 47 1 2 28 2 5 36 5 3 44 3 3 17 2 3 41 1 3 30 2 5
output:
YES 1 1 1 5 1 7 2 1 2 3 1 12 2 5 2 22 2 8 2 25 2 11
result:
ok YES
Test #50:
score: 0
Accepted
time: 2ms
memory: 5520kb
input:
12 2 23 4 2 53 5 5 27 3 3 39 3 5 37 2 5 47 3 3 34 3 1 20 3 2 50 2 5 52 1 1 42 5 3 30 4 3
output:
YES 1 1 1 3 1 8 1 11 1 16 2 1 2 4 2 5 2 7 2 12 2 13 2 16
result:
ok YES
Test #51:
score: 0
Accepted
time: 3ms
memory: 5600kb
input:
13 2 57 5 2 67 2 1 47 5 3 42 2 4 52 4 3 33 4 2 44 3 2 28 4 4 56 1 4 32 1 4 64 3 2 62 2 5 37 5 1
output:
YES 1 1 2 1 1 3 1 6 1 10 2 2 2 4 2 6 2 10 2 14 2 18 2 20 2 25
result:
ok YES
Test #52:
score: 0
Accepted
time: 4ms
memory: 5620kb
input:
14 2 53 2 4 63 5 2 14 3 1 38 5 4 43 5 4 68 4 2 13 1 2 8 1 1 37 1 1 59 1 1 55 4 4 48 5 3 17 3 1 60 3 5
output:
YES 1 1 1 5 2 1 1 7 2 2 2 20 2 9 2 6 2 22 2 23 2 24 2 28 2 11 2 31
result:
ok YES
Test #53:
score: 0
Accepted
time: 6ms
memory: 5752kb
input:
15 2 62 4 5 79 5 3 52 2 2 74 5 1 27 5 5 17 4 4 54 1 5 71 3 2 46 3 5 59 3 4 13 4 2 66 5 3 55 4 3 84 4 1 49 3 4
output:
YES 1 1 1 6 1 9 2 21 1 11 2 1 2 5 2 32 2 26 2 22 2 10 2 34 2 37 2 40 2 41
result:
ok YES
Test #54:
score: 0
Accepted
time: 10ms
memory: 7676kb
input:
16 2 45 2 5 26 2 2 65 1 1 42 3 3 28 4 4 56 3 5 12 4 1 59 5 5 3 1 1 64 1 3 66 2 3 16 2 3 32 5 2 68 5 5 24 2 4 37 5 1
output:
YES 1 1 1 18 2 4 1 20 1 6 1 47 1 10 2 10 2 1 2 47 2 50 2 5 2 8 2 53 2 18 2 22
result:
ok YES
Test #55:
score: 0
Accepted
time: 8ms
memory: 5864kb
input:
16 2 29 1 10 30 1 7 31 1 13 67 1 14 68 1 4 69 1 6 70 1 3 71 1 31 72 1 8 73 1 5 74 1 6 75 1 5 76 1 8 91 1 13 92 1 4 93 1 15
output:
YES 1 1 2 1 1 11 2 32 1 24 2 46 2 8 1 32 2 11 2 19 2 52 2 24 2 58 1 77 1 63 2 77
result:
ok YES
Subtask #6:
score: 15
Accepted
Dependency #4:
100%
Accepted
Test #56:
score: 15
Accepted
time: 33ms
memory: 8680kb
input:
18 1 683279 4194 60575 1912856 79790 90245 2054820 18099 91793 2597751 53188 76115 3419910 25173 20087 4089311 42852 92182 4291765 29314 92781 5916407 32705 9347 6046607 71811 43050 7080934 12651 49598 7373524 42761 19575 7421993 75751 84157 8215487 26851 56063 8725165 94280 56939 8866773 42824 9047...
output:
YES 1 1 1 60576 1 150821 1 242614 1 687473 1 707560 1 318729 1 799742 1 809089 1 852139 1 411510 1 431085 1 901737 1 515242 1 572181 1 957800 1 986870 1 662654
result:
ok YES
Test #57:
score: 0
Accepted
time: 9ms
memory: 9832kb
input:
18 1 307199 431381 606237 786815 7813 100057 937530 309185 335083 1269337 256532 415772 1600505 78439 615377 3439131 40341 56311 3843522 159751 915475 4250619 149907 406249 4403022 181218 203333 4938430 54142 563703 5012206 298681 698174 5390106 127269 213239 5698169 19791 515147 5785886 424105 5234...
output:
NO
result:
ok NO
Test #58:
score: 0
Accepted
time: 40ms
memory: 8844kb
input:
18 1 86229 1 86227 193882 1 107651 248212 1 54328 332327 1 84113 437324 1 104995 566945 1 129619 653431 1 86484 851898 1 198465 1109240 1 96814 1264920 1 160526 1476394 1 75604 1713346 1 69548 2046902 1 189085 2046903 1 135868 2046904 1 144469 2046905 1 86130 2046906 1 153476 2046907 1 83474
output:
YES 1 1 1 86230 1 193883 1 248213 1 332328 1 437325 1 566946 1 653432 1 851899 1 948713 1 1264921 1 1109241 1 1713347 1 1340525 1 1902432 1 1178789 1 1476395 1 1629871
result:
ok YES
Test #59:
score: 0
Accepted
time: 38ms
memory: 8544kb
input:
18 1 134465 1 134463 271884 1 137417 453637 1 181751 520434 1 66795 880891 1 175611 1243575 1 193166 1561651 1 144133 1682595 1 58894 1813262 1 62048 2059190 1 72079 2314160 1 58586 2314161 1 169516 2314162 1 86805 2314163 1 159121 2314164 1 184844 2314165 1 98824 2314166 1 156144 2314167 1 173941
output:
YES 1 1 1 134466 1 271885 1 453638 1 520435 1 880892 1 1243576 1 1561652 1 1620546 1 1682596 1 1754675 1 1074058 1 1813263 1 1900068 1 696046 1 2059191 1 2158015 1 1387709
result:
ok YES
Test #60:
score: 0
Accepted
time: 38ms
memory: 8672kb
input:
18 1 343813 1 195001 655308 1 135369 810160 1 88021 1019190 1 51866 1308705 1 126872 1604370 1 98496 1926937 1 192360 2173164 1 162641 2448210 1 197167 2448211 1 112252 2448212 1 133973 2448213 1 130205 2448214 1 66829 2448215 1 177194 2448216 1 97850 2448217 1 157162 2448218 1 176124 2448219 1 148810
output:
YES 1 1 1 343814 1 655309 1 810161 1 1019191 1 1308706 1 1604371 1 1146063 1 1407202 1 1926938 1 2039190 1 1796731 1 743330 1 2173165 1 2350359 1 862027 1 479183 1 195002
result:
ok YES
Test #61:
score: 0
Accepted
time: 44ms
memory: 8388kb
input:
18 1 262856 1 178108 288592 1 5966 311484 1 19768 333583 1 11151 354871 1 14136 382914 1 15580 405300 1 84746 421452 1 10690 453290 1 12649 453291 1 10946 453292 1 11489 453293 1 5460 453294 1 19187 453295 1 17657 453296 1 10895 453297 1 5233 453298 1 12461 453299 1 7150
output:
YES 1 1 1 262857 1 268823 1 311485 1 333584 1 354872 1 178109 1 405301 1 421453 1 322636 1 382915 1 415991 1 434102 1 288593 1 394404 1 306250 1 370452 1 347720
result:
ok YES
Test #62:
score: 0
Accepted
time: 33ms
memory: 8680kb
input:
18 1 107565 1 107563 162712 1 8674 253921 1 18702 296208 1 5827 323475 1 9017 323476 1 16571 323477 1 18933 323478 1 19986 323479 1 18294 323480 1 12582 323481 1 8935 323482 1 16995 323483 1 9712 323484 1 8217 323485 1 14974 323486 1 6140 323487 1 13725 323488 1 8618
output:
YES 1 1 1 107566 1 116240 1 134942 1 253922 1 162713 1 179284 1 198217 1 262939 1 218203 1 296209 1 230785 1 305144 1 140769 1 281233 1 247780 1 148986 1 314856
result:
ok YES
Test #63:
score: 0
Accepted
time: 46ms
memory: 8576kb
input:
18 1 520311 1 174303 529248 1 8935 554523 1 14951 584170 1 10322 593518 1 16273 668671 1 75151 684218 1 15545 694551 1 163091 710375 1 15822 721501 1 10331 915041 1 193538 942033 1 13552 950365 1 182915 950366 1 13438 950367 1 11124 950368 1 13372 950369 1 8330 950370 1 9346
output:
YES 1 1 1 520312 1 529249 1 544200 1 554524 1 593519 1 668672 1 174304 1 694552 1 684219 1 721502 1 915042 1 337395 1 928594 1 710376 1 570797 1 942034 1 584171
result:
ok YES
Test #64:
score: 0
Accepted
time: 39ms
memory: 8844kb
input:
18 1 3003342 1 46 1000138 1 1000086 2001211 1 10023 6015653 1 991048 4006440 1 20091 9036894 1 982037 7021701 1 30076 9036896 1 973014 5010543 1 40027 8028809 1 964068 9036897 1 50081 9036900 1 955022 9036893 1 60009 9036895 1 946032 9036899 1 70058 9036901 1 937040 9036898 1 80025 9036891 1 928050
output:
YES 1 1 1 47 1 1000139 1 1010162 1 2001212 1 2021303 1 3003343 1 3033419 1 4006441 1 4046468 1 5010544 1 5060625 1 6015654 1 6075663 1 7021702 1 7091760 1 8028810 1 8108835
result:
ok YES
Test #65:
score: 0
Accepted
time: 0ms
memory: 5612kb
input:
10 1 9545 164 995 2727 592 197 1285 259 17 8307 715 465 8036 271 712 7089 885 271 9022 523 65 6156 933 320 7974 62 520 5189 967 772
output:
YES 1 1 1 1544 1 996 1 1741 1 3319 1 1013 1 4031 1 4096 1 2206 1 4416
result:
ok YES
Test #66:
score: 0
Accepted
time: 2ms
memory: 5864kb
input:
10 1 222246 43596 59903 908688 36624 70675 834061 15568 11280 535424 37666 49550 849629 59059 44650 956058 3373 28869 265842 96771 88822 826440 7621 25518 945312 10746 86462 735375 91065 91609
output:
YES 1 1 1 573090 1 362613 1 373893 1 59904 1 104554 1 133423 1 423443 1 448961 1 643765
result:
ok YES
Test #67:
score: 0
Accepted
time: 0ms
memory: 7808kb
input:
10 1 996462 49 58494 998510 1424 141030 980290 16025 4504 998355 47 15096 998402 108 180343 996511 1844 198953 976786 3504 167531 999934 26 27139 181890 92 181888 996315 147 1713
output:
YES 1 181982 1 240476 1 381506 1 386010 1 401106 1 581449 1 780402 1 947933 1 1 1 975072
result:
ok YES
Test #68:
score: 0
Accepted
time: 2ms
memory: 5632kb
input:
11 1 13161 6 982 6008 922 863 8726 749 802 9475 947 462 2077 949 590 6930 583 157 8141 585 627 4741 403 755 13167 655 951 1253 824 199 13822 316 805
output:
YES 1 10422 1 5144 1 3026 1 1 1 463 1 3828 1 7513 1 3985 1 11404 1 1053 1 12355
result:
ok YES
Test #69:
score: 0
Accepted
time: 2ms
memory: 5776kb
input:
11 1 912240 6979 36317 895916 16324 34185 564918 85286 42815 794643 88313 38380 745271 26226 85958 771497 23146 94245 919219 72122 39008 706878 38393 20450 306565 56386 9156 882956 12960 74477 650204 56674 33538
output:
YES 1 1 1 362951 1 397136 1 36318 1 439951 1 74698 1 525909 1 168943 1 189393 1 198549 1 273026
result:
ok YES
Test #70:
score: 0
Accepted
time: 2ms
memory: 5508kb
input:
11 1 990253 810 125354 974994 3 16939 991063 144 137850 991207 1832 168149 990252 1 1610 990245 5 159057 567968 2 157478 993039 6953 10582 974997 14366 87550 989363 882 98059 990250 2 12361
output:
YES 1 567970 1 1 1 16940 1 154790 1 693324 1 694934 1 322939 1 853991 1 480417 1 864573 1 962632
result:
ok YES
Test #71:
score: 0
Accepted
time: 0ms
memory: 5580kb
input:
12 1 9641 167 340 8186 704 739 12102 734 500 8890 751 598 13545 648 392 7211 975 983 10025 593 596 6587 624 677 9808 217 334 12836 709 527 10886 791 267 11677 425 899
output:
YES 1 1 1 341 1 1080 1 1580 1 2178 1 2570 1 3553 1 4149 1 4826 1 5160 1 10618 1 5687
result:
ok YES
Test #72:
score: 0
Accepted
time: 1ms
memory: 7660kb
input:
12 1 516435 81535 58410 750431 31059 77209 719144 31287 46398 652579 66565 6187 1004293 70280 35953 808542 9088 67878 1074573 6371 62684 781490 27052 40621 817630 99426 6099 917056 87237 660 597970 52705 96808 650675 1904 17526
output:
YES 1 1 1 58411 1 135620 1 182018 1 188205 1 224158 1 292036 1 354720 1 395341 1 401440 1 402100 1 498908
result:
ok YES
Test #73:
score: 0
Accepted
time: 0ms
memory: 5600kb
input:
12 1 533745 39 165370 753530 199 62532 751427 665 36692 787890 66 132669 763498 24392 4692 752092 1438 23106 753750 7700 1368 749623 1804 139393 753729 21 144325 749608 15 7292 761450 2048 16064 787956 211893 16063
output:
YES 1 1 1 165371 1 533784 1 570476 1 227903 1 703145 1 232595 1 233963 1 373356 1 726251 1 733543 1 517681
result:
ok YES
Test #74:
score: 0
Accepted
time: 1ms
memory: 7708kb
input:
13 1 6017 16 858 6033 918 672 7048 591 142 11517 954 578 8861 429 687 10594 923 249 12471 890 234 8458 180 818 9871 723 648 9290 142 368 9432 439 520 8638 223 145 6951 97 914
output:
YES 1 1 1 859 1 1531 1 1673 1 2251 1 2938 1 3187 1 7639 1 3421 1 4069 1 4437 1 4957 1 5102
result:
ok YES
Test #75:
score: 0
Accepted
time: 3ms
memory: 5892kb
input:
13 1 670865 40646 35029 978958 51439 194 297554 1774 83471 567708 85791 50800 795731 21967 71680 714700 43901 17069 758601 37130 34350 817698 67651 86526 1030397 63212 61480 885349 93609 65004 1093609 69625 19273 653499 17366 34218 711511 3189 6837
output:
YES 1 299328 1 334357 1 1 1 334551 1 83472 1 155152 1 385351 1 419701 1 506227 1 172221 1 237225 1 256498 1 290716
result:
ok YES
Test #76:
score: 0
Accepted
time: 1ms
memory: 5584kb
input:
13 1 961974 2178 122353 967408 23557 39103 964852 2555 38339 990965 309 50866 967407 1 75830 964815 1 74765 991274 8716 30639 964818 34 42617 181170 3653 140198 964816 1 2631 961973 1 142394 964817 1 58622 964152 663 139960
output:
YES 1 184823 1 307176 1 1 1 346279 1 397145 1 472975 1 547740 1 578379 1 38340 1 178538 1 620996 1 763390 1 822012
result:
ok YES
Test #77:
score: 0
Accepted
time: 4ms
memory: 5612kb
input:
14 1 11938 887 267 13294 880 468 8811 656 877 10451 872 777 14314 185 48 8532 279 601 6279 862 64 14174 140 12 11323 94 877 5660 619 336 11417 160 629 11577 361 900 9709 742 956 9467 242 704
output:
YES 1 1 1 12825 1 268 1 7141 1 1145 1 7918 1 1193 1 8519 1 1257 1 2134 1 2470 1 3099 1 3999 1 4955
result:
ok YES
Test #78:
score: 0
Accepted
time: 4ms
memory: 7712kb
input:
14 1 826656 89401 33 1111986 3505 5156 734999 46621 85502 916057 30429 69295 334829 82937 4793 1146334 53625 92979 794926 31730 99981 946486 80846 32378 1115491 30843 72946 781620 13306 63870 1027332 84654 34248 72969 27636 21 1199959 81287 26783 1281246 85701 36437
output:
YES 1 100605 1 417766 1 422922 1 508424 1 100638 1 105431 1 198410 1 577719 1 1 1 610097 1 673967 1 72947 1 708215 1 298391
result:
ok YES
Test #79:
score: 0
Accepted
time: 2ms
memory: 7732kb
input:
14 1 999988 1 11002 999981 1 14627 999977 4 71687 854070 145643 83489 999985 3 52522 853977 92 68518 999983 1 109426 149954 1 60600 999976 1 36830 999713 263 66766 999982 1 60386 853940 37 113236 854069 1 102272 999984 1 2575
output:
YES 1 149955 1 160957 1 175584 1 247271 1 1 1 330760 1 399278 1 52523 1 113123 1 508704 1 575470 1 635856 1 749092 1 851364
result:
ok YES
Test #80:
score: 0
Accepted
time: 3ms
memory: 5632kb
input:
15 1 5425 88 753 16061 57 789 10863 873 959 9301 602 887 13697 995 856 16118 886 764 7366 351 72 12709 988 546 4101 570 6 11736 398 571 12134 575 978 15421 640 358 14692 729 989 17004 275 148 7717 150 420
output:
YES 1 4671 1 5513 1 9903 1 7867 1 1 1 857 1 6302 1 8754 1 1621 1 6374 1 1627 1 2605 1 2963 1 3952 1 6945
result:
ok YES
Test #81:
score: 0
Accepted
time: 5ms
memory: 5736kb
input:
15 1 1172506 43890 15967 830662 2138 69490 984730 788 82998 924226 60504 60420 985518 74765 63025 832800 91426 92712 1128846 27918 69499 518238 22757 49274 1060283 19605 36179 1156764 15742 37187 1293001 66389 5731 1216396 66658 34292 1079888 48958 38867 1283054 9947 21165 540995 72310 58786
output:
YES 1 613305 1 629272 1 1 1 698762 1 82999 1 146024 1 238736 1 308235 1 357509 1 759182 1 393688 1 796369 1 399419 1 438286 1 459451
result:
ok YES
Test #82:
score: 0
Accepted
time: 1ms
memory: 5692kb
input:
15 1 987028 1 104515 990079 169 76209 990253 1 132757 987027 1 131401 990256 1 2421 990075 4 7019 999984 4 87535 999983 1 56612 990254 2 75032 544970 24 3361 999928 55 83828 990257 9671 66656 987029 1 18525 987030 3045 126592 990248 5 14537
output:
YES 1 544994 1 1 1 649509 1 76210 1 207611 1 782266 1 210032 1 789285 1 297567 1 372599 1 375960 1 459788 1 526444 1 845897 1 972489
result:
ok YES
Test #83:
score: 0
Accepted
time: 5ms
memory: 5876kb
input:
16 1 8357 635 365 8992 686 66 12400 791 375 14542 677 356 5877 46 146 10468 214 463 13638 904 709 5923 332 760 10682 798 109 9678 577 765 10255 213 783 2629 460 187 6255 244 964 11480 246 7 13191 447 776 11726 674 440
output:
YES 1 6499 1 1 1 67 1 3089 1 3445 1 442 1 6864 1 905 1 3591 1 3700 1 7573 1 1665 1 4465 1 5429 1 1852 1 5436
result:
ok YES
Test #84:
score: 0
Accepted
time: 9ms
memory: 5864kb
input:
16 1 1671770 27323 15939 1234987 60995 96877 1550367 90633 17609 837891 55321 54257 1641000 30770 48997 226889 96738 74336 780016 57875 53478 1167915 67072 65266 992679 59898 65962 1346178 77887 9651 1295982 50196 86589 893212 99467 96668 1475999 56758 14763 1424065 51934 34132 667677 58860 12778 16...
output:
YES 1 1052577 1 323627 1 1532757 1 420504 1 474761 1 1 1 726537 1 1068516 1 74337 1 523758 1 140299 1 533409 1 630077 1 1133782 1 644840 1 657618
result:
ok YES
Test #85:
score: 0
Accepted
time: 7ms
memory: 7928kb
input:
16 1 999497 1 204 999511 474 92386 999509 1 113305 999499 1 64178 384538 3 17480 999510 1 18968 999502 3 64849 999985 1 44246 999501 1 5958 999496 1 109475 999495 1 19162 999508 1 112884 999498 1 117261 999500 1 38094 999986 1 86503 999505 3 94536
output:
YES 1 1 1 384541 1 476927 1 590232 1 205 1 654410 1 673378 1 17685 1 61931 1 738227 1 847702 1 67889 1 180773 1 866864 1 298034 1 904958
result:
ok YES
Test #86:
score: 0
Accepted
time: 12ms
memory: 6012kb
input:
17 1 14944 898 729 17949 824 862 15842 691 330 16533 818 153 4166 62 665 10278 995 856 8410 873 935 13560 434 380 17495 454 270 13994 950 361 17351 144 492 9950 328 773 9283 93 699 18773 21 472 9376 574 251 12603 957 588 8091 319 539
output:
YES 1 4228 1 4957 1 1 1 5819 1 331 1 5972 1 996 1 11273 1 1931 1 11653 1 2201 1 2693 1 3466 1 6828 1 7300 1 12014 1 7551
result:
ok YES
Test #87:
score: 0
Accepted
time: 18ms
memory: 6116kb
input:
17 1 676782 42559 66771 862135 59480 40414 1327737 55790 25119 1199056 82173 74181 784727 8703 83098 1471461 61480 28231 1106660 13018 58504 216161 87950 23590 1070585 36075 33383 1281229 21388 46262 793430 28290 89812 1383527 71641 1021 1119678 79378 73994 1532941 45262 10475 719341 65386 37466 921...
output:
YES 1 304111 1 821720 1 1302617 1 1 1 370882 1 938970 1 967201 1 74182 1 1025705 1 97772 1 453980 1 1059088 1 543792 1 1060109 1 144034 1 617786 1 181500
result:
ok YES
Test #88:
score: 0
Accepted
time: 12ms
memory: 6120kb
input:
17 1 999368 1 67202 999686 1 6546 999754 232 1113 999685 1 115702 999369 130 114820 991373 1 1473 104080 1 104078 999501 164 100159 988589 2783 106176 991374 330 43817 991704 1 25243 999499 1 13494 991705 7663 92011 999665 20 56685 991372 1 103692 999687 67 22538 999500 1 13836
output:
YES 1 104081 1 171283 1 177829 1 178942 1 294644 1 409464 1 1 1 410937 1 511096 1 617272 1 661089 1 686332 1 699826 1 791837 1 848522 1 952214 1 974752
result:
ok YES
Test #89:
score: 0
Accepted
time: 29ms
memory: 8660kb
input:
18 1 14650 244 747 4305 738 242 11539 431 650 11970 737 881 5819 411 584 5043 776 433 1748 111 142 18573 146 215 3631 674 918 13715 935 805 3619 12 227 17674 899 229 15696 568 931 13005 710 297 17637 37 663 14894 802 515 17035 602 127 16264 771 504
output:
YES 1 6230 1 1 1 6977 1 7627 1 1859 1 2443 1 243 1 385 1 600 1 8508 1 2876 1 1518 1 9313 1 12707 1 10244 1 3103 1 10907 1 11034
result:
ok YES
Test #90:
score: 0
Accepted
time: 33ms
memory: 8328kb
input:
18 1 682900 22793 72843 705693 48996 53468 1073107 57965 11940 1026702 46405 54158 1395858 8449 38421 1565876 52595 44868 1404307 60563 45058 1383852 12006 46850 1277145 6805 61236 1753139 42190 78246 1464870 59537 32628 1131072 51809 50251 1283950 26189 94080 1524407 41469 85748 1182881 94264 23379...
output:
YES 1 1 1 72844 1 126312 1 754689 1 808847 1 847268 1 892136 1 138252 1 185102 1 246338 1 324584 1 357212 1 407463 1 501543 1 587291 1 610670 1 937194 1 643969
result:
ok YES
Test #91:
score: 0
Accepted
time: 31ms
memory: 8300kb
input:
18 1 989504 1 16139 999958 26 30148 989506 1 11002 999957 1 76128 989497 3 110131 999984 1 9404 976519 1 59962 972649 3870 64580 343566 4 92375 976535 12962 70340 989500 4 84977 989510 6 88230 999946 11 32569 989505 1 28348 976520 15 17950 989507 3 98268 989516 9 820 989525 10421 81271
output:
YES 1 343570 1 359709 1 389857 1 1 1 400859 1 510990 1 76129 1 136091 1 200671 1 520394 1 590734 1 675711 1 293046 1 763941 1 325615 1 792289 1 890557 1 891377
result:
ok YES
Test #92:
score: 0
Accepted
time: 27ms
memory: 8580kb
input:
18 1 85156 1 4303 134103 1 10178 134110 1 10527 134097 1 8021 134100 1 2926 134111 1 10279 134108 1 6145 134104 1 3927 134105 1 2625 134112 1 6038 134106 1 8770 134098 1 7252 134109 1 5952 134099 1 11568 134102 1 6379 134101 1 8636 134107 1 7872 134096 1 12694
output:
YES 1 1 1 4304 1 14482 1 85157 1 25009 1 93178 1 103457 1 109602 1 27935 1 30560 1 36598 1 45368 1 52620 1 58572 1 70140 1 76519 1 113529 1 121401
result:
ok YES
Subtask #7:
score: 15
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Test #93:
score: 15
Accepted
time: 26ms
memory: 8676kb
input:
18 2 131814 93062 60437 929788 73431 24242 2683264 47223 52877 3567691 99565 55630 3882730 75888 11627 4407974 88549 17392 4526930 90013 88544 5331922 37832 89757 6547429 67129 62101 6695087 97295 96884 7342909 77636 51100 7930118 10882 77053 8356878 57206 16001 8667289 47703 98530 9002255 6474 6979...
output:
YES 2 1 2 224876 2 249118 2 1003219 2 60438 2 72065 2 301995 2 1058849 2 390539 2 452640 2 1148606 2 549524 2 626577 2 642578 2 741108 2 89457 2 810906 2 846888
result:
ok YES
Test #94:
score: 0
Accepted
time: 25ms
memory: 8624kb
input:
18 2 1033219 237280 172731 1295699 346042 482549 1700228 50897 192262 1821111 999421 100123 3064077 179348 952898 3498658 362873 305466 3886527 146452 84912 4168851 560612 544076 4798568 605465 335280 5801501 257698 948964 6144220 16122 76416 6490021 38748 581902 6778085 79811 877762 7655710 51739 6...
output:
YES 1 1 1 172732 2 1 2 192263 1 1751125 2 292386 1 1641741 1 3243425 1 655281 2 4739293 2 597852 2 674268 2 3861531 2 1751125 2 6160342 2 2820532 2 1270499 2 6857896
result:
ok YES
Test #95:
score: 0
Accepted
time: 11ms
memory: 8700kb
input:
18 2 141726 1 141724 141727 1 141725 236906 53072 95177 289978 1 148249 380645 97606 90665 478251 1 188271 594172 1 115919 594173 1 115920 729454 6046 135279 735500 1 141325 844428 61666 108926 906094 1 170592 979990 32208 73894 1012198 1 106102 1122574 1 110374 1122575 1 110375 1216038 104918 93461...
output:
YES 1 1 2 1 1 141728 2 141728 1 289979 2 289979 1 478252 2 478252 1 594174 2 594174 1 735501 2 735501 1 906095 2 906095 1 1012199 2 1012199 1 1122576 2 1122576
result:
ok YES
Test #96:
score: 0
Accepted
time: 20ms
memory: 8424kb
input:
18 2 105030 1 105028 105031 1 105029 116136 1 11103 116137 1 11104 122521 4710 6382 127231 1 11092 141327 1 14094 141328 1 14095 149156 1 7826 149157 1 7827 164096 4579 14937 168675 1 19516 182657 1 13980 182658 1 13981 190815 379 8155 191194 1 8534 202659 895 11463 203554 1 12358
output:
YES 1 1 2 1 1 105032 2 105032 1 116138 2 116138 1 127232 2 127232 1 141329 2 141329 1 149158 2 149158 1 168676 2 168676 1 182659 2 182659 1 191195 2 191195
result:
ok YES
Test #97:
score: 0
Accepted
time: 26ms
memory: 8876kb
input:
18 2 212109 75397 68777 287506 1 130734 317393 1 11163 317394 1 12582 317395 1 29887 330076 8877 12679 338953 1 6132 352297 14 13342 352311 1 13356 352312 1 6140 380076 16249 19723 396325 1 15424 396326 1 14982 396327 1 143330 396328 1 9554 396329 1 156770 396330 1 8039 396331 1 19475
output:
YES 1 1 2 1 2 287507 2 298670 1 287507 1 317396 2 317396 1 338954 2 338954 2 311252 1 352313 2 323528 2 352313 1 68778 2 367295 2 130735 1 372036 2 376849
result:
ok YES
Test #98:
score: 0
Accepted
time: 2ms
memory: 5804kb
input:
10 2 5378 508 800 7360 192 22 3604 937 940 4882 496 940 5886 704 42 7951 291 318 7552 249 208 6590 770 676 4541 341 455 7801 150 868
output:
YES 2 1 2 801 1 1 2 823 2 1763 2 1805 2 2123 2 2331 2 3007 2 3462
result:
ok YES
Test #99:
score: 0
Accepted
time: 0ms
memory: 7652kb
input:
10 2 752692 16666 47961 333718 32787 26313 932604 21884 99192 374276 75361 61719 634481 55917 94578 746892 5800 78140 848430 84174 90265 366505 7771 69376 769358 79072 97715 690398 56494 48777
output:
YES 1 1 1 47962 1 74275 2 1 2 61720 2 449637 2 156298 2 246563 2 527777 2 315939
result:
ok YES
Test #100:
score: 0
Accepted
time: 2ms
memory: 5812kb
input:
11 2 3981 751 832 5762 895 191 8265 784 13 6657 876 112 3475 506 924 3335 140 848 9342 672 718 3007 328 610 4957 805 224 9049 234 785 9283 59 762
output:
YES 1 1 2 1 1 833 2 192 1 846 2 304 2 7533 2 1152 2 1762 2 1986 2 8251
result:
ok YES
Test #101:
score: 0
Accepted
time: 2ms
memory: 5804kb
input:
11 2 214404 74667 13003 96694 35288 8271 571224 64964 17498 703113 42898 66924 802434 37433 90218 312491 72221 23419 756139 46295 63536 384712 52313 17729 746011 10128 70692 498130 73094 61104 131982 82422 56073
output:
YES 1 1 1 13004 1 437025 1 21275 2 636188 1 289071 2 306800 2 289071 2 1 2 437025 2 70693
result:
ok YES
Test #102:
score: 0
Accepted
time: 3ms
memory: 7660kb
input:
12 2 12062 178 438 7593 899 406 4950 819 395 8791 870 298 4026 924 536 10613 466 306 11079 41 894 7052 541 375 9661 952 907 1199 716 791 11755 307 736 11120 635 719
output:
YES 1 1 1 439 1 1143 1 845 2 1915 2 5769 2 8492 2 1 2 6075 2 376 2 2451 2 3187
result:
ok YES
Test #103:
score: 0
Accepted
time: 3ms
memory: 5620kb
input:
12 2 955960 63399 10243 128253 92839 33333 765757 22959 94918 221092 97426 77361 732030 33727 43931 668119 63911 44068 863657 92303 54458 434546 67116 52260 788716 55639 42606 501662 78457 78168 844355 19302 3687 318518 63767 29695
output:
YES 2 580119 1 1 1 426216 1 33334 1 382285 2 1 2 44069 2 382285 2 590362 2 128222 2 632968 2 98527
result:
ok YES
Test #104:
score: 0
Accepted
time: 3ms
memory: 5636kb
input:
13 2 5858 921 82 9015 854 811 7916 65 301 8687 328 112 353 432 269 4862 996 929 7981 706 805 7142 774 589 11251 216 754 11747 252 231 6779 363 918 10841 410 971 11467 280 328
output:
YES 2 1 1 785 1 1596 2 83 1 1 2 195 2 1124 2 1929 2 2518 2 3272 2 3503 2 9869 2 4421
result:
ok YES
Test #105:
score: 0
Accepted
time: 3ms
memory: 5828kb
input:
13 2 701841 45849 31424 604181 32328 51225 883685 25494 51403 257810 34006 82586 538343 65838 38608 444906 93437 13806 636509 65332 13468 853659 30026 68031 385659 59247 13683 995296 66957 33270 291816 93843 64058 909179 86117 65934 838020 15639 90329
output:
YES 1 1 1 31425 1 82650 1 134053 1 216639 2 1 2 13807 2 27275 2 95306 2 108989 2 142259 2 206317 2 747690
result:
ok YES
Test #106:
score: 0
Accepted
time: 1ms
memory: 5864kb
input:
14 2 5703 22 112 4924 779 771 8997 515 477 4748 176 654 8874 123 223 10057 466 817 7284 746 917 8030 844 432 453 648 451 2354 491 258 10523 20 500 9512 545 922 5725 209 895 2201 153 618
output:
YES 1 1 1 1101 2 2845 1 1872 2 1101 1 113 2 5934 2 6851 2 1 2 1324 2 3322 2 3822 2 4744 2 1582
result:
ok YES
Test #107:
score: 0
Accepted
time: 1ms
memory: 5612kb
input:
14 2 486425 65245 97671 1028657 93572 91452 1021877 6780 8183 668392 72395 34189 1122229 78823 64730 593367 75025 31752 919863 5166 59417 551670 41697 42647 1201052 91725 16588 1292777 61855 24378 399234 72740 99136 797278 63167 39902 471974 14451 85347 925029 96848 62243
output:
YES 1 1 1 97672 2 740787 2 1 1 189124 2 34190 2 860445 2 65942 2 108589 2 125177 2 149555 2 748970 2 248691 2 334038
result:
ok YES
Test #108:
score: 0
Accepted
time: 2ms
memory: 5736kb
input:
15 2 2889 583 307 11199 224 512 9403 59 495 8273 178 349 6271 983 985 10277 922 594 5998 273 115 7254 669 722 11423 476 220 3472 147 241 4142 755 953 8451 456 475 9462 815 108 3619 523 197 2384 505 928
output:
YES 1 1 1 308 1 4897 1 820 1 1169 1 2154 2 4897 2 5012 2 5734 2 1 2 242 2 7923 2 8907 2 1195 2 1392
result:
ok YES
Test #109:
score: 0
Accepted
time: 5ms
memory: 7784kb
input:
15 2 1266217 8624 88397 1098319 87482 75374 651832 7454 71488 507535 59578 96235 1185801 80416 39822 745788 71793 17153 1005900 17044 95923 567113 84719 81659 1274841 28349 96229 817581 92395 42143 659286 86502 59487 1303190 7765 24097 418691 88844 24197 1316638 51446 70995 1310955 5683 84914
output:
YES 1 1 1 88398 1 163772 1 235260 2 1022944 2 1 2 17154 2 113077 2 194736 2 290965 2 333108 2 909976 2 392595 2 934073 2 1062766
result:
ok YES
Test #110:
score: 0
Accepted
time: 8ms
memory: 5904kb
input:
16 2 5326 110 416 6045 610 839 5436 609 933 5110 216 404 9966 466 781 8354 11 624 9200 655 668 6655 23 926 7999 355 266 6678 442 76 7120 879 527 8365 120 921 9855 111 524 8485 715 998 10432 388 739 2151 516 302
output:
YES 1 1 1 417 1 2037 1 2970 1 1256 1 3374 1 3998 2 1 2 2667 2 2933 2 3009 2 927 2 3536 2 4060 2 5058 2 1848
result:
ok YES
Test #111:
score: 0
Accepted
time: 11ms
memory: 7660kb
input:
16 2 413907 55237 52631 1094116 35797 31606 1129913 20241 36937 366975 46932 330 245982 34001 17524 208466 37516 73451 984102 90256 61150 1150154 99098 81204 834928 57201 68576 279983 34030 65647 1074358 19758 95025 892129 14712 32429 956556 27546 4166 469144 70411 117 906841 49715 47288 1249252 190...
output:
YES 1 1 1 52632 1 84238 1 121175 2 1 2 17525 2 539555 2 600705 2 681909 2 90976 2 346442 2 314013 2 156623 2 160789 2 160906 2 750485
result:
ok YES
Test #112:
score: 0
Accepted
time: 13ms
memory: 8228kb
input:
17 2 10185 247 240 5017 809 318 7650 948 166 10432 934 534 6860 790 737 9903 282 254 1721 657 780 2471 840 92 8598 102 628 8700 317 375 9737 166 888 11366 769 245 3505 942 103 9711 26 939 9017 694 876 12135 193 296 4447 570 476
output:
YES 1 5826 1 1 2 1 1 319 1 3311 2 167 1 853 1 2378 2 5826 2 421 2 1568 2 6454 2 3395 2 2456 2 6699 2 796 2 1092
result:
ok YES
Test #113:
score: 0
Accepted
time: 16ms
memory: 9912kb
input:
17 2 885542 66615 62305 737451 47970 61875 509210 57366 22704 1343295 97934 3106 653964 83487 73827 978901 72747 95011 1243202 92972 67220 566576 13560 71517 836533 49009 15786 1051648 1129 44318 1230555 12647 64769 785421 51112 13070 1336174 7121 69910 1052777 95955 25390 952157 26744 93126 1182302...
output:
YES 1 1 1 62306 2 1 2 22705 1 124181 2 619252 2 25811 2 93031 2 164548 2 180334 2 224652 2 289421 2 302491 2 372401 2 397791 2 580136 2 490917
result:
ok YES
Test #114:
score: 0
Accepted
time: 22ms
memory: 8572kb
input:
18 2 8019 489 740 13922 293 452 11029 402 778 1136 377 257 13138 784 239 9901 325 832 10226 803 957 11431 563 736 12294 844 391 9319 185 137 11994 300 148 9504 397 292 8508 811 960 14215 146 436 6707 368 383 7075 700 211 2295 116 973 7775 244 500
output:
YES 1 1513 1 2253 1 2705 1 1 2 2411 1 258 2 2650 2 1 2 3607 2 3998 2 737 2 4135 2 4427 2 1858 2 5387 2 5770 2 885 2 5981
result:
ok YES
Test #115:
score: 0
Accepted
time: 33ms
memory: 10208kb
input:
18 2 1049994 30112 22335 1240953 10083 17419 372534 45023 57815 898597 80306 66925 1251036 44638 72467 749171 82500 96928 371196 1338 58213 417557 50601 14908 1189171 51782 63891 1094894 30799 89729 1080106 14788 49512 468158 75002 73510 1125693 39067 82201 1164760 24411 10132 978903 71091 8661 6333...
output:
YES 1 543160 1 1 1 17420 1 75235 1 142160 1 214627 1 311555 2 1 1 565495 2 14909 2 831671 2 104638 2 881183 2 543160 2 553292 2 178148 2 268386 2 561953
result:
ok YES
Subtask #8:
score: 15
Accepted
Dependency #7:
100%
Accepted
Test #116:
score: 15
Accepted
time: 149ms
memory: 15148kb
input:
20 2 32774807 3739199 5003113 39587091 5354823 7970036 72028468 5046698 4410507 132113238 6996454 7441026 148767706 3956177 4070396 156741605 4165228 4253917 164253855 5557273 9562340 172618864 6969829 7966023 443844454 4199531 4928005 467328356 3015135 7807946 506746111 8314538 8446111 529179585 28...
output:
YES 2 1 2 5003114 2 44941914 2 77075166 2 84516192 2 88586588 2 49352421 2 12973150 2 20939173 2 92840505 2 100648451 2 25867178 2 36514006 2 109094562 2 38571756 2 115416077 2 58914761 2 63317295 2 39052478 2 32084321
result:
ok YES
Test #117:
score: 0
Accepted
time: 46ms
memory: 14696kb
input:
20 2 14717925 18125502 19979927 84092340 28669811 29671882 113282247 2236976 27536075 134055738 8672395 52449935 154674605 8396586 41521530 255196580 11483092 28147891 289109799 43910930 18905659 338321482 15127759 55978277 360613757 1913298 33006688 441808423 18702263 90857712 527558072 102406 3296...
output:
NO
result:
ok NO
Test #118:
score: 0
Accepted
time: 42ms
memory: 16332kb
input:
20 2 193227 1 193225 193228 1 193226 249073 101613 55843 350686 1 157456 437904 20360 87216 458264 1 107576 568072 56869 109806 624941 1 166675 799865 1 174922 799866 1 174923 980363 1 180495 980364 1 180496 1078211 67860 97845 1146071 1 165705 1341408 1 195335 1341409 1 195336 1421788 824 80377 142...
output:
YES 1 1 2 1 1 193229 2 193229 1 350687 2 350687 1 458265 2 458265 1 624942 2 624942 1 799867 2 799867 1 980365 2 980365 1 1146072 2 1146072 1 1341410 2 1341410 1 1422613 2 1422613
result:
ok YES
Test #119:
score: 0
Accepted
time: 77ms
memory: 14160kb
input:
20 2 95304 1 95302 95305 1 95303 102533 2123 7226 104656 1 9349 121771 1 17113 121772 1 17114 128038 8404 6264 136442 1 14668 150296 1 13852 150297 1 13853 161124 6639 10825 167763 1 17464 185529 1 17764 185530 1 17765 191385 10942 5853 202327 1 16795 211789 7224 9460 219013 1 16684 228791 6039 9776...
output:
YES 1 1 2 1 1 95306 2 95306 1 104657 2 104657 1 121773 2 121773 1 136443 2 136443 1 150298 2 150298 1 167764 2 167764 1 185531 2 185531 1 202328 2 202328 1 219014 2 219014
result:
ok YES
Test #120:
score: 0
Accepted
time: 108ms
memory: 15404kb
input:
20 2 302733 57090 169425 359823 1 180056 380613 16160 12956 396773 1 17914 396774 1 19034 419731 1 15893 419732 1 5680 437067 1 8419 437068 1 133306 437069 1 7832 437070 3624 7062 440694 1 15665 463643 1 9632 463644 1 13736 463645 1 179765 463646 1 13315 463647 1 8914 463648 1 5295 463649 1 17276 46...
output:
YES 1 1 2 1 1 359824 2 359824 2 377738 1 396775 2 396775 1 419733 1 169426 1 372780 1 412668 2 419733 1 440695 2 440695 2 180057 1 450327 1 428152 2 435398 2 402455 2 454431
result:
ok YES
Test #121:
score: 0
Accepted
time: 144ms
memory: 15284kb
input:
20 1 1000076 1 35 2001178 1 1000040 7021656 1 10009 3003322 1 991084 10045994 1 20072 5010463 1 982069 6015618 1 30024 4006367 1 973012 10045984 1 40014 10045988 1 964077 10045989 1 50064 8028785 1 955083 9036891 1 60002 10045992 1 946028 10045987 1 70039 10045991 1 937084 10045993 1 80034 10045990 ...
output:
NO
result:
ok NO
Test #122:
score: 0
Accepted
time: 70ms
memory: 10200kb
input:
19 2 131198275 6056385 8149112 96512654 368456 7613695 117026220 2289432 281761 26257646 6472050 8349070 59495862 7927005 9093418 105913622 6758510 9032511 112672132 2174900 4674404 114847032 2179188 419875 72853077 314365 6957456 137254660 6938248 7582404 128816984 2381291 3726798 144192908 5749836...
output:
YES 1 1 2 73167442 2 35277890 1 8149113 1 16498183 1 35277890 2 1 2 80781137 2 46675645 2 96881110 2 104463514 2 81201012 2 4674405 2 10455077 2 90817399 2 53633101 2 35559651 2 16945334 2 57632847
result:
ok YES
Test #123:
score: 0
Accepted
time: 119ms
memory: 15192kb
input:
20 2 19199837 5471953 9314739 84202521 3929801 7362434 153833689 3041716 8795563 136046608 9353904 3811336 40127335 8476178 7758076 118400335 8301169 1873678 8469133 5111241 8469131 110170196 934330 4200082 126701504 9345104 7794681 117826021 574314 3175585 98944046 1755476 2016160 67272202 7352648 ...
output:
YES 1 7758077 1 74624850 1 24671790 2 74624850 1 1 2 90430949 2 1 2 78436186 2 82636268 2 92304627 2 32156020 2 13580374 2 95480212 2 39986902 2 18638431 2 25732695 2 34172180 2 16181953 2 38721218 2 25945933
result:
ok YES
Test #124:
score: 0
Accepted
time: 68ms
memory: 10432kb
input:
19 2 83474649 3138025 6035538 35100969 802033 8182045 45373100 2957211 3646220 127256457 2077070 1850105 53423097 9997368 6441307 117358017 9898440 5709329 96981624 3850603 6671566 63420465 3248362 3549904 112489915 1504384 568478 100832227 5200574 2534644 35903002 7091992 2129623 43043699 2329401 1...
output:
YES 1 1 1 6035539 1 14217584 1 17863804 1 19713909 1 66668827 1 26155216 2 1 2 3549905 2 4118383 2 6653027 2 8782650 2 8925024 2 66668827 2 9042056 2 17407991 2 25273001 2 29940435 2 35000713
result:
ok YES
Test #125:
score: 0
Accepted
time: 148ms
memory: 16160kb
input:
20 2 146032506 3616560 5896991 140351367 5681139 8803968 56622062 1720758 3095293 150853895 6197572 1095434 95111251 1254045 4498941 83582686 7861809 2968994 149649066 1204829 4705849 96365296 5413390 9210675 122511609 832693 5738943 101778686 6190629 7745473 48720710 7901352 4068246 80687635 289505...
output:
YES 1 1 1 5896992 1 14700960 1 17796253 1 18891687 1 23390628 1 26359622 1 31065471 1 40276146 2 1 2 7745474 2 11813720 2 15204354 2 123344302 2 20667879 2 27270922 2 33751731 2 35988583 2 39660415 2 43821737
result:
ok YES
Test #126:
score: 0
Accepted
time: 70ms
memory: 10620kb
input:
19 2 116931828 3490623 7045493 161810710 2858632 8803550 80762084 6542621 545287 155980876 5829834 8325863 115525277 1406551 76944 150129207 5851669 2442861 105993454 9531823 8144617 87304705 7291271 5994433 136763545 9689496 4822585 69153574 2838816 4261905 129874584 1790684 5976823 56214717 256300...
output:
YES 1 1 1 7045494 2 56471017 1 15849044 2 57016304 1 24174907 2 1 2 8144618 2 14139051 2 18961636 2 23223541 2 29200364 2 37948819 2 57093248 2 41201679 2 94595976 2 101293547 2 42401456 2 52055310
result:
ok YES
Test #127:
score: 0
Accepted
time: 129ms
memory: 13800kb
input:
20 2 128359744 2008373 3988087 69014110 6700010 8604068 123028848 5330896 1543447 114954231 8074617 9347311 75714120 1053239 9357493 130368117 8925446 8991212 81222956 46271 5721066 61173666 7840444 1939821 45606965 434567 9667361 101998473 6383790 7960145 90039004 8879816 1180998 49889905 3128347 1...
output:
YES 1 1 1 46041532 1 3988088 1 5531535 1 14878846 1 24236339 2 1 2 5721067 1 33227551 2 7660888 2 15621033 2 16802031 2 18710582 2 22141459 2 25093553 2 108382263 2 34541666 2 37936970 2 39572418 2 47969101
result:
ok YES
Test #128:
score: 0
Accepted
time: 49ms
memory: 10816kb
input:
19 2 172040199 3137166 8285790 138264895 3218338 8386742 159411689 2131728 9642665 171841245 198954 9541436 18577051 8266467 4980330 187926665 4540051 6574436 46171148 596222 8341369 134182671 4082224 1595329 161543417 9402610 1886333 133107829 275898 9149296 46767370 9985795 9099927 123543090 95647...
output:
YES 1 26843518 1 1 2 141483233 2 56753165 1 8386743 2 175177365 2 26843518 2 66294601 2 35184887 2 67889930 2 37071220 2 77039226 2 83451721 2 88075456 2 93275832 2 151125898 2 100140899 2 107069488 2 1
result:
ok YES
Test #129:
score: 0
Accepted
time: 148ms
memory: 14596kb
input:
20 2 47389943 4344448 5946000 86287482 4471754 9047893 83749752 2537730 8375513 63065761 1267168 5503134 90759236 73672 2423845 82688435 1061317 8963443 112898813 8099600 8385126 138601058 3298071 4397476 64332929 3987236 5067456 129334021 9267037 2085433 90832908 8635546 9574142 44165266 3224677 50...
output:
YES 1 1 1 5946001 1 14993894 1 23369407 2 1 1 28872541 1 37835984 1 69304141 2 2423846 2 69304141 2 7491302 2 17065444 2 22075023 2 23460917 2 71389574 2 99468454 2 30484831 2 31636254 2 37331428 2 41279443
result:
ok YES
Test #130:
score: 0
Accepted
time: 73ms
memory: 10580kb
input:
19 2 145815126 9322048 6383115 117759085 6684764 2891196 96172299 8666140 6327045 59181063 3521954 4600316 116352617 1406468 2246538 52754975 6426088 8802896 124443849 8851683 5967062 133295532 4148428 3982786 160740457 8844424 9959289 32022679 3683746 4722493 35706425 8886409 3985076 62703017 63986...
output:
YES 1 1 1 6383116 1 9274312 1 15601357 2 1 1 20201673 2 69101658 2 2246539 2 6229325 2 16188614 2 20911107 2 24896183 2 27791631 2 30469360 2 75068720 2 78538630 2 80676625 2 92615801 2 89676266
result:
ok YES
Test #131:
score: 0
Accepted
time: 113ms
memory: 15552kb
input:
20 2 26924141 982084 608694 131759079 9344692 6631194 58420263 5817445 9726554 79524213 2801956 2854733 71352973 6025815 7691801 100647489 4562593 6671403 117744505 9438650 3907942 69372455 1980518 5864671 106288872 7515071 6720179 113803943 2880770 7077840 98418920 1228348 345836 116684713 1059792 ...
output:
YES 1 1 1 27906225 1 608695 1 10335249 1 13189982 1 34537419 2 1 1 20881783 1 41208822 2 3907943 2 10985783 2 11331619 2 16815320 2 22816932 2 28780879 2 37364536 2 42030934 2 42177884 2 48277834 2 56015983
result:
ok YES
Test #132:
score: 0
Accepted
time: 52ms
memory: 10376kb
input:
19 1 85905237 43 1506378 83995347 1243 3990685 85800095 1 8700689 83996950 1790629 2038028 79543382 1 2575022 85800096 105141 3706629 85787579 12516 9446212 83996804 146 9755229 85905662 399 10289206 83996803 1 1585473 85905280 382 5465356 95310708 1 889013 83994558 789 4451174 85906061 9202 1426217...
output:
YES 1 1 1 1506379 1 5497064 1 14197753 1 16235781 1 18810803 1 22517432 1 31963644 1 41718873 1 52008079 1 53593552 1 59058908 1 79543383 1 59947921 1 61374138 1 63899200 1 72866757 1 76230204 1 78955432
result:
ok YES
Test #133:
score: 0
Accepted
time: 120ms
memory: 14788kb
input:
20 1 95679290 151 4908982 95685536 3370456 8743875 95096984 1 8307505 95097002 35 4466851 95063096 52 2270869 99999945 36 7644902 99999981 1 930963 99056008 943937 450435 95063148 33836 6627609 95679441 5452 8810303 34118045 1 2929478 95684895 641 4896143 99056006 2 2176968 95097037 139 7712358 9905...
output:
YES 1 34118046 1 39027028 1 47770903 1 56078408 1 1 1 60545259 1 2270870 1 3201833 1 3652268 1 10279877 1 19090180 1 22019658 1 26915801 1 68190161 1 75902519 1 81536879 1 88886982 1 29092769 1 91415232 1 94001614
result:
ok YES
Test #134:
score: 0
Accepted
time: 134ms
memory: 15976kb
input:
20 1 185223 1 8371 185224 1 9773 185219 1 593 185214 1 5475 185221 1 11405 185213 1 10121 185216 1 10046 185218 1 7299 185222 1 13888 115286 1 12218 75693 1 13302 185220 1 15552 185217 1 11689 185215 1 9485 165680 1 8040 46837 1 8625 3733 1 1158 152163 1 1980 185225 1 9198 185226 1 16981
output:
YES 1 3734 1 115287 1 1 1 152164 1 75694 1 125060 1 165681 1 87099 1 12105 1 25993 1 46838 1 60140 1 94398 1 175727 1 157639 1 38211 1 594 1 1752 1 106087 1 135181
result:
ok YES
Subtask #9:
score: 10
Accepted
Dependency #8:
100%
Accepted
Test #135:
score: 10
Accepted
time: 604ms
memory: 39056kb
input:
22 2 21531559 3750460 8635391 54798322 674581 6215433 62131214 9470271 7063376 195032851 1018938 9046870 213468113 5382512 5240122 263957913 6579038 1373737 296955110 23342 9323706 345125201 8454557 3643353 515830933 5665185 5549611 566133260 9419575 7428501 592622980 7804302 282440 600566180 153528...
output:
YES 2 1 2 25282019 2 8635392 2 71601485 2 80648355 2 85888477 2 87262214 2 55472903 2 15698768 2 31497452 2 21248379 2 59116256 2 38925953 2 96585920 2 101644526 2 60979172 2 61093118 2 48379120 2 104156437 2 109467550 2 113042333 2 121691594
result:
ok YES
Test #136:
score: 0
Accepted
time: 135ms
memory: 40108kb
input:
22 2 34753831 26053338 12474618 73275955 32716979 60610872 131006453 19700032 94556137 164567762 11145719 28071519 181015106 12214730 4542590 194940868 20606812 10181832 216440872 37259976 43244122 280725945 7567131 78273894 298850059 20364608 71251445 355115743 4364731 89241331 388548844 8985563 68...
output:
NO
result:
ok NO
Test #137:
score: 0
Accepted
time: 171ms
memory: 40600kb
input:
22 2 176022 1 176020 176023 1 176021 236937 88305 60912 325242 1 149217 505028 1 179784 505029 1 179785 621959 1 116928 621960 1 116929 784899 1 162937 784900 1 162938 930281 22660 145379 952941 1 168039 1043141 101080 90198 1144221 1 191278 1211574 26749 67351 1238323 1 94100 1342034 26496 103709 1...
output:
YES 1 1 2 1 1 176024 2 176024 1 325243 2 325243 1 505030 2 505030 1 621961 2 621961 1 784901 2 784901 1 952942 2 952942 1 1144222 2 1144222 1 1238324 2 1238324 1 1368531 2 1368531 1 1494907 2 1494907
result:
ok YES
Test #138:
score: 0
Accepted
time: 356ms
memory: 39352kb
input:
22 2 167452 1 167450 167453 1 167451 183476 1 16021 183477 1 16022 188721 13617 5242 202338 1 18859 216352 1 14012 216353 1 14013 234952 1 18597 234953 1 18598 240679 1 5724 240680 1 5725 250944 1 10262 250945 1 10263 256978 5710 6031 262688 1 11741 270246 7196 7556 277442 1 14752 292717 1 15273 292...
output:
YES 1 1 2 1 1 167454 2 167454 1 183478 2 183478 1 202339 2 202339 1 216354 2 216354 1 234954 2 234954 1 240681 2 240681 1 250946 2 250946 1 262689 2 262689 1 277443 2 277443 1 292719 2 292719
result:
ok YES
Test #139:
score: 0
Accepted
time: 526ms
memory: 38936kb
input:
22 2 332430 1 79534 332431 1 332429 361700 1 13844 361701 1 12939 361702 1 54261 404196 1 15227 404197 1 12873 404198 1 121452 404199 1 8677 404200 1 6466 404201 1 12193 404202 1 8785 416451 14753 12247 431204 1 7886 444997 6188 13791 451185 1 21625 451186 1 6638 451187 1 7926 451188 1 19979 451189 ...
output:
YES 2 1 1 1 1 332432 2 332432 2 79535 2 361703 2 376930 2 133796 1 361703 2 389803 1 370380 1 346276 1 404203 2 404203 1 431205 1 382573 1 355061 2 396269 2 431205 2 412089 2 255248 2 345371
result:
ok YES
Test #140:
score: 0
Accepted
time: 602ms
memory: 39080kb
input:
22 1 1000091 1 27 2001247 1 1000059 11056271 1 10072 5010634 1 991074 11056269 1 20082 3003420 1 982085 6015808 1 30024 4006466 1 973013 8029091 1 40065 11056272 1 964093 11056262 1 50097 11056265 1 955074 11056270 1 60075 7021909 1 946019 9037170 1 70090 11056264 1 937082 11056267 1 80071 11056263 ...
output:
YES 1 1 1 28 1 1000092 1 1010164 1 2001248 1 2021330 1 3003421 1 3033445 1 4006467 1 4046532 1 5010635 1 5060732 1 6015809 1 6075884 1 7021910 1 7092000 1 8029092 1 8109163 1 9037171 1 9127180 1 10046224 1 10146228
result:
ok YES
Test #141:
score: 0
Accepted
time: 328ms
memory: 23676kb
input:
21 2 117223923 134246 352980 88955109 9746857 4319028 164313528 7710136 9662997 123553672 5068425 8824638 128622097 9563240 552429 44301620 228837 1618922 110242972 6980951 2163938 61559715 7180106 5558166 68739821 5423819 575547 85905102 3050007 6032301 59248204 2311511 4813351 145312639 9770239 48...
output:
YES 2 98701966 1 24225311 1 14382805 1 1 2 24225311 1 28544339 1 30163261 1 8824639 2 24777740 1 32327199 2 25353287 2 140447584 2 109908597 2 30166638 2 99054946 2 36680577 2 1 2 104594690 2 39436134 2 49215040 2 5824867
result:
ok YES
Test #142:
score: 0
Accepted
time: 425ms
memory: 39144kb
input:
22 2 120925219 4382270 9488075 74119394 3027572 4430319 114642991 6282228 4282203 30305663 2024625 7956410 125307489 3775935 8057325 144210508 4932050 465023 135877741 8332767 34623 54481215 9915594 6536648 52130926 2350289 3358256 85404363 9898435 2311715 77146966 8257397 1210214 32330288 4399157 3...
output:
YES 1 41159764 1 36729445 2 1 1 1 1 7956411 1 16013736 2 4282204 1 16478759 1 23015407 2 4316827 2 6628542 1 26373663 2 7838756 2 11641940 2 18396982 2 149142558 2 37020645 2 19091562 2 29668333 2 23511724 2 24794617 2 37886895
result:
ok YES
Test #143:
score: 0
Accepted
time: 234ms
memory: 22388kb
input:
21 2 131521464 5740780 8582839 142726084 4876081 5136347 94671131 4487916 1018393 24459261 8227918 6199789 64762016 2209094 7474614 32687179 7394618 432179 102521251 8028617 921090 85656473 6694065 4134261 77383628 1740625 2559340 40081797 1845965 3925520 73169390 4214238 493951 66971110 6198280 587...
output:
YES 1 41927762 1 1 1 5136348 1 6154741 1 12354530 1 19829144 1 50510601 1 20261323 1 51431691 2 1 2 41927762 2 3925521 2 9796776 2 14621757 2 42421713 2 48393198 2 16551306 2 55581488 2 16588249 2 24428672 2 62004319
result:
ok YES
Test #144:
score: 0
Accepted
time: 657ms
memory: 39528kb
input:
22 2 155311505 5991238 235678 134941825 6931790 4899004 141912180 9299963 4816559 25107023 2557346 7703658 127889115 6623819 1345951 92614230 2740686 5990062 51495502 6364892 8756523 95354916 5476448 8346721 155202823 108682 2764893 100831364 4245720 9314742 117845879 8910723 3332250 10811581 659178...
output:
YES 2 73225209 1 17403364 1 27664369 1 1 2 17403364 2 18749315 1 7703659 2 73460887 2 29193770 2 48528601 2 81807608 2 1 2 24739377 2 31958663 2 106192992 2 35277835 2 38147572 2 85139858 2 107038987 2 42106683 2 3555525 2 45092886
result:
ok YES
Test #145:
score: 0
Accepted
time: 317ms
memory: 22544kb
input:
21 2 104217807 8027982 8526634 136128060 2945428 4286865 90484121 5207051 4119084 140936969 4848984 934644 88945639 1538482 2197261 112245789 6407179 1328776 154935662 5566699 2549840 132921543 988809 7984839 74390782 8272291 9739911 151909607 3026055 9230034 86433251 2512388 6805410 67977658 641312...
output:
YES 1 1 1 8526635 1 12813500 2 1 1 16932584 2 95691172 2 934645 1 19129845 1 27114684 2 3484485 2 12714519 2 19519929 2 103642643 2 27781809 2 32566718 2 42164591 2 47430542 2 97019948 2 51643275 2 54929925 2 145785953
result:
ok YES
Test #146:
score: 0
Accepted
time: 660ms
memory: 39264kb
input:
22 2 97581159 3390536 5105603 107683826 7459747 8870052 57419529 9819720 2315810 151392822 4978516 7649172 37449928 524047 6516915 31323691 6126237 9154639 115143573 1932706 3633892 100971695 6712131 7579808 85212385 3593765 4689513 134307137 1829475 7910781 117076279 6475512 2185900 94212346 336881...
output:
YES 1 1 1 41124142 1 5105604 1 7421414 1 15070586 1 21587501 1 49994194 2 1 2 73272208 2 7579809 2 15490590 2 41124142 2 123639436 2 42600695 2 77961721 2 48275411 2 17676490 2 25226296 2 30071301 2 57415440 2 25817974 2 51576813
result:
ok YES
Test #147:
score: 0
Accepted
time: 257ms
memory: 22940kb
input:
21 2 7137536 5207251 2365315 82390291 3830022 3643675 22819164 1534692 3217479 71671238 1463184 9185984 136687809 8254315 1128544 86220313 8864965 5421932 106018916 7015593 7273905 152852226 8004839 9061569 163939537 779758 6497200 133110162 3577647 2148222 124128456 8981706 272779 113034509 7958294...
output:
YES 1 1 1 24353856 1 2365316 1 12344787 2 16267607 1 27997531 1 33419463 1 40693368 2 1 2 17396151 2 19544373 2 6497201 2 19817152 2 27556718 2 32487348 2 42456376 2 45755475 2 47285118 2 52185765 2 59559814 2 160857065
result:
ok YES
Test #148:
score: 0
Accepted
time: 487ms
memory: 39180kb
input:
22 2 104642147 5922060 532621 120236530 8819686 227153 84465455 122232 1168632 171266202 596107 6992671 96926049 7716098 3446876 110564207 9672323 2084263 152320338 9362686 5798554 129056216 7241593 697640 47295036 5660692 4496858 177422365 8998498 29961 52955728 8682236 5521661 186420863 9560361 76...
output:
YES 2 1 2 532622 2 759775 1 1 1 6992672 2 1928407 1 10439548 2 4012670 1 16238102 2 4710310 1 20734960 1 26256621 2 4740271 2 8355337 2 10374115 2 17864860 2 18869862 2 26234496 2 47073738 2 31421979 2 34233202 2 41214062
result:
ok YES
Test #149:
score: 0
Accepted
time: 291ms
memory: 23856kb
input:
21 2 161725809 2172125 7568315 108908010 6309108 2991136 115217118 609214 493614 68409920 4397180 8697465 95230865 6121562 5346986 129975631 4680689 6013486 62927887 5482033 1710409 134656320 8595906 3002928 158416540 3309269 8797070 72807100 1925049 3652902 120060977 2305579 4017964 101352427 75555...
output:
YES 1 1 1 7568316 2 1 1 19575866 1 32960342 1 10559452 1 38307328 1 16572938 2 62923136 2 32960342 2 74732149 2 36613244 2 38627623 2 78750113 2 493615 2 7491647 2 86086641 2 45750710 2 12453307 2 53675824 2 57382249
result:
ok YES
Test #150:
score: 0
Accepted
time: 553ms
memory: 38660kb
input:
22 2 87580981 3163985 1183830 61599097 4114458 9614003 139986534 2112689 9066519 69596372 1874890 7839238 52813420 6272334 1317220 73351289 7390500 4915026 71471262 1880027 412397 147141114 9205097 1920576 59085754 2513343 6497555 129242497 1623547 5489450 90744966 7665219 6331821 108332913 7583184 ...
output:
YES 1 1 1 1183831 1 10797834 1 19864353 1 27703591 1 29020811 2 36670780 2 115916097 1 33935837 1 40433392 1 45922842 2 37083177 2 1 2 9664505 2 39877270 2 117836673 2 10818847 2 44070954 2 10914820 2 16332019 2 26056960 2 35359175
result:
ok YES
Test #151:
score: 0
Accepted
time: 225ms
memory: 22792kb
input:
21 1 99886917 7 137531 99981046 114 3411955 99922117 736 6941080 99999975 6 1006942 99890237 2051 4130467 99996139 3749 7601557 99999888 87 4350651 99922857 58189 1285807 99987653 9 724869 99988120 1331 8615809 99981160 6493 7519808 99892288 56 8316748 99989451 6688 4113486 99987662 458 9500423 9989...
output:
YES 1 1 1 137532 1 3549487 1 10490567 1 11497509 1 15627976 1 23229533 1 27580184 1 28865991 1 29590860 1 38206669 1 45726477 1 54043225 1 58156711 1 67657134 1 75888058 1 82892929 1 89040966 1 95039578 1 91580784 1 94939592
result:
ok YES
Test #152:
score: 0
Accepted
time: 479ms
memory: 39384kb
input:
22 1 99813593 1 2866845 99875150 4431 8024236 99879827 1 7847774 99804934 8385 2669639 99995719 1 4141745 99813319 1 2413508 99995720 1 2439954 99813594 60332 2218692 99995763 1 100454 99879828 115891 4086329 99879581 243 4712351 99879824 1 2813336 99879825 2 7075681 99873928 1222 5781198 99998778 1...
output:
YES 1 1 1 2866846 1 91957159 1 10891082 1 13560721 1 17702466 1 20115974 1 22555928 1 24774620 1 24875074 1 28961403 1 33673754 1 36487090 1 43562771 1 49343969 1 57117658 1 58693305 1 67060765 1 71588267 1 77139112 1 79499531 1 85075742
result:
ok YES
Test #153:
score: 0
Accepted
time: 566ms
memory: 38420kb
input:
22 1 73620 1 240 174053 1 12232 174058 1 12305 174054 1 9258 174049 1 12241 174065 1 9862 174050 1 8238 174063 1 3387 40608 1 14010 174055 1 8529 174062 1 9064 174057 1 7271 174056 1 5702 174061 1 831 130614 1 275 174064 1 9003 174052 1 6821 110618 1 5331 174060 1 10736 71468 1 11796 174059 1 804 17...
output:
YES 1 71469 1 130615 1 142847 1 110619 1 40609 1 73621 1 155152 1 163390 1 1 1 14011 1 22540 1 166777 1 83483 1 71709 1 72540 1 31604 1 52850 1 89185 1 119877 1 59671 1 72815 1 94516
result:
ok YES
Extra Test:
score: 0
Extra Test Passed