QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#488168#8726. Magic ShowAdorable5 1ms3792kbC++231.5kb2024-07-23 17:18:152024-07-23 17:18:16

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1868kb,3788kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2 4005
3 1
4 1
5 4005
6 1
7 1
8 4005
9 4005
10 1
11 4005
12 4005
13 4005
14 4005
15 4005
16 1
17 1
18 1
19 4005
20 4005
21 4005
22 1
23 4005
24 1
25 1
26 4005
27 40...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2 4005
3 1
4 1
5 4005
6 1
7 1
8 4005
9 4005
10 1
11 4005
12 4005
13 4005
14 4005
15 4005
16 1
17 1
18 1
19 4005
20 4005
21 4005
22 1
23 4005
24 1
25 1
26 4005
27 40...

output:

2
5000 4136
1 3
1 4
1 6
1 7
1 10
1 16
1 24
1 25
1 30
1 31
1 33
1 37
1 38
1 39
1 42
1 44
1 49
1 59
1 64
1 68
1 70
1 72
1 79
1 80
1 81
1 86
1 91
1 92
1 94
1 97
1 101
1 103
1 105
1 106
1 107
1 115
1 127
1 129
1 131
1 132
1 141
1 144
1 153
1 154
1 156
1 159
1 162
1 165
1 167
1 170
1 172
1 176
1 178
1 18...

input:

2
5000 4136
1 3
1 4
1 6
1 7
1 10
1 16
1 24
1 25
1 30
1 31
1 33
1 37
1 38
1 39
1 42
1 44
1 49
1 59
1 64
1 68
1 70
1 72
1 79
1 80
1 81
1 86
1 91
1 92
1 94
1 97
1 101
1 103
1 105
1 106
1 107
1 115
1 127
1 129
1 131
1 132
1 141
1 144
1 153
1 154
1 156
1 159
1 162
1 165
1 167
1 170
1 172
1 176
1 178
1 18...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1864kb,3792kb

input:

1
459

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2 459
3 1
4 1
5 459
6 1
7 1
8 459
9 459
10 1
11 459
12 459
13 459
14 459
15 459
16 1
17 1
18 1
19 459
20 459
21 459
22 1
23 459
24 1
25 1
26 459
27 459
28 459
29 45...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2 459
3 1
4 1
5 459
6 1
7 1
8 459
9 459
10 1
11 459
12 459
13 459
14 459
15 459
16 1
17 1
18 1
19 459
20 459
21 459
22 1
23 459
24 1
25 1
26 459
27 459
28 459
29 45...

output:

2
5000 4136
1 3
1 4
1 6
1 7
1 10
1 16
1 24
1 25
1 30
1 31
1 33
1 37
1 38
1 39
1 42
1 44
1 49
1 59
1 64
1 68
1 70
1 72
1 79
1 80
1 81
1 86
1 91
1 92
1 94
1 97
1 101
1 103
1 105
1 106
1 107
1 115
1 127
1 129
1 131
1 132
1 141
1 144
1 153
1 154
1 156
1 159
1 162
1 165
1 167
1 170
1 172
1 176
1 178
1 18...

input:

2
5000 4136
1 3
1 4
1 6
1 7
1 10
1 16
1 24
1 25
1 30
1 31
1 33
1 37
1 38
1 39
1 42
1 44
1 49
1 59
1 64
1 68
1 70
1 72
1 79
1 80
1 81
1 86
1 91
1 92
1 94
1 97
1 101
1 103
1 105
1 106
1 107
1 115
1 127
1 129
1 131
1 132
1 141
1 144
1 153
1 154
1 156
1 159
1 162
1 165
1 167
1 170
1 172
1 176
1 178
1 18...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1872kb,3788kb

input:

1
2495

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2 2495
3 1
4 1
5 2495
6 1
7 1
8 2495
9 2495
10 1
11 2495
12 2495
13 2495
14 2495
15 2495
16 1
17 1
18 1
19 2495
20 2495
21 2495
22 1
23 2495
24 1
25 1
26 2495
27 24...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2 2495
3 1
4 1
5 2495
6 1
7 1
8 2495
9 2495
10 1
11 2495
12 2495
13 2495
14 2495
15 2495
16 1
17 1
18 1
19 2495
20 2495
21 2495
22 1
23 2495
24 1
25 1
26 2495
27 24...

