QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#290581#3269. 末日魔法少女计划MoRanSky100 ✓232ms16172kbC++234.1kb2023-12-25 05:57:262023-12-25 05:57:27

Judging History

你现在查看的是最新测评结果

  • [2023-12-25 05:57:27]
  • 评测
  • 测评结果:100
  • 用时:232ms
  • 内存:16172kb
  • [2023-12-25 05:57:26]
  • 提交

answer

// Skyqwq
#include <bits/stdc++.h>

#define pb push_back
#define fi first
#define se second
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

template <typename T> bool chkMax(T &x, T y) { return (y > x) ? x = y, 1 : 0; }
template <typename T> bool chkMin(T &x, T y) { return (y < x) ? x = y, 1 : 0; }

template <typename T> void inline read(T &x) {
    int f = 1; x = 0; char s = getchar();
    while (s < '0' || s > '9') { if (s == '-') f = -1; s = getchar(); }
    while (s <= '9' && s >= '0') x = x * 10 + (s ^ 48), s = getchar();
    x *= f;
}

const int N = 2005, S = 17;

int n, k, m, f[S][N];

PII e[N * N];

int g[N][N];

void inline add(int i, int j) {
	if (i + 1 >= j || g[i][j] || i < 0 || j >= n) return;
	g[i][j] = 1;
	e[++m] = mp(i, j);
}

struct W{
	int m, u, v, P, Q, Z;
} G[S][N];

void inline work() {
	memset(f, 0x3f, sizeof f);
	for (int i = 0; i <= k; i++) f[i][0] = f[i][1] = 0;
	for (int i = 1; i <= n; i++)
		f[1][i] = 1ll * (i - 1) * (i - 2) / 2;
	for (int i = 2; i <= n; i++) {
		if (i <= 3) {
			f[2][i] = 0;
			continue;
		}
		int A = (i - 1) / 2;
		f[2][i] = f[2][A] + f[2][i - A - 1] + i - 3;
	}
	for (int j = 3; j <= k; j++) {
		for (int i = 1; i <= n; i++) {
			if (i <= j + 1) {
				f[j][i] = 0;
				continue;
			}
			f[j][i] = f[j - 1][i];
			int le = 3, re = i;
			if (i >= 100) {
				int ot = 50;
				if (j >= 10) ot = 200;
				if (j == 14) ot = 400;
				if (j == 15) ot = 500;
				chkMin(re, G[j][i - 1].m + ot);
				chkMax(le, G[j][i - 1].m - ot);
			}
			for (int m = le; m <= re; m++) {
				int L = max((i - (m - 1)) / m, 0), R = min((i - (m - 1)) / 2, n);
				int lim = j <= 5 ? 5 : 1;
				chkMax(L, G[j][i - 1].u - lim);
				chkMin(R, G[j][i - 1].u + lim);
				
				for (int u = L; u <= R; u++) {
					for (int v = u; v <= u + 1; v++) {
						int le = (i - (m - 1) - u - v);
						if (le < 0) continue;
						int c = f[j][u] + f[j][v] + max(u - 1, 0) + max(v - 1, 0);
						c += f[j - 2][m - 1] + m - 2;
						
						int P = le / (m - 2), Q = le % (m - 2);
						int Z = m - 2 - Q;
						c += f[j][P] * Z + Z * (max(2 * P - 2, 0));
						c += f[j][P + 1] * Q + Q * (2 * P);
						if (chkMin(f[j][i], c))
						 	G[j][i] = (W) { m, u, v, P, Q, Z };	
					}
					
				}
			}
		}
	}
}

vector<int> ed[N];

int F[N];

void inline chk() {
	for (int i = 1; i <= m; i++)
		ed[e[i].fi].pb(e[i].se);
	for (int i = 0; i + 1 < n; i++) ed[i].pb(i + 1);
	for (int i = 0; i < n; i++) {
		memset(F, 0x3f, sizeof F);
		F[i] = 0;
		for (int u = i; u < n; u++) {
			if (F[u] > k) cout << i << " " << u << "???" << F[u] << endl;
			assert(F[u] <= k);
			for (int v: ed[u]) chkMin(F[v], F[u] + 1);
		}
	}
}