output:

2
5000 4136
1 3
1 4
1 6
1 7
1 10
1 16
1 24
1 25
1 30
1 31
1 33
1 37
1 38
1 39
1 42
1 44
1 49
1 59
1 64
1 68
1 70
1 72
1 79
1 80
1 81
1 86
1 91
1 92
1 94
1 97
1 101
1 103
1 105
1 106
1 107
1 115
1 127
1 129
1 131
1 132
1 141
1 144
1 153
1 154
1 156
1 159
1 162
1 165
1 167
1 170
1 172
1 176
1 178
1 18...

input:

2
5000 4136
1 3
1 4
1 6
1 7
1 10
1 16
1 24
1 25
1 30
1 31
1 33
1 37
1 38
1 39
1 42
1 44
1 49
1 59
1 64
1 68
1 70
1 72
1 79
1 80
1 81
1 86
1 91
1 92
1 94
1 97
1 101
1 103
1 105
1 106
1 107
1 115
1 127
1 129
1 131
1 132
1 141
1 144
1 153
1 154
1 156
1 159
1 162
1 165
1 167
1 170
1 172
1 176
1 178
1 18...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1872kb,3768kb

input:

3
1560

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2 1560
3 1
4 1
5 1560
6 1
7 1
8 1560
9 1560
10 1
11 1560
12 1560
13 1560
14 1560
15 1560
16 1
17 1
18 1
19 1560
20 1560
21 1560
22 1
23 1560
24 1
25 1
26 1560
27 15...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2 1560
3 1
4 1
5 1560
6 1
7 1
8 1560
9 1560
10 1
11 1560
12 1560
13 1560
14 1560
15 1560
16 1
17 1
18 1
19 1560
20 1560
21 1560
22 1
23 1560
24 1
25 1
26 1560
27 15...

output:

4
5000 3322
1 1560
2 1560
5 1560
8 1560
9 1560
11 1560
12 1560
13 1560
14 1560
15 1560
19 1560
20 1560
21 1560
23 1560
26 1560
27 1560
28 1560
29 1560
32 1560
34 1560
36 1560
40 1560
41 1560
43 1560
45 1560
46 1560
47 1560
48 1560
50 1560
52 1560
53 1560
54 1560
56 1560
58 1560
60 1560
61 1560
62 15...

input:

4
5000 3322
1 1560
2 1560
5 1560
8 1560
9 1560
11 1560
12 1560
13 1560
14 1560
15 1560
19 1560
20 1560
21 1560
23 1560
26 1560
27 1560
28 1560
29 1560
32 1560
34 1560
36 1560
40 1560
41 1560
43 1560
45 1560
46 1560
47 1560
48 1560
50 1560
52 1560
53 1560
54 1560
56 1560
58 1560
60 1560
61 1560
62 15...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,3772kb

input:

3
3594

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2 3594
3 1
4 1
5 3594
6 1
7 1
8 3594
9 3594
10 1
11 3594
12 3594
13 3594
14 3594
15 3594
16 1
17 1
18 1
19 3594
20 3594
21 3594
22 1
23 3594
24 1
25 1
26 3594
27 35...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2 3594
3 1
4 1
5 3594
6 1
7 1
8 3594
9 3594
10 1
11 3594
12 3594
13 3594
14 3594
15 3594
16 1
17 1
18 1
19 3594
20 3594
21 3594
22 1
23 3594
24 1
25 1
26 3594
27 35...

output:

4
5000 3322
1 3594
2 3594
5 3594
8 3594
9 3594
11 3594
12 3594
13 3594
14 3594
15 3594
19 3594
20 3594
21 3594
23 3594
26 3594
27 3594
28 3594
29 3594
32 3594
34 3594
36 3594
40 3594
41 3594
43 3594
45 3594
46 3594
47 3594
48 3594
50 3594
52 3594
53 3594
54 3594
56 3594
58 3594
60 3594
61 3594
62 35...