void inline link(int k, vector<int> a) {
	int n = a.size();
	if (n <= k + 1) return;
	
	if (k == 1) {
		for (int i = 0; i < n; i++)
			for (int j = i + 2; j < n; j++)
				add(a[i], a[j]);
		return;
	}
	if (k == 2) {
		int mid = n >> 1;
		vector<int> A, B;
		for (int i = 0; i < mid; i++) {
			add(a[i], a[mid]);
			A.pb(a[i]);
		}
		for (int i = mid + 1; i < n; i++)
			add(a[mid], a[i]), B.pb(a[i]);
		link(k, A), link(k, B);
		return;
	}
	if (k > 1 && f[k][n] == f[k - 1][n]) {
		link(k - 1, a);
		return;
	}
	W o = G[k][n];
	int m = o.m, u = o.u, v = o.v, P = o.P, Q = o.Q, Z = o.Z;
	vector<int> key, le, re;
	for (int i = 0; i < u; i++)
		add(a[i], a[u]), le.pb(a[i]);
	link(k, le);
	for (int i = n - v; i < n; i++)
		add(a[n - v - 1], a[i]), re.pb(a[i]);
	link(k, re);
	key.pb(a[u]);
	int num = u;
	for (int i = 1; i <= m - 2; i++) {
		int la = num;
		num += P + 1;
		if (i <= Q) num++;
		vector<int> now;
		int X = la, Y = num;
		for (int j = X + 1; j < Y; j++) now.pb(a[j]), add(a[X], a[j]), add(a[j], a[Y]);
		link(k, now);
		key.pb(a[num]);
	}
	for (int i = 0; i + 1 < key.size(); i++) add(key[i], key[i + 1]);
	link(k - 2, key);
}

int main() {
	read(n), read(k); ++n;	
	work();
	vector<int> t;
	for (int i = 0; i < n; i++) t.pb(i);
	link(k, t);
	printf("%d\n", m); //chk(); return 0;
	for (int i = 1; i <= m; i++) printf("%d %d\n", e[i].fi, e[i].se);
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 22
Accepted

Test #1:

score: 22
Accepted
time: 0ms
memory: 15716kb

input:

2000 2

output:

15974
0 1000
1 1000
2 1000
3 1000
4 1000
5 1000
6 1000
7 1000
8 1000
9 1000
10 1000
11 1000
12 1000
13 1000
14 1000
15 1000
16 1000
17 1000
18 1000
19 1000
20 1000
21 1000
22 1000
23 1000
24 1000
25 1000
26 1000
27 1000
28 1000
29 1000
30 1000
31 1000
32 1000
33 1000
34 1000
35 1000
36 1000
37 1000
...

result:

ok 

Test #2:

score: 22
Accepted
time: 3ms
memory: 16172kb

input:

1999 2

output:

15965
0 1000
1 1000
2 1000
3 1000
4 1000
5 1000
6 1000
7 1000
8 1000
9 1000
10 1000
11 1000
12 1000
13 1000
14 1000
15 1000
16 1000
17 1000
18 1000
19 1000
20 1000
21 1000
22 1000
23 1000
24 1000
25 1000
26 1000
27 1000
28 1000
29 1000
30 1000
31 1000
32 1000
33 1000
34 1000
35 1000
36 1000
37 1000
...

result:

ok 

Test #3:

score: 22
Accepted
time: 0ms
memory: 16032kb

input:

1992 2

output:

15902
0 996
1 996
2 996
3 996
4 996
5 996
6 996
7 996
8 996
9 996
10 996
11 996
12 996
13 996
14 996
15 996
16 996
17 996
18 996
19 996
20 996
21 996
22 996
23 996
24 996
25 996
26 996
27 996
28 996
29 996
30 996
31 996
32 996
33 996
34 996
35 996
36 996
37 996
38 996
39 996
40 996
41 996
42 996
43 ...

result:

ok 

Test #4:

score: 22
Accepted
time: 3ms
memory: 15932kb

input:

1973 2

output:

15731
0 987
1 987
2 987
3 987
4 987
5 987
6 987
7 987
8 987
9 987
10 987
11 987
12 987
13 987
14 987
15 987
16 987
17 987
18 987
19 987
20 987
21 987
22 987
23 987
24 987
25 987
26 987
27 987
28 987
29 987
30 987
31 987
32 987
33 987
34 987
35 987
36 987
37 987
38 987
39 987
40 987
41 987
42 987
43 ...

result:

ok 

Test #5:

score: 22
Accepted
time: 3ms
memory: 15976kb

input:

1936 2

output:

15398
0 968
1 968
2 968
3 968
4 968
5 968
6 968
7 968
8 968
9 968
10 968
11 968
12 968
13 968
14 968
15 968
16 968
17 968
18 968
19 968
20 968
21 968
22 968
23 968
24 968
25 968
26 968
27 968
28 968
29 968
30 968
31 968
32 968
33 968
34 968
35 968
36 968
37 968
38 968
39 968
40 968
41 968
42 968
43 ...

result:

ok 

Subtask #2:

score: 14
Accepted

Test #6:

score: 14
Accepted
time: 11ms
memory: 13796kb

input:

1936 3

output:

7343
0 272
1 272
2 272
3 272
4 272
5 272
6 272
7 272
8 272
9 272
10 272
11 272
12 272
13 272
14 272
15 272
16 272
17 272
18 272
19 272
20 272
21 272
22 272
23 272
24 272
25 272
26 272
27 272
28 272
29 272
30 272
31 272
32 272
33 272
34 272
35 272
36 272
37 272
38 272
39 272
40 272
41 272
42 272
43 2...

result:

ok 

Test #7:

score: 14
Accepted
time: 10ms
memory: 14004kb

input:

2000 3

output:

7608
0 262
1 262
2 262
3 262
4 262
5 262
6 262
7 262
8 262
9 262
10 262
11 262
12 262
13 262
14 262
15 262
16 262
17 262
18 262
19 262
20 262
21 262
22 262
23 262
24 262
25 262
26 262
27 262
28 262
29 262
30 262
31 262
32 262
33 262
34 262
35 262
36 262
37 262
38 262
39 262
40 262
41 262
42 262
43 2...

result:

ok 

Test #8:

score: 14
Accepted
time: 14ms
memory: 14180kb

input:

1999 3

output:

7608
0 267
1 267
2 267
3 267
4 267
5 267
6 267
7 267
8 267
9 267
10 267
11 267
12 267
13 267
14 267
15 267
16 267
17 267
18 267
19 267
20 267
21 267
22 267
23 267
24 267
25 267
26 267
27 267
28 267
29 267
30 267
31 267
32 267
33 267
34 267
35 267
36 267
37 267
38 267
39 267
40 267
41 267
42 267
43 2...

result:

ok 

Test #9:

score: 14
Accepted
time: 14ms
memory: 13828kb

input:

1992 3

output:

7577
0 276
1 276
2 276
3 276
4 276
5 276
6 276
7 276
8 276
9 276
10 276
11 276
12 276
13 276
14 276
15 276
16 276
17 276
18 276
19 276
20 276
21 276
22 276
23 276
24 276
25 276
26 276
27 276
28 276
29 276
30 276
31 276
32 276
33 276
34 276
35 276
36 276
37 276
38 276
39 276
40 276
41 276
42 276
43 2...

result:

ok 

Test #10:

score: 14
Accepted
time: 12ms
memory: 13312kb

input:

1973 3

output:

7497
0 266
1 266
2 266
3 266
4 266
5 266
6 266
7 266
8 266
9 266
10 266
11 266
12 266
13 266
14 266
15 266
16 266
17 266
18 266
19 266
20 266
21 266
22 266
23 266
24 266
25 266
26 266
27 266
28 266
29 266
30 266
31 266
32 266
33 266
34 266
35 266
36 266
37 266
38 266
39 266
40 266
41 266
42 266
43 2...

result:

ok 

Subtask #3:

score: 11
Accepted

Test #11:

score: 11
Accepted
time: 34ms
memory: 12772kb

input:

2000 4

output:

4792
0 40
1 40
2 40
3 40
4 40
5 40
6 40
7 40
8 40
9 40
10 40
11 40
12 40
13 40
14 40
15 40
16 40
17 40
18 40
19 40
20 40
21 40
22 40
23 40
24 40
25 40
26 40
27 40
28 40
29 40
30 40
31 40
32 40
33 40
34 40
35 40
36 40
37 40
38 40
0 5
1 5
2 5
3 5
34 36
34 37
34 38
34 39
6 8
5 7
5 8
8 10
10 12
12 14
14...

result:

ok 

Test #12:

score: 11
Accepted
time: 32ms
memory: 13028kb

input:

1999 4

output:

4789
0 39
1 39
2 39
3 39
4 39
5 39
6 39
7 39
8 39
9 39
10 39
11 39
12 39
13 39
14 39
15 39
16 39
17 39
18 39
19 39
20 39
21 39
22 39
23 39
24 39
25 39
26 39
27 39
28 39
29 39
30 39
31 39
32 39
33 39
34 39
35 39
36 39
37 39
0 5
1 5
2 5
3 5
33 35
33 36
33 37
33 38
5 7
7 9
9 11
11 13
13 15
15 17
17 19
...

result:

ok 

Test #13:

score: 11
Accepted
time: 27ms
memory: 12868kb

input:

1991 4

output:

4768
0 38
1 38
2 38
3 38
4 38
5 38
6 38
7 38
8 38
9 38
10 38
11 38
12 38
13 38
14 38
15 38
16 38
17 38
18 38
19 38
20 38
21 38
22 38
23 38
24 38
25 38
26 38
27 38
28 38
29 38
30 38
31 38
32 38
33 38
34 38
35 38
36 38
0 5
1 5
2 5
3 5
32 34
32 35
32 36
32 37
6 8
5 7
5 8
8 10
10 12
12 14
14 16
16 18
18...

result:

ok 

Test #14:

score: 11
Accepted
time: 30ms
memory: 13036kb

input:

1971 4

output:

4715
0 40
1 40
2 40
3 40
4 40
5 40
6 40
7 40
8 40
9 40
10 40
11 40
12 40
13 40
14 40
15 40
16 40
17 40
18 40
19 40
20 40
21 40
22 40
23 40
24 40
25 40
26 40
27 40
28 40
29 40
30 40
31 40
32 40
33 40
34 40
35 40
36 40
37 40
38 40
0 5
1 5
2 5
3 5
34 36
34 37
34 38
34 39
6 8
5 7
5 8
8 10
10 12
12 14
14...

result:

ok 

Test #15:

score: 11
Accepted
time: 29ms
memory: 12404kb

input:

1938 4

output:

4626
0 39
1 39
2 39
3 39
4 39
5 39
6 39
7 39
8 39
9 39
10 39
11 39
12 39
13 39
14 39
15 39
16 39
17 39
18 39
19 39
20 39
21 39
22 39
23 39
24 39
25 39
26 39
27 39
28 39
29 39
30 39
31 39
32 39
33 39
34 39
35 39
36 39
37 39
0 5
1 5
2 5
3 5
33 35
33 36
33 37
33 38
5 7
7 9
9 11
11 13
13 15
15 17
17 19
...

result:

ok 

Subtask #4:

score: 9
Accepted

Test #16:

score: 9
Accepted
time: 48ms
memory: 12348kb

input:

2000 5

output:

3922
0 34
1 34
2 34
3 34
4 34
5 34
6 34
7 34
8 34
9 34
10 34
11 34
12 34
13 34
14 34
15 34
16 34
17 34
18 34
19 34
20 34
21 34
22 34
23 34
24 34
25 34
26 34
27 34
28 34
29 34
30 34
31 34
32 34
0 5
1 5
2 5
3 5
27 29
27 30
27 31
27 32
27 33
5 7
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
...

result:

ok 

Test #17:

score: 9
Accepted
time: 46ms
memory: 12836kb

input:

1999 5

output:

3920
0 37
1 37
2 37
3 37
4 37
5 37
6 37
7 37
8 37
9 37
10 37
11 37
12 37
13 37
14 37
15 37
16 37
17 37
18 37
19 37
20 37
21 37
22 37
23 37
24 37
25 37
26 37
27 37
28 37
29 37
30 37
31 37
32 37
33 37
34 37
35 37
0 6
1 6
2 6
3 6
4 6
30 32
30 33
30 34
30 35
30 36
6 8
8 10
10 12
12 14
14 16
16 18
18 20
...

result:

ok 

Test #18:

score: 9
Accepted
time: 47ms
memory: 12888kb

input:

1992 5

output:

3906
0 37
1 37
2 37
3 37
4 37
5 37
6 37
7 37
8 37
9 37
10 37
11 37
12 37
13 37
14 37
15 37
16 37
17 37
18 37
19 37
20 37
21 37
22 37
23 37
24 37
25 37
26 37
27 37
28 37
29 37
30 37
31 37
32 37
33 37
34 37
35 37
0 6
1 6
2 6
3 6
4 6
30 32
30 33
30 34
30 35
30 36
6 8
8 10
10 12
12 14
14 16
16 18
18 20
...

result:

ok 

Test #19:

score: 9
Accepted
time: 51ms
memory: 12784kb

input:

1973 5

output:

3866
0 34
1 34
2 34
3 34
4 34
5 34
6 34
7 34
8 34
9 34
10 34
11 34
12 34
13 34
14 34
15 34
16 34
17 34
18 34
19 34
20 34
21 34
22 34
23 34
24 34
25 34
26 34
27 34
28 34
29 34
30 34
31 34
32 34
0 5
1 5
2 5
3 5
27 29
27 30
27 31
27 32
27 33
5 7
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
...

result:

ok 

Test #20:

score: 9
Accepted
time: 42ms
memory: 13456kb

input:

1936 5

output:

3792
0 37
1 37
2 37
3 37
4 37
5 37
6 37
7 37
8 37
9 37
10 37
11 37
12 37
13 37
14 37
15 37
16 37
17 37
18 37
19 37
20 37
21 37
22 37
23 37
24 37
25 37
26 37
27 37
28 37
29 37
30 37
31 37
32 37
33 37
34 37
35 37
0 6
1 6
2 6
3 6
4 6
30 32
30 33
30 34
30 35
30 36
6 8
8 10
10 12
12 14
14 16
16 18
18 20
...

result:

ok 

Subtask #5:

score: 7
Accepted

Test #21:

score: 7
Accepted
time: 53ms
memory: 10208kb

input:

2000 6

output:

3213
0 7
1 7
2 7
3 7
4 7
5 7
1993 1995
1993 1996
1993 1997
1993 1998
1993 1999
1993 2000
8 10
7 9
11 13
10 12
7 10
10 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73...

result:

ok 

Test #22:

score: 7
Accepted
time: 52ms
memory: 11376kb

input:

1997 6

output:

3208
0 7
1 7
2 7
3 7
4 7
5 7
1990 1992
1990 1993
1990 1994
1990 1995
1990 1996
1990 1997
8 10
7 9
11 13
10 12
14 16
13 15
7 10
10 13
13 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70...

result:

ok 

Test #23:

score: 7
Accepted
time: 51ms
memory: 10304kb

input:

1989 6

output:

3194
0 7
1 7
2 7
3 7
4 7
5 7
1982 1984
1982 1985
1982 1986
1982 1987
1982 1988
1982 1989
8 10
7 9
11 13
10 12
14 16
13 15
7 10
10 13
13 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70...

result:

ok 

Test #24:

score: 7
Accepted
time: 52ms
memory: 10252kb

input:

1972 6

output:

3164
0 7
1 7
2 7
3 7
4 7
5 7
1965 1967
1965 1968
1965 1969
1965 1970
1965 1971
1965 1972
8 10
7 9
11 13
10 12
7 10
10 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73...

result:

ok 

Test #25:

score: 7
Accepted
time: 50ms
memory: 10216kb

input:

1933 6

output:

3096
0 7
1 7
2 7
3 7
4 7
5 7
1926 1928
1926 1929
1926 1930
1926 1931
1926 1932
1926 1933
8 10
7 9
11 13
10 12
14 16
13 15
7 10
10 13
13 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70...

result:

ok 

Subtask #6:

score: 6
Accepted

Test #26:

score: 6
Accepted
time: 58ms
memory: 9912kb

input:

1999 7

output:

2901
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1991 1993
1991 1994
1991 1995
1991 1996
1991 1997
1991 1998
1991 1999
9 11
8 10
8 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71...

result:

ok 

Test #27:

score: 6
Accepted
time: 57ms
memory: 10104kb

input:

1997 7

output:

2898
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1989 1991
1989 1992
1989 1993
1989 1994
1989 1995
1989 1996
1989 1997
9 11
8 10
8 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71...

result:

ok 

Test #28:

score: 6
Accepted
time: 57ms
memory: 10000kb

input:

1987 7

output:

2883
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1979 1981
1979 1982
1979 1983
1979 1984
1979 1985
1979 1986
1979 1987
9 11
8 10
8 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71...

result:

ok 

Test #29:

score: 6
Accepted
time: 57ms
memory: 11944kb

input:

1978 7

output:

2869
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1970 1972
1970 1973
1970 1974
1970 1975
1970 1976
1970 1977
1970 1978
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
...

result:

ok 

Test #30:

score: 6
Accepted
time: 55ms
memory: 10028kb

input:

1931 7

output:

2799
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1923 1925
1923 1926
1923 1927
1923 1928
1923 1929
1923 1930
1923 1931
9 11
8 10
8 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71...

result:

ok 

Subtask #7:

score: 5
Accepted

Test #31:

score: 5
Accepted
time: 63ms
memory: 10212kb

input:

1995 8

output:

2501
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1986 1988
1986 1989
1986 1990
1986 1991
1986 1992
1986 1993
1986 1994
1986 1995
10 12
9 11
9 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68...

result:

ok 

Test #32:

score: 5
Accepted
time: 63ms
memory: 10560kb

input:

1999 8

output:

2506
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1990 1992
1990 1993
1990 1994
1990 1995
1990 1996
1990 1997
1990 1998
1990 1999
10 12
9 11
9 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68...

result:

ok 

Test #33:

score: 5
Accepted
time: 63ms
memory: 10216kb

input:

1987 8

output:

2490
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1978 1980
1978 1981
1978 1982
1978 1983
1978 1984
1978 1985
1978 1986
1978 1987
10 12
9 11
9 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68...

result:

ok 

Test #34:

score: 5
Accepted
time: 66ms
memory: 10120kb

input:

1981 8

output:

2481
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1972 1974
1972 1975
1972 1976
1972 1977
1972 1978
1972 1979
1972 1980
1972 1981
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70...

result:

ok 

Test #35:

score: 5
Accepted
time: 61ms
memory: 11644kb

input:

1923 8

output:

2405
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1914 1916
1914 1917
1914 1918
1914 1919
1914 1920
1914 1921
1914 1922
1914 1923
10 12
9 11
9 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68...

result:

ok 

Subtask #8:

score: 5
Accepted

Test #36:

score: 5
Accepted
time: 69ms
memory: 10304kb

input:

1997 9

output:

2392
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1987 1989
1987 1990
1987 1991
1987 1992
1987 1993
1987 1994
1987 1995
1987 1996
1987 1997
11 13
10 12
10 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 6...

result:

ok 

Test #37:

score: 5
Accepted
time: 70ms
memory: 12004kb

input:

1998 9

output:

2393
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1988 1990
1988 1991
1988 1992
1988 1993
1988 1994
1988 1995
1988 1996
1988 1997
1988 1998
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 6...

result:

ok 

Test #38:

score: 5
Accepted
time: 68ms
memory: 10384kb

input:

1990 9

output:

2383
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1980 1982
1980 1983
1980 1984
1980 1985
1980 1986
1980 1987
1980 1988
1980 1989
1980 1990
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 6...

result:

ok 

Test #39:

score: 5
Accepted
time: 69ms
memory: 10368kb

input:

1975 9

output:

2364
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1965 1967
1965 1968
1965 1969
1965 1970
1965 1971
1965 1972
1965 1973
1965 1974
1965 1975
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
...

result:

ok 

Test #40:

score: 5
Accepted
time: 71ms
memory: 12016kb

input:

1934 9

output:

2313
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1924 1926
1924 1927
1924 1928
1924 1929
1924 1930
1924 1931
1924 1932
1924 1933
1924 1934
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 6...

result:

ok 

Subtask #9:

score: 4
Accepted

Test #41:

score: 4
Accepted
time: 86ms
memory: 10216kb

input:

1995 10

output:

2193
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1984 1986
1984 1987
1984 1988
1984 1989
1984 1990
1984 1991
1984 1992
1984 1993
1984 1994
1984 1995
12 14
11 13
11 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
5...

result:

ok 

Test #42:

score: 4
Accepted
time: 86ms
memory: 10092kb

input:

1996 10

output:

2194
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1985 1987
1985 1988
1985 1989
1985 1990
1985 1991
1985 1992
1985 1993
1985 1994
1985 1995
1985 1996
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
5...

result:

ok 

Test #43:

score: 4
Accepted
time: 93ms
memory: 10416kb

input:

1979 10

output:

2175
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1968 1970
1968 1971
1968 1972
1968 1973
1968 1974
1968 1975
1968 1976
1968 1977
1968 1978
1968 1979
12 14
11 13
11 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
5...

result:

ok 

Test #44:

score: 4
Accepted
time: 93ms
memory: 10268kb

input:

1972 10

output:

2166
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1961 1963
1961 1964
1961 1965
1961 1966
1961 1967
1961 1968
1961 1969
1961 1970
1961 1971
1961 1972
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
5...

result:

ok 

Test #45:

score: 4
Accepted
time: 91ms
memory: 11748kb

input:

1945 10

output:

2135
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1934 1936
1934 1937
1934 1938
1934 1939
1934 1940
1934 1941
1934 1942
1934 1943
1934 1944
1934 1945
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
...

result:

ok 

Subtask #10:

score: 4
Accepted

Test #46:

score: 4
Accepted
time: 106ms
memory: 10380kb

input:

1993 11

output:

2133
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1981 1983
1981 1984
1981 1985
1981 1986
1981 1987
1981 1988
1981 1989
1981 1990
1981 1991
1981 1992
1981 1993
13 15
12 14
12 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 ...

result:

ok 

Test #47:

score: 4
Accepted
time: 111ms
memory: 10288kb

input:

1994 11

output:

2134
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1982 1984
1982 1985
1982 1986
1982 1987
1982 1988
1982 1989
1982 1990
1982 1991
1982 1992
1982 1993
1982 1994
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 ...

result:

ok 

Test #48:

score: 4
Accepted
time: 111ms
memory: 10424kb

input:

2000 11

output:

2140
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1988 1990
1988 1991
1988 1992
1988 1993
1988 1994
1988 1995
1988 1996
1988 1997
1988 1998
1988 1999
1988 2000
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 ...

result:

ok 

Test #49:

score: 4
Accepted
time: 113ms
memory: 10424kb

input:

1972 11

output:

2109
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1960 1962
1960 1963
1960 1964
1960 1965
1960 1966
1960 1967
1960 1968
1960 1969
1960 1970
1960 1971
1960 1972
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 ...

result:

ok 

Test #50:

score: 4
Accepted
time: 108ms
memory: 10320kb

input:

1944 11

output:

2077
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1932 1934
1932 1935
1932 1936
1932 1937
1932 1938
1932 1939
1932 1940
1932 1941
1932 1942
1932 1943
1932 1944
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 ...

result:

ok 

Subtask #11:

score: 4
Accepted

Test #51:

score: 4
Accepted
time: 132ms
memory: 10176kb

input:

1999 12

output:

2067
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1986 1988
1986 1989
1986 1990
1986 1991
1986 1992
1986 1993
1986 1994
1986 1995
1986 1996
1986 1997
1986 1998
1986 1999
14 16
13 15
13 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48...

result:

ok 

Test #52:

score: 4
Accepted
time: 136ms
memory: 12192kb

input:

2000 12

output:

2068
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1987 1989
1987 1990
1987 1991
1987 1992
1987 1993
1987 1994
1987 1995
1987 1996
1987 1997
1987 1998
1987 1999
1987 2000
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51...

result:

ok 

Test #53:

score: 4
Accepted
time: 131ms
memory: 11684kb

input:

1989 12

output:

2056
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1976 1978
1976 1979
1976 1980
1976 1981
1976 1982
1976 1983
1976 1984
1976 1985
1976 1986
1976 1987
1976 1988
1976 1989
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52...

result:

ok 

Test #54:

score: 4
Accepted
time: 130ms
memory: 10344kb

input:

1976 12

output:

2042
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1963 1965
1963 1966
1963 1967
1963 1968
1963 1969
1963 1970
1963 1971
1963 1972
1963 1973
1963 1974
1963 1975
1963 1976
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51...

result:

ok 

Test #55:

score: 4
Accepted
time: 129ms
memory: 11756kb

input:

1949 12

output:

2013
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1936 1938
1936 1939
1936 1940
1936 1941
1936 1942
1936 1943
1936 1944
1936 1945
1936 1946
1936 1947
1936 1948
1936 1949
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52...

result:

ok 

Subtask #12:

score: 3
Accepted

Test #56:

score: 3
Accepted
time: 151ms
memory: 10456kb

input:

1981 13

output:

2004
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1967 1969
1967 1970
1967 1971
1967 1972
1967 1973
1967 1974
1967 1975
1967 1976
1967 1977
1967 1978
1967 1979
1967 1980
1967 1981
15 17
14 16
14 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
4...

result:

ok 

Test #57:

score: 3
Accepted
time: 155ms
memory: 10532kb

input:

1982 13

output:

2005
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1968 1970
1968 1971
1968 1972
1968 1973
1968 1974
1968 1975
1968 1976
1968 1977
1968 1978
1968 1979
1968 1980
1968 1981
1968 1982
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
4...

result:

ok 

Test #58:

score: 3
Accepted
time: 153ms
memory: 10540kb

input:

1989 13

output:

2012
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1975 1977
1975 1978
1975 1979
1975 1980
1975 1981
1975 1982
1975 1983
1975 1984
1975 1985
1975 1986
1975 1987
1975 1988
1975 1989
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
4...

result:

ok 

Test #59:

score: 3
Accepted
time: 156ms
memory: 10448kb

input:

1972 13

output:

1994
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1958 1960
1958 1961
1958 1962
1958 1963
1958 1964
1958 1965
1958 1966
1958 1967
1958 1968
1958 1969
1958 1970
1958 1971
1958 1972
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
4...

result:

ok 

Test #60:

score: 3
Accepted
time: 151ms
memory: 11792kb

input:

1929 13

output:

1949
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1915 1917
1915 1918
1915 1919
1915 1920
1915 1921
1915 1922
1915 1923
1915 1924
1915 1925
1915 1926
1915 1927
1915 1928
1915 1929
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
4...

result:

ok 

Subtask #13:

score: 3
Accepted

Test #61:

score: 3
Accepted
time: 187ms
memory: 10344kb

input:

1979 14

output:

1981
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1964 1966
1964 1967
1964 1968
1964 1969
1964 1970
1964 1971
1964 1972
1964 1973
1964 1974
1964 1975
1964 1976
1964 1977
1964 1978
1964 1979
16 18
15 17
15 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 ...

result:

ok 

Test #62:

score: 3
Accepted
time: 186ms
memory: 11152kb

input:

1980 14

output:

1982
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1965 1967
1965 1968
1965 1969
1965 1970
1965 1971
1965 1972
1965 1973
1965 1974
1965 1975
1965 1976
1965 1977
1965 1978
1965 1979
1965 1980
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 ...

result:

ok 

Test #63:

score: 3
Accepted
time: 188ms
memory: 12500kb

input:

1987 14

output:

1989
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1972 1974
1972 1975
1972 1976
1972 1977
1972 1978
1972 1979
1972 1980
1972 1981
1972 1982
1972 1983
1972 1984
1972 1985
1972 1986
1972 1987
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 ...

result:

ok 

Test #64:

score: 3
Accepted
time: 188ms
memory: 10556kb

input:

1952 14

output:

1953
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1937 1939
1937 1940
1937 1941
1937 1942
1937 1943
1937 1944
1937 1945
1937 1946
1937 1947
1937 1948
1937 1949
1937 1950
1937 1951
1937 1952
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 ...

result:

ok 

Test #65:

score: 3
Accepted
time: 182ms
memory: 11360kb

input:

1936 14

output:

1936
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1921 1923
1921 1924
1921 1925
1921 1926
1921 1927
1921 1928
1921 1929
1921 1930
1921 1931
1921 1932
1921 1933
1921 1934
1921 1935
1921 1936
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 ...

result:

ok 

Subtask #14:

score: 3
Accepted

Test #66:

score: 3
Accepted
time: 232ms
memory: 10548kb

input:

2000 15

output:

1988
0 16
1 16
2 16
3 16
4 16
5 16
6 16
7 16
8 16
9 16
10 16
11 16
12 16
13 16
14 16
1984 1986
1984 1987
1984 1988
1984 1989
1984 1990
1984 1991
1984 1992
1984 1993
1984 1994
1984 1995
1984 1996
1984 1997
1984 1998
1984 1999
1984 2000
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38...

result:

ok 

Test #67:

score: 3
Accepted
time: 231ms
memory: 11496kb

input:

1999 15

output:

1987
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1983 1985
1983 1986
1983 1987
1983 1988
1983 1989
1983 1990
1983 1991
1983 1992
1983 1993
1983 1994
1983 1995
1983 1996
1983 1997
1983 1998
1983 1999
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39...

result:

ok 

Test #68:

score: 3
Accepted
time: 230ms
memory: 10736kb

input:

1992 15

output:

1980
0 16
1 16
2 16
3 16
4 16
5 16
6 16
7 16
8 16
9 16
10 16
11 16
12 16
13 16
14 16
1976 1978
1976 1979
1976 1980
1976 1981
1976 1982
1976 1983
1976 1984
1976 1985
1976 1986
1976 1987
1976 1988
1976 1989
1976 1990
1976 1991
1976 1992
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38...

result:

ok 

Test #69:

score: 3
Accepted
time: 225ms
memory: 10448kb

input:

1973 15

output:

1961
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1957 1959
1957 1960
1957 1961
1957 1962
1957 1963
1957 1964
1957 1965
1957 1966
1957 1967
1957 1968
1957 1969
1957 1970
1957 1971
1957 1972
1957 1973
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39...

result:

ok 

Test #70:

score: 3
Accepted
time: 227ms
memory: 11140kb

input:

1936 15

output:

1923
0 16
1 16
2 16
3 16
4 16
5 16
6 16
7 16
8 16
9 16
10 16
11 16
12 16
13 16
14 16
1920 1922
1920 1923
1920 1924
1920 1925
1920 1926
1920 1927
1920 1928
1920 1929
1920 1930
1920 1931
1920 1932
1920 1933
1920 1934
1920 1935
1920 1936
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38...

result:

ok