input:

4
5000 3322
1 3594
2 3594
5 3594
8 3594
9 3594
11 3594
12 3594
13 3594
14 3594
15 3594
19 3594
20 3594
21 3594
23 3594
26 3594
27 3594
28 3594
29 3594
32 3594
34 3594
36 3594
40 3594
41 3594
43 3594
45 3594
46 3594
47 3594
48 3594
50 3594
52 3594
53 3594
54 3594
56 3594
58 3594
60 3594
61 3594
62 35...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1864kb,3776kb

input:

3
1750

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2 1750
3 1
4 1
5 1750
6 1
7 1
8 1750
9 1750
10 1
11 1750
12 1750
13 1750
14 1750
15 1750
16 1
17 1
18 1
19 1750
20 1750
21 1750
22 1
23 1750
24 1
25 1
26 1750
27 17...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2 1750
3 1
4 1
5 1750
6 1
7 1
8 1750
9 1750
10 1
11 1750
12 1750
13 1750
14 1750
15 1750
16 1
17 1
18 1
19 1750
20 1750
21 1750
22 1
23 1750
24 1
25 1
26 1750
27 17...

output:

4
5000 3322
1 1750
2 1750
5 1750
8 1750
9 1750
11 1750
12 1750
13 1750
14 1750
15 1750
19 1750
20 1750
21 1750
23 1750
26 1750
27 1750
28 1750
29 1750
32 1750
34 1750
36 1750
40 1750
41 1750
43 1750
45 1750
46 1750
47 1750
48 1750
50 1750
52 1750
53 1750
54 1750
56 1750
58 1750
60 1750
61 1750
62 17...

input:

4
5000 3322
1 1750
2 1750
5 1750
8 1750
9 1750
11 1750
12 1750
13 1750
14 1750
15 1750
19 1750
20 1750
21 1750
23 1750
26 1750
27 1750
28 1750
29 1750
32 1750
34 1750
36 1750
40 1750
41 1750
43 1750
45 1750
46 1750
47 1750
48 1750
50 1750
52 1750
53 1750
54 1750
56 1750
58 1750
60 1750
61 1750
62 17...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1864kb,3772kb

input:

5
4878

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2 4878
3 1
4 1
5 4878
6 1
7 1
8 4878
9 4878
10 1
11 4878
12 4878
13 4878
14 4878
15 4878
16 1
17 1
18 1
19 4878
20 4878
21 4878
22 1
23 4878
24 1
25 1
26 4878
27 48...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2 4878
3 1
4 1
5 4878
6 1
7 1
8 4878
9 4878
10 1
11 4878
12 4878
13 4878
14 4878
15 4878
16 1
17 1
18 1
19 4878
20 4878
21 4878
22 1
23 4878
24 1
25 1
26 4878
27 48...

output:

6
5000 3322
1 4878
5 4878
8 4878
9 4878
11 4878
12 4878
13 4878
14 4878
15 4878
19 4878
20 4878
21 4878
23 4878
26 4878
27 4878
28 4878
29 4878
32 4878
34 4878
36 4878
40 4878
41 4878
43 4878
45 4878
46 4878
47 4878
48 4878
50 4878
52 4878
53 4878
54 4878
56 4878
58 4878
60 4878
61 4878
62 4878
63 4...

input:

6
5000 3322
1 4878
5 4878
8 4878
9 4878
11 4878
12 4878
13 4878
14 4878
15 4878
19 4878
20 4878
21 4878
23 4878
26 4878
27 4878
28 4878
29 4878
32 4878
34 4878
36 4878
40 4878
41 4878
43 4878
45 4878
46 4878
47 4878
48 4878
50 4878
52 4878
53 4878
54 4878
56 4878
58 4878
60 4878
61 4878
62 4878
63 4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1872kb,3772kb

input:

5
1223

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2 1223
3 1
4 1
5 1223
6 1
7 1
8 1223
9 1223
10 1
11 1223
12 1223
13 1223
14 1223
15 1223
16 1
17 1
18 1
19 1223
20 1223
21 1223
22 1
23 1223
24 1
25 1
26 1223
27 12...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2 1223
3 1
4 1
5 1223
6 1
7 1
8 1223
9 1223
10 1
11 1223
12 1223
13 1223
14 1223
15 1223
16 1
17 1
18 1
19 1223
20 1223
21 1223
22 1
23 1223
24 1
25 1
26 1223
27 12...

output:

6
5000 3322
1 1223
5 1223
8 1223
9 1223
11 1223
12 1223
13 1223
14 1223
15 1223
19 1223
20 1223
21 1223
23 1223
26 1223
27 1223
28 1223
29 1223
32 1223
34 1223
36 1223
40 1223
41 1223
43 1223
45 1223
46 1223
47 1223
48 1223
50 1223
52 1223
53 1223
54 1223
56 1223
58 1223
60 1223
61 1223
62 1223
63 1...

input:

6
5000 3322
1 1223
5 1223
8 1223
9 1223
11 1223
12 1223
13 1223
14 1223
15 1223
19 1223
20 1223
21 1223
23 1223
26 1223
27 1223
28 1223
29 1223
32 1223
34 1223
36 1223
40 1223
41 1223
43 1223
45 1223
46 1223
47 1223
48 1223
50 1223
52 1223
53 1223
54 1223
56 1223
58 1223
60 1223
61 1223
62 1223
63 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1864kb,3772kb

input:

5
648

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2 648
3 1
4 1
5 648
6 1
7 1
8 648
9 648
10 1
11 648
12 648
13 648
14 648
15 648
16 1
17 1
18 1
19 648
20 648
21 648
22 1
23 648
24 1
25 1
26 648
27 648
28 648
29 64...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2 648
3 1
4 1
5 648
6 1
7 1
8 648
9 648
10 1
11 648
12 648
13 648
14 648
15 648
16 1
17 1
18 1
19 648
20 648
21 648
22 1
23 648
24 1
25 1
26 648
27 648
28 648
29 64...

output:

6
5000 3322
1 648
5 648
8 648
9 648
11 648
12 648
13 648
14 648
15 648
19 648
20 648
21 648
23 648
26 648
27 648
28 648
29 648
32 648
34 648
36 648
40 648
41 648
43 648
45 648
46 648
47 648
48 648
50 648
52 648
53 648
54 648
56 648
58 648
60 648
61 648
62 648
63 648
65 648
66 648
67 648
69 648
71 64...

input:

6
5000 3322
1 648
5 648
8 648
9 648
11 648
12 648
13 648
14 648
15 648
19 648
20 648
21 648
23 648
26 648
27 648
28 648
29 648
32 648
34 648
36 648
40 648
41 648
43 648
45 648
46 648
47 648
48 648
50 648
52 648
53 648
54 648
56 648
58 648
60 648
61 648
62 648
63 648
65 648
66 648
67 648
69 648
71 64...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1872kb,3760kb

input:

7
4475

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2 4475
3 1
4 1
5 4475
6 1
7 1
8 4475
9 4475
10 1
11 4475
12 4475
13 4475
14 4475
15 4475
16 1
17 1
18 1
19 4475
20 4475
21 4475
22 1
23 4475
24 1
25 1
26 4475
27 44...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2 4475
3 1
4 1
5 4475
6 1
7 1
8 4475
9 4475
10 1
11 4475
12 4475
13 4475
14 4475
15 4475
16 1
17 1
18 1
19 4475
20 4475
21 4475
22 1
23 4475
24 1
25 1
26 4475
27 44...

output:

8
5000 2500
2 4475
8 4475
9 4475
11 4475
13 4475
15 4475
21 4475
23 4475
26 4475
27 4475
29 4475
34 4475
36 4475
40 4475
41 4475
46 4475
47 4475
50 4475
52 4475
53 4475
54 4475
58 4475
60 4475
61 4475
63 4475
66 4475
67 4475
73 4475
74 4475
75 4475
76 4475
77 4475
83 4475
84 4475
85 4475
87 4475
88 ...

input:

8
5000 2500
2 4475
8 4475
9 4475
11 4475
13 4475
15 4475
21 4475
23 4475
26 4475
27 4475
29 4475
34 4475
36 4475
40 4475
41 4475
46 4475
47 4475
50 4475
52 4475
53 4475
54 4475
58 4475
60 4475
61 4475
63 4475
66 4475
67 4475
73 4475
74 4475
75 4475
76 4475
77 4475
83 4475
84 4475
85 4475
87 4475
88 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1864kb,3756kb

input:

7
4240

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2 4240
3 1
4 1
5 4240
6 1
7 1
8 4240
9 4240
10 1
11 4240
12 4240
13 4240
14 4240
15 4240
16 1
17 1
18 1
19 4240
20 4240
21 4240
22 1
23 4240
24 1
25 1
26 4240
27 42...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2 4240
3 1
4 1
5 4240
6 1
7 1
8 4240
9 4240
10 1
11 4240
12 4240
13 4240
14 4240
15 4240
16 1
17 1
18 1
19 4240
20 4240
21 4240
22 1
23 4240
24 1
25 1
26 4240
27 42...

output:

8
5000 2500
2 4240
8 4240
9 4240
11 4240
13 4240
15 4240
21 4240
23 4240
26 4240
27 4240
29 4240
34 4240
36 4240
40 4240
41 4240
46 4240
47 4240
50 4240
52 4240
53 4240
54 4240
58 4240
60 4240
61 4240
63 4240
66 4240
67 4240
73 4240
74 4240
75 4240
76 4240
77 4240
83 4240
84 4240
85 4240
87 4240
88 ...

input:

8
5000 2500
2 4240
8 4240
9 4240
11 4240
13 4240
15 4240
21 4240
23 4240
26 4240
27 4240
29 4240
34 4240
36 4240
40 4240
41 4240
46 4240
47 4240
50 4240
52 4240
53 4240
54 4240
58 4240
60 4240
61 4240
63 4240
66 4240
67 4240
73 4240
74 4240
75 4240
76 4240
77 4240
83 4240
84 4240
85 4240
87 4240
88 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1868kb,3760kb

input:

7
1291

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2 1291
3 1
4 1
5 1291
6 1
7 1
8 1291
9 1291
10 1
11 1291
12 1291
13 1291
14 1291
15 1291
16 1
17 1
18 1
19 1291
20 1291
21 1291
22 1
23 1291
24 1
25 1
26 1291
27 12...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2 1291
3 1
4 1
5 1291
6 1
7 1
8 1291
9 1291
10 1
11 1291
12 1291
13 1291
14 1291
15 1291
16 1
17 1
18 1
19 1291
20 1291
21 1291
22 1
23 1291
24 1
25 1
26 1291
27 12...

output:

8
5000 2500
2 1291
8 1291
9 1291
11 1291
13 1291
15 1291
21 1291
23 1291
26 1291
27 1291
29 1291
34 1291
36 1291
40 1291
41 1291
46 1291
47 1291
50 1291
52 1291
53 1291
54 1291
58 1291
60 1291
61 1291
63 1291
66 1291
67 1291
73 1291
74 1291
75 1291
76 1291
77 1291
83 1291
84 1291
85 1291
87 1291
88 ...

input:

8
5000 2500
2 1291
8 1291
9 1291
11 1291
13 1291
15 1291
21 1291
23 1291
26 1291
27 1291
29 1291
34 1291
36 1291
40 1291
41 1291
46 1291
47 1291
50 1291
52 1291
53 1291
54 1291
58 1291
60 1291
61 1291
63 1291
66 1291
67 1291
73 1291
74 1291
75 1291
76 1291
77 1291
83 1291
84 1291
85 1291
87 1291
88 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1872kb,1776kb

input:

1
17476204

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1868kb,1776kb

input:

1
355365355024496523

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Number of edges returned by Alice() is not n-1.