QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#439478#8726. Magic Showahihi1234100 ✓7ms14584kbC++144.7kb2024-06-12 00:47:582024-06-12 00:47:58

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2008kb,14576kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 2177
11 4776
12 3311
13 1989
16 768
17 4669
18 26
18 121
18 244
18 416
18 512
18 522
18 626
18 766
18 797
18 884
18 899
18 901
18 915
18 933
18 1053
18 1092
18 1246
18 1310
18 1352
18 1395
18 1506
18 1543
18 1727
18 1778
18 1805
18 1823
18...

input:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 2177
11 4776
12 3311
13 1989
16 768
17 4669
18 26
18 121
18 244
18 416
18 512
18 522
18 626
18 766
18 797
18 884
18 899
18 901
18 915
18 933
18 1053
18 1092
18 1246
18 1310
18 1352
18 1395
18 1506
18 1543
18 1727
18 1778
18 1805
18 1823
18...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2000kb,14580kb

input:

1
459

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 1468
7 3311
8 4383
10 2177
11 1536
12 924
13 1101
16 4383
17 4669
18 26
18 121
18 416
18 512
18 522
18 626
18 766
18 884
18 899
18 901
18 933
18 1049
18 1053
18 1092
18 1246
18 1352
18 1380
18 1395
18 1506
18 1543
18 1727
18 1778
18 1823
18 1824
18 1939
18 2257...

input:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 1468
7 3311
8 4383
10 2177
11 1536
12 924
13 1101
16 4383
17 4669
18 26
18 121
18 416
18 512
18 522
18 626
18 766
18 884
18 899
18 901
18 933
18 1049
18 1053
18 1092
18 1246
18 1352
18 1380
18 1395
18 1506
18 1543
18 1727
18 1778
18 1823
18 1824
18 1939
18 2257...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2000kb,14580kb

input:

1
2495

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 2177
11 4776
12 3311
13 1101
16 768
17 4669
18 26
18 121
18 244
18 416
18 512
18 766
18 797
18 884
18 901
18 933
18 1053
18 1092
18 1138
18 1246
18 1310
18 1352
18 1380
18 1395
18 1506
18 1543
18 1727
18 1778
18 1805
18 1823
18 1824
18 193...

input:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 2177
11 4776
12 3311
13 1101
16 768
17 4669
18 26
18 121
18 244
18 416
18 512
18 766
18 797
18 884
18 901
18 933
18 1053
18 1092
18 1138
18 1246
18 1310
18 1352
18 1380
18 1395
18 1506
18 1543
18 1727
18 1778
18 1805
18 1823
18 1824
18 193...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12064kb

input:

3
1560

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

4
5000 2500
1 1054
2 947
5 4309
7 3311
11 4776
12 924
13 1989
17 4669
24 4598
27 1247
29 3311
32 3311
34 3493
37 74
37 205
37 206
37 218
37 268
37 277
37 304
37 312
37 438
37 550
37 659
37 674
37 719
37 728
37 1051
37 1111
37 1118
37 1153
37 1212
37 1235
37 1434
37 1478
37 1550
37 1603
37 1781
37 17...

input:

4
5000 2500
1 1054
2 947
5 4309
7 3311
11 4776
12 924
13 1989
17 4669
24 4598
27 1247
29 3311
32 3311
34 3493
37 74
37 205
37 206
37 218
37 268
37 277
37 304
37 312
37 438
37 550
37 659
37 674
37 719
37 728
37 1051
37 1111
37 1118
37 1153
37 1212
37 1235
37 1434
37 1478
37 1550
37 1603
37 1781
37 17...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

score: 5
Accepted
time: 3ms = 1ms + 2ms
memory: 2004kb,12076kb

input:

3
3594

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

4
5000 2500
1 1054
2 947
5 4309
7 3311
12 924
13 1989
15 159
17 4669
22 3311
24 4598
25 1366
27 1247
28 1366
29 3311
32 3311
34 3493
37 74
37 205
37 206
37 218
37 277
37 304
37 312
37 322
37 438
37 550
37 605
37 659
37 674
37 719
37 728
37 1051
37 1111
37 1118
37 1153
37 1212
37 1235
37 1434
37 1478...

input:

4
5000 2500
1 1054
2 947
5 4309
7 3311
12 924
13 1989
15 159
17 4669
22 3311
24 4598
25 1366
27 1247
28 1366
29 3311
32 3311
34 3493
37 74
37 205
37 206
37 218
37 277
37 304
37 312
37 322
37 438
37 550
37 605
37 659
37 674
37 719
37 728
37 1051
37 1111
37 1118
37 1153
37 1212
37 1235
37 1434
37 1478...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12068kb

input:

3
1750

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

4
5000 2500
1 1054
2 947
5 4309
7 3311
9 1054
11 4776
12 3311
13 1989
17 4669
19 159
22 1366
25 1366
27 159
28 1366
29 3311
32 3311
34 3493
35 1247
37 74
37 161
37 205
37 218
37 268
37 277
37 304
37 322
37 438
37 479
37 550
37 674
37 719
37 728
37 1051
37 1111
37 1118
37 1153
37 1212
37 1235
37 1252...

input:

4
5000 2500
1 1054
2 947
5 4309
7 3311
9 1054
11 4776
12 3311
13 1989
17 4669
19 159
22 1366
25 1366
27 159
28 1366
29 3311
32 3311
34 3493
35 1247
37 74
37 161
37 205
37 218
37 268
37 277
37 304
37 322
37 438
37 479
37 550
37 674
37 719
37 728
37 1051
37 1111
37 1118
37 1153
37 1212
37 1235
37 1252...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12192kb

input:

5
4878

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

6
5000 2528
3 18
4 1325
7 3311
9 1054
11 4776
12 3311
14 1508
15 159
18 26
18 96
18 121
18 169
18 244
18 416
18 499
18 512
18 599
18 766
18 797
18 865
18 884
18 901
18 933
18 947
18 1053
18 1092
18 1138
18 1246
18 1278
18 1310
18 1352
18 1380
18 1395
18 1506
18 1543
18 1546
18 1561
18 1727
18 1778
1...

input:

6
5000 2528
3 18
4 1325
7 3311
9 1054
11 4776
12 3311
14 1508
15 159
18 26
18 96
18 121
18 169
18 244
18 416
18 499
18 512
18 599
18 766
18 797
18 865
18 884
18 901
18 933
18 947
18 1053
18 1092
18 1138
18 1246
18 1278
18 1310
18 1352
18 1380
18 1395
18 1506
18 1543
18 1546
18 1561
18 1727
18 1778
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12160kb

input:

5
1223

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

6
5000 2521
3 18
4 1325
7 3311
11 4776
12 924
13 1989
14 1508
18 26
18 96
18 121
18 169
18 232
18 244
18 416
18 499
18 512
18 594
18 599
18 626
18 766
18 865
18 884
18 899
18 900
18 901
18 915
18 933
18 947
18 1049
18 1053
18 1092
18 1246
18 1310
18 1352
18 1380
18 1395
18 1482
18 1506
18 1543
18 15...

input:

6
5000 2521
3 18
4 1325
7 3311
11 4776
12 924
13 1989
14 1508
18 26
18 96
18 121
18 169
18 232
18 244
18 416
18 499
18 512
18 594
18 599
18 626
18 766
18 865
18 884
18 899
18 900
18 901
18 915
18 933
18 947
18 1049
18 1053
18 1092
18 1246
18 1310
18 1352
18 1380
18 1395
18 1482
18 1506
18 1543
18 15...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2000kb,12192kb

input:

5
648

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

6
5000 2527
3 18
4 1325
7 3311
9 1054
11 1536
12 3311
13 1989
14 1508
18 26
18 96
18 121
18 416
18 499
18 512
18 599
18 626
18 766
18 865
18 884
18 899
18 900
18 901
18 915
18 933
18 947
18 1049
18 1053
18 1092
18 1230
18 1246
18 1352
18 1380
18 1387
18 1395
18 1482
18 1506
18 1543
18 1561
18 1727
1...

input:

6
5000 2527
3 18
4 1325
7 3311
9 1054
11 1536
12 3311
13 1989
14 1508
18 26
18 96
18 121
18 416
18 499
18 512
18 599
18 626
18 766
18 865
18 884
18 899
18 900
18 901
18 915
18 933
18 947
18 1049
18 1053
18 1092
18 1230
18 1246
18 1352
18 1380
18 1387
18 1395
18 1482
18 1506
18 1543
18 1561
18 1727
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

score: 5
Accepted
time: 6ms = 1ms + 5ms
memory: 2004kb,12136kb

input:

7
4475

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

8
5000 2500
2 947
3 18
5 4309
6 3221
7 3311
10 2177
11 4776
12 3311
14 1508
17 4669
18 26
18 96
18 121
18 244
18 416
18 499
18 512
18 522
18 599
18 626
18 766
18 797
18 865
18 884
18 899
18 901
18 915
18 933
18 1053
18 1092
18 1246
18 1310
18 1352
18 1395
18 1506
18 1543
18 1561
18 1727
18 1778
18 1...

input:

8
5000 2500
2 947
3 18
5 4309
6 3221
7 3311
10 2177
11 4776
12 3311
14 1508
17 4669
18 26
18 96
18 121
18 244
18 416
18 499
18 512
18 522
18 599
18 626
18 766
18 797
18 865
18 884
18 899
18 901
18 915
18 933
18 1053
18 1092
18 1246
18 1310
18 1352
18 1395
18 1506
18 1543
18 1561
18 1727
18 1778
18 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12128kb

input:

7
4240

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

8
5000 2500
3 18
6 3221
7 3311
13 1101
14 1508
18 26
18 96
18 121
18 169
18 232
18 416
18 499
18 512
18 522
18 594
18 599
18 626
18 766
18 797
18 865
18 884
18 899
18 900
18 901
18 933
18 1053
18 1092
18 1246
18 1278
18 1310
18 1352
18 1387
18 1395
18 1506
18 1543
18 1546
18 1561
18 1727
18 1778
18 ...

input:

8
5000 2500
3 18
6 3221
7 3311
13 1101
14 1508
18 26
18 96
18 121
18 169
18 232
18 416
18 499
18 512
18 522
18 594
18 599
18 626
18 766
18 797
18 865
18 884
18 899
18 900
18 901
18 933
18 1053
18 1092
18 1246
18 1278
18 1310
18 1352
18 1387
18 1395
18 1506
18 1543
18 1546
18 1561
18 1727
18 1778
18 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

score: 5
Accepted
time: 2ms = 0ms + 2ms
memory: 2008kb,12132kb

input:

7
1291

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

8
5000 2500
3 18
4 1325
5 4309
6 1468
7 3311
10 2177
12 3311
14 1508
15 1468
18 26
18 96
18 121
18 169
18 416
18 499
18 512
18 522
18 599
18 766
18 865
18 884
18 901
18 915
18 933
18 1049
18 1053
18 1092
18 1138
18 1246
18 1310
18 1352
18 1380
18 1387
18 1395
18 1482
18 1506
18 1543
18 1546
18 1561
...

input:

8
5000 2500
3 18
4 1325
5 4309
6 1468
7 3311
10 2177
12 3311
14 1508
15 1468
18 26
18 96
18 121
18 169
18 416
18 499
18 512
18 522
18 599
18 766
18 865
18 884
18 901
18 915
18 933
18 1049
18 1053
18 1092
18 1138
18 1246
18 1310
18 1352
18 1380
18 1387
18 1395
18 1482
18 1506
18 1543
18 1546
18 1561
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,14580kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 4598
11 1536
12 3311
13 1101
16 768
17 4669
18 26
18 102
18 121
18 522
18 626
18 766
18 797
18 884
18 899
18 901
18 933
18 1030
18 1078
18 1092
18 1246
18 1310
18 1352
18 1395
18 1506
18 1543
18 1727
18 1778
18 1805
18 1823
18 1939
18 2257...

input:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 4598
11 1536
12 3311
13 1101
16 768
17 4669
18 26
18 102
18 121
18 522
18 626
18 766
18 797
18 884
18 899
18 901
18 933
18 1030
18 1078
18 1092
18 1246
18 1310
18 1352
18 1395
18 1506
18 1543
18 1727
18 1778
18 1805
18 1823
18 1939
18 2257...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2008kb,14576kb

input:

1
11926600

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 4598
11 4776
12 924
13 1989
16 768
17 4669
18 26
18 102
18 121
18 169
18 244
18 416
18 512
18 522
18 626
18 766
18 884
18 899
18 901
18 915
18 933
18 1030
18 1049
18 1053
18 1078
18 1092
18 1246
18 1310
18 1352
18 1395
18 1506
18 1543
18 1...

input:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 4598
11 4776
12 924
13 1989
16 768
17 4669
18 26
18 102
18 121
18 169
18 244
18 416
18 512
18 522
18 626
18 766
18 884
18 899
18 901
18 915
18 933
18 1030
18 1049
18 1053
18 1078
18 1092
18 1246
18 1310
18 1352
18 1395
18 1506
18 1543
18 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,14584kb

input:

1
16602378

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 2177
11 4776
12 3311
13 1989
16 4383
17 4669
18 26
18 102
18 121
18 244
18 416
18 512
18 522
18 626
18 766
18 884
18 899
18 901
18 915
18 933
18 1030
18 1049
18 1053
18 1092
18 1246
18 1352
18 1380
18 1395
18 1506
18 1543
18 1727
18 1805
1...

input:

2
5000 3124
1 1054
2 947
3 18
4 1325
6 3221
7 3311
8 4383
10 2177
11 4776
12 3311
13 1989
16 4383
17 4669
18 26
18 102
18 121
18 244
18 416
18 512
18 522
18 626
18 766
18 884
18 899
18 901
18 915
18 933
18 1030
18 1049
18 1053
18 1092
18 1246
18 1352
18 1380
18 1395
18 1506
18 1543
18 1727
18 1805
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2000kb,12076kb

input:

3
13129243

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

4
5000 2500
1 1054
2 1989
5 4309
6 3221
7 3221
12 924
13 1989
15 159
18 2229
19 159
24 3794
25 1366
28 3493
29 2229
36 1740
37 54
37 74
37 161
37 205
37 206
37 218
37 277
37 304
37 322
37 438
37 550
37 564
37 605
37 674
37 719
37 728
37 1051
37 1111
37 1118
37 1153
37 1212
37 1235
37 1305
37 1434
37...

input:

4
5000 2500
1 1054
2 1989
5 4309
6 3221
7 3221
12 924
13 1989
15 159
18 2229
19 159
24 3794
25 1366
28 3493
29 2229
36 1740
37 54
37 74
37 161
37 205
37 206
37 218
37 277
37 304
37 322
37 438
37 550
37 564
37 605
37 674
37 719
37 728
37 1051
37 1111
37 1118
37 1153
37 1212
37 1235
37 1305
37 1434
37...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12072kb

input:

3
7892141

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

4
5000 2500
1 1054
2 947
5 4309
7 3311
8 947
9 1054
12 3311
13 1101
17 4669
19 159
22 3311
23 1101
24 3794
27 159
28 3493
29 3311
32 3311
33 2604
34 3493
36 2604
37 74
37 161
37 205
37 206
37 218
37 268
37 277
37 304
37 550
37 659
37 674
37 719
37 728
37 739
37 849
37 1111
37 1118
37 1153
37 1212
37...

input:

4
5000 2500
1 1054
2 947
5 4309
7 3311
8 947
9 1054
12 3311
13 1101
17 4669
19 159
22 3311
23 1101
24 3794
27 159
28 3493
29 3311
32 3311
33 2604
34 3493
36 2604
37 74
37 161
37 205
37 206
37 218
37 268
37 277
37 304
37 550
37 659
37 674
37 719
37 728
37 739
37 849
37 1111
37 1118
37 1153
37 1212
37...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12076kb

input:

3
21314775

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

4
5000 2500
1 1054
2 947
5 4309
12 924
13 1989
15 159
17 4669
19 3934
21 3934
22 1366
24 3794
25 1366
27 1247
28 3493
30 3934
37 74
37 205
37 206
37 218
37 277
37 304
37 312
37 322
37 499
37 550
37 605
37 674
37 719
37 728
37 849
37 1111
37 1118
37 1153
37 1212
37 1235
37 1305
37 1434
37 1478
37 155...

input:

4
5000 2500
1 1054
2 947
5 4309
12 924
13 1989
15 159
17 4669
19 3934
21 3934
22 1366
24 3794
25 1366
27 1247
28 3493
30 3934
37 74
37 205
37 206
37 218
37 277
37 304
37 312
37 322
37 499
37 550
37 605
37 674
37 719
37 728
37 849
37 1111
37 1118
37 1153
37 1212
37 1235
37 1305
37 1434
37 1478
37 155...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

score: 30
Accepted
time: 6ms = 1ms + 5ms
memory: 2000kb,12096kb

input:

5
5559540

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

6
5000 2500
1 1054
5 4309
6 3221
7 3221
8 4383
9 768
10 4598
16 768
17 4669
18 2229
20 4564
21 61
21 265
21 269
21 294
21 308
21 373
21 413
21 476
21 503
21 506
21 602
21 604
21 697
21 774
21 805
21 825
21 954
21 961
21 1022
21 1084
21 1207
21 1228
21 1269
21 1323
21 1471
21 1484
21 1534
21 1544
21 ...

input:

6
5000 2500
1 1054
5 4309
6 3221
7 3221
8 4383
9 768
10 4598
16 768
17 4669
18 2229
20 4564
21 61
21 265
21 269
21 294
21 308
21 373
21 413
21 476
21 503
21 506
21 602
21 604
21 697
21 774
21 805
21 825
21 954
21 961
21 1022
21 1084
21 1207
21 1228
21 1269
21 1323
21 1471
21 1484
21 1534
21 1544
21 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12240kb

input:

5
9424319

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

6
5000 2540
3 18
4 1325
7 3311
11 4776
12 924
14 1508
15 159
18 26
18 96
18 102
18 121
18 169
18 232
18 244
18 332
18 416
18 499
18 512
18 594
18 599
18 626
18 766
18 797
18 865
18 884
18 899
18 900
18 901
18 933
18 947
18 1030
18 1053
18 1078
18 1092
18 1246
18 1278
18 1310
18 1352
18 1380
18 1395
...

input:

6
5000 2540
3 18
4 1325
7 3311
11 4776
12 924
14 1508
15 159
18 26
18 96
18 102
18 121
18 169
18 232
18 244
18 332
18 416
18 499
18 512
18 594
18 599
18 626
18 766
18 797
18 865
18 884
18 899
18 900
18 901
18 933
18 947
18 1030
18 1053
18 1078
18 1092
18 1246
18 1278
18 1310
18 1352
18 1380
18 1395
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2000kb,12180kb

input:

5
10955780

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

6
5000 2525
3 18
4 1325
7 3311
9 1054
11 4776
12 3311
13 1989
14 1508
18 26
18 96
18 102
18 121
18 244
18 332
18 416
18 499
18 512
18 522
18 599
18 626
18 766
18 797
18 865
18 884
18 899
18 900
18 901
18 915
18 933
18 947
18 1030
18 1053
18 1078
18 1092
18 1230
18 1246
18 1310
18 1352
18 1380
18 139...

input:

6
5000 2525
3 18
4 1325
7 3311
9 1054
11 4776
12 3311
13 1989
14 1508
18 26
18 96
18 102
18 121
18 244
18 332
18 416
18 499
18 512
18 522
18 599
18 626
18 766
18 797
18 865
18 884
18 899
18 900
18 901
18 915
18 933
18 947
18 1030
18 1053
18 1078
18 1092
18 1230
18 1246
18 1310
18 1352
18 1380
18 139...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

score: 30
Accepted
time: 4ms = 1ms + 3ms
memory: 2000kb,12156kb

input:

7
19938721

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

8
5000 2500
2 947
5 4309
6 3221
7 3311
10 4598
11 4776
12 3311
13 1101
14 1508
15 1468
19 159
20 2707
21 70
21 146
21 213
21 232
21 265
21 269
21 308
21 373
21 506
21 603
21 697
21 825
21 934
21 954
21 961
21 1207
21 1228
21 1269
21 1323
21 1471
21 1484
21 1544
21 1545
21 1593
21 1628
21 1665
21 166...

input:

8
5000 2500
2 947
5 4309
6 3221
7 3311
10 4598
11 4776
12 3311
13 1101
14 1508
15 1468
19 159
20 2707
21 70
21 146
21 213
21 232
21 265
21 269
21 308
21 373
21 506
21 603
21 697
21 825
21 934
21 954
21 961
21 1207
21 1228
21 1269
21 1323
21 1471
21 1484
21 1544
21 1545
21 1593
21 1628
21 1665
21 166...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12108kb

input:

7
5129508

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

8
5000 2500
6 3221
7 3311
8 4383
9 768
12 924
14 1508
15 1468
16 4383
21 35
21 70
21 172
21 265
21 269
21 413
21 503
21 506
21 571
21 593
21 604
21 697
21 704
21 774
21 805
21 825
21 954
21 961
21 1022
21 1207
21 1228
21 1269
21 1286
21 1323
21 1471
21 1484
21 1534
21 1544
21 1545
21 1561
21 1575
21...

input:

8
5000 2500
6 3221
7 3311
8 4383
9 768
12 924
14 1508
15 1468
16 4383
21 35
21 70
21 172
21 265
21 269
21 413
21 503
21 506
21 571
21 593
21 604
21 697
21 704
21 774
21 805
21 825
21 954
21 961
21 1022
21 1207
21 1228
21 1269
21 1286
21 1323
21 1471
21 1484
21 1534
21 1544
21 1545
21 1561
21 1575
21...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12128kb

input:

7
15332941

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 3221
2976 1247
421 1989
4680 2873
3083 3311
578 4043
1501 4564
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 1536
4543 2229
637 1586
3583 2229...

output:

8
5000 2500
4 1325
6 1468
7 3311
10 4598
12 3311
14 1508
15 1468
16 4383
17 4669
19 3934
21 35
21 61
21 70
21 172
21 213
21 232
21 265
21 269
21 308
21 373
21 413
21 506
21 593
21 697
21 704
21 774
21 805
21 954
21 961
21 1022
21 1207
21 1228
21 1269
21 1471
21 1484
21 1534
21 1544
21 1545
21 1561
2...

input:

8
5000 2500
4 1325
6 1468
7 3311
10 4598
12 3311
14 1508
15 1468
16 4383
17 4669
19 3934
21 35
21 61
21 70
21 172
21 213
21 232
21 265
21 269
21 308
21 373
21 413
21 506
21 593
21 697
21 704
21 774
21 805
21 954
21 961
21 1022
21 1207
21 1228
21 1269
21 1471
21 1484
21 1534
21 1544
21 1545
21 1561
2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 65
Accepted

Test #25:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 2004kb,13792kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 754
421 3889
4680 2229
3083 3311
578 4043
1501 4564
3411 18
687 3311
40 3934
4702 3648
508 3311
106 4186
3709 947
4543 3934
637 3889
3583 222...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 754
421 3889
4680 2229
3083 3311
578 4043
1501 4564
3411 18
687 3311
40 3934
4702 3648
508 3311
106 4186
3709 947
4543 3934
637 3889
3583 222...

output:

2
5000 2924
1 1054
4 1325
5 4309
6 3221
7 3311
12 924
15 1468
18 232
18 329
18 374
18 416
18 417
18 499
18 594
18 626
18 797
18 865
18 947
18 1254
18 1482
18 1485
18 1543
18 1549
18 1718
18 1939
18 2012
18 2310
18 2314
18 2528
18 2530
18 2770
18 2800
18 2839
18 2995
18 3004
18 3020
18 3220
18 3240
1...

input:

2
5000 2924
1 1054
4 1325
5 4309
6 3221
7 3311
12 924
15 1468
18 232
18 329
18 374
18 416
18 417
18 499
18 594
18 626
18 797
18 865
18 947
18 1254
18 1482
18 1485
18 1543
18 1549
18 1718
18 1939
18 2012
18 2310
18 2314
18 2528
18 2530
18 2770
18 2800
18 2839
18 2995
18 3004
18 3020
18 3220
18 3240
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
355365355024496523

Test #26:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2008kb,13796kb

input:

1
727827999106414164

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 2873
886 3221
2976 754
421 1989
4680 2229
3083 947
578 4043
1501 3221
3411 1101
687 107
40 768
4702 1355
508 1468
106 4186
3709 1536
4543 2229
637 3889
3583 22...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 2873
886 3221
2976 754
421 1989
4680 2229
3083 947
578 4043
1501 3221
3411 1101
687 107
40 768
4702 1355
508 1468
106 4186
3709 1536
4543 2229
637 3889
3583 22...

output:

2
5000 2924
1 1508
4 37
5 3648
6 1468
7 3311
12 924
15 1468
18 121
18 169
18 232
18 244
18 363
18 416
18 417
18 499
18 594
18 626
18 865
18 900
18 915
18 947
18 1049
18 1162
18 1395
18 1482
18 1543
18 1549
18 1756
18 2012
18 2524
18 2528
18 2683
18 2693
18 2839
18 2849
18 2925
18 2995
18 3089
18 313...

input:

2
5000 2924
1 1508
4 37
5 3648
6 1468
7 3311
12 924
15 1468
18 121
18 169
18 232
18 244
18 363
18 416
18 417
18 499
18 594
18 626
18 865
18 900
18 915
18 947
18 1049
18 1162
18 1395
18 1482
18 1543
18 1549
18 1756
18 2012
18 2524
18 2528
18 2683
18 2693
18 2839
18 2849
18 2925
18 2995
18 3089
18 313...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
727827999106414164

Test #27:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 2008kb,13796kb

input:

1
656410143989222955

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 3311
578 4043
1501 4564
3411 18
687 3311
40 768
4702 1355
508 3311
106 159
3709 947
4543 2229
637 3889
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 3311
578 4043
1501 4564
3411 18
687 3311
40 768
4702 1355
508 3311
106 159
3709 947
4543 2229
637 3889
3583 2229...

output:

2
5000 2924
1 1054
4 1325
5 3648
6 3221
7 3221
12 3311
15 1468
18 121
18 244
18 363
18 374
18 416
18 417
18 499
18 626
18 797
18 865
18 900
18 947
18 1030
18 1162
18 1254
18 1395
18 1543
18 1549
18 1561
18 1718
18 1805
18 1966
18 1987
18 2012
18 2314
18 2482
18 2528
18 2648
18 2683
18 2693
18 2712
1...

input:

2
5000 2924
1 1054
4 1325
5 3648
6 3221
7 3221
12 3311
15 1468
18 121
18 244
18 363
18 374
18 416
18 417
18 499
18 626
18 797
18 865
18 900
18 947
18 1030
18 1162
18 1254
18 1395
18 1543
18 1549
18 1561
18 1718
18 1805
18 1966
18 1987
18 2012
18 2314
18 2482
18 2528
18 2648
18 2683
18 2693
18 2712
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
656410143989222955

Test #28:

score: 65
Accepted
time: 4ms = 1ms + 3ms
memory: 2004kb,13796kb

input:

1
410366615149657534

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 754
421 3889
4680 2873
3083 947
578 4043
1501 4564
3411 1101
687 3311
40 768
4702 3648
508 3311
106 4186
3709 947
4543 3934
637 1586
3583 124...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 754
421 3889
4680 2873
3083 947
578 4043
1501 4564
3411 1101
687 3311
40 768
4702 3648
508 3311
106 4186
3709 947
4543 3934
637 1586
3583 124...

output:

2
5000 2924
1 1054
4 37
5 3648
6 1468
7 3221
12 3311
15 159
18 169
18 329
18 374
18 416
18 797
18 865
18 947
18 1030
18 1138
18 1352
18 1485
18 1543
18 1718
18 1756
18 1805
18 1966
18 1987
18 2126
18 2314
18 2482
18 2530
18 2712
18 2770
18 2800
18 2839
18 2925
18 3020
18 3044
18 3062
18 3089
18 3183...

input:

2
5000 2924
1 1054
4 37
5 3648
6 1468
7 3221
12 3311
15 159
18 169
18 329
18 374
18 416
18 797
18 865
18 947
18 1030
18 1138
18 1352
18 1485
18 1543
18 1718
18 1756
18 1805
18 1966
18 1987
18 2126
18 2314
18 2482
18 2530
18 2712
18 2770
18 2800
18 2839
18 2925
18 3020
18 3044
18 3062
18 3089
18 3183...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
410366615149657534

Test #29:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,13792kb

input:

1
298090682780948428

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 754
421 1989
4680 2873
3083 947
578 2177
1501 4564
3411 1101
687 107
40 768
4702 3648
508 3311
106 159
3709 947
4543 2229
637 1586
3583 1247
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
2990 107
886 3221
2976 754
421 1989
4680 2873
3083 947
578 2177
1501 4564
3411 1101
687 107
40 768
4702 3648
508 3311
106 159
3709 947
4543 2229
637 1586
3583 1247
...

output:

2
5000 2924
1 1054
4 37
5 3648
6 1468
7 3221
12 3311
15 159
18 121
18 329
18 374
18 797
18 900
18 915
18 933
18 947
18 1138
18 1254
18 1352
18 1395
18 1482
18 1543
18 1561
18 1718
18 1756
18 1805
18 1966
18 2524
18 2528
18 2648
18 2683
18 2693
18 2770
18 2839
18 2925
18 3044
18 3089
18 3220
18 3240
...

input:

2
5000 2924
1 1054
4 37
5 3648
6 1468
7 3221
12 3311
15 159
18 121
18 329
18 374
18 797
18 900
18 915
18 933
18 947
18 1138
18 1254
18 1352
18 1395
18 1482
18 1543
18 1561
18 1718
18 1756
18 1805
18 1966
18 2524
18 2528
18 2648
18 2683
18 2693
18 2770
18 2839
18 2925
18 3044
18 3089
18 3220
18 3240
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
298090682780948428

Test #30:

score: 65
Accepted
time: 4ms = 1ms + 3ms
memory: 2004kb,12060kb

input:

3
969441916331132577

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 4186
2976 754
421 1989
4680 2229
3083 947
578 2177
1501 4564
3411 1101
687 3311
40 3934
4702 1355
508 1468
106 159
3709 1536
4543 2229
637 3889
3583 12...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 4186
2976 754
421 1989
4680 2229
3083 947
578 2177
1501 4564
3411 1101
687 3311
40 3934
4702 1355
508 1468
106 159
3709 1536
4543 2229
637 3889
3583 12...

output:

4
5000 2500
3 18
4 37
6 3221
7 3221
9 1054
12 3311
15 1468
17 3311
18 96
18 102
18 121
18 198
18 244
18 329
18 417
18 499
18 522
18 635
18 900
18 901
18 933
18 992
18 1030
18 1049
18 1124
18 1138
18 1278
18 1310
18 1395
18 1482
18 1506
18 1543
18 1549
18 1649
18 1756
18 1805
18 1823
18 1874
18 1939
...

input:

4
5000 2500
3 18
4 37
6 3221
7 3221
9 1054
12 3311
15 1468
17 3311
18 96
18 102
18 121
18 198
18 244
18 329
18 417
18 499
18 522
18 635
18 900
18 901
18 933
18 992
18 1030
18 1049
18 1124
18 1138
18 1278
18 1310
18 1395
18 1482
18 1506
18 1543
18 1549
18 1649
18 1756
18 1805
18 1823
18 1874
18 1939
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
969441916331132577

Test #31:

score: 65
Accepted
time: 7ms = 1ms + 6ms
memory: 2000kb,12084kb

input:

3
929489812741933634

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 4186
2976 754
421 1989
4680 2229
3083 3311
578 2177
1501 3221
3411 18
687 3311
40 768
4702 3648
508 1468
106 159
3709 1536
4543 3934
637 3889
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 4186
2976 754
421 1989
4680 2229
3083 3311
578 2177
1501 3221
3411 18
687 3311
40 768
4702 3648
508 1468
106 159
3709 1536
4543 3934
637 3889
3583 2229...

output:

4
5000 2500
2 1989
3 1468
8 947
12 3311
15 1468
16 4383
17 4669
18 947
22 3311
25 1366
27 159
28 1366
32 3311
33 2604
36 1740
37 54
37 78
37 268
37 312
37 322
37 382
37 550
37 564
37 674
37 849
37 1073
37 1111
37 1212
37 1252
37 1305
37 1383
37 1511
37 1525
37 1550
37 1562
37 1629
37 1633
37 1658
37...

input:

4
5000 2500
2 1989
3 1468
8 947
12 3311
15 1468
16 4383
17 4669
18 947
22 3311
25 1366
27 159
28 1366
32 3311
33 2604
36 1740
37 54
37 78
37 268
37 312
37 322
37 382
37 550
37 564
37 674
37 849
37 1073
37 1111
37 1212
37 1252
37 1305
37 1383
37 1511
37 1525
37 1550
37 1562
37 1629
37 1633
37 1658
37...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
929489812741933634

Test #32:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2000kb,12056kb

input:

3
144032041325838295

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 3889
4680 2229
3083 947
578 4043
1501 3221
3411 1101
687 107
40 3934
4702 1355
508 3311
106 159
3709 947
4543 2229
637 3889
3583 222...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 3889
4680 2229
3083 947
578 4043
1501 3221
3411 1101
687 107
40 3934
4702 1355
508 3311
106 159
3709 947
4543 2229
637 3889
3583 222...

output:

4
5000 2500
1 1054
2 1989
4 37
5 4309
7 3221
9 1054
12 3311
13 1989
15 159
17 3311
18 2229
19 159
24 3794
27 159
28 3493
29 2229
32 3311
37 54
37 74
37 161
37 176
37 205
37 206
37 277
37 291
37 304
37 322
37 479
37 550
37 564
37 605
37 674
37 849
37 1118
37 1153
37 1212
37 1434
37 1602
37 1603
37 16...

input:

4
5000 2500
1 1054
2 1989
4 37
5 4309
7 3221
9 1054
12 3311
13 1989
15 159
17 3311
18 2229
19 159
24 3794
27 159
28 3493
29 2229
32 3311
37 54
37 74
37 161
37 176
37 205
37 206
37 277
37 291
37 304
37 322
37 479
37 550
37 564
37 605
37 674
37 849
37 1118
37 1153
37 1212
37 1434
37 1602
37 1603
37 16...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
144032041325838295

Test #33:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12088kb

input:

3
832110946250826180

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 2873
886 3221
2976 754
421 3889
4680 2229
3083 3311
578 2177
1501 4564
3411 1101
687 3311
40 3934
4702 1355
508 1468
106 4186
3709 1536
4543 2229
637 1586
3583...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 2873
886 3221
2976 754
421 3889
4680 2229
3083 3311
578 2177
1501 4564
3411 1101
687 3311
40 3934
4702 1355
508 1468
106 4186
3709 1536
4543 2229
637 1586
3583...

output:

4
5000 2500
4 37
5 4309
9 768
10 2177
15 159
16 768
17 3311
19 159
20 4564
21 35
21 61
21 172
21 213
21 265
21 294
21 331
21 367
21 411
21 413
21 458
21 473
21 476
21 503
21 593
21 602
21 604
21 704
21 756
21 1022
21 1084
21 1207
21 1220
21 1228
21 1323
21 1534
21 1544
21 1561
21 1628
21 1665
21 176...

input:

4
5000 2500
4 37
5 4309
9 768
10 2177
15 159
16 768
17 3311
19 159
20 4564
21 35
21 61
21 172
21 213
21 265
21 294
21 331
21 367
21 411
21 413
21 458
21 473
21 476
21 503
21 593
21 602
21 604
21 704
21 756
21 1022
21 1084
21 1207
21 1220
21 1228
21 1323
21 1534
21 1544
21 1561
21 1628
21 1665
21 176...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
832110946250826180

Test #34:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 2004kb,12064kb

input:

3
85728715707691821

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 3889
4680 2229
3083 3311
578 4043
1501 4564
3411 18
687 107
40 3934
4702 1355
508 3311
106 159
3709 1536
4543 2229
637 3889
3583 222...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
2990 107
886 3221
2976 1247
421 3889
4680 2229
3083 3311
578 4043
1501 4564
3411 18
687 107
40 3934
4702 1355
508 3311
106 159
3709 1536
4543 2229
637 3889
3583 222...

output:

4
5000 2500
1 1054
2 1989
5 4309
8 947
9 1054
10 4598
13 1989
14 1508
19 159
20 4564
24 3794
26 3889
27 159
35 1247
36 1740
37 161
37 205
37 206
37 277
37 322
37 438
37 479
37 499
37 550
37 564
37 659
37 674
37 840
37 1051
37 1111
37 1153
37 1305
37 1342
37 1496
37 1602
37 1603
37 1617
37 1629
37 16...

input:

4
5000 2500
1 1054
2 1989
5 4309
8 947
9 1054
10 4598
13 1989
14 1508
19 159
20 4564
24 3794
26 3889
27 159
35 1247
36 1740
37 161
37 205
37 206
37 277
37 322
37 438
37 479
37 499
37 550
37 564
37 659
37 674
37 840
37 1051
37 1111
37 1153
37 1305
37 1342
37 1496
37 1602
37 1603
37 1617
37 1629
37 16...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
85728715707691821

Test #35:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2008kb,12096kb

input:

5
777434612360931036

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 2873
886 3221
2976 754
421 1989
4680 2229
3083 947
578 2177
1501 4564
3411 1101
687 107
40 768
4702 1355
508 3311
106 159
3709 947
4543 3934
637 3889
3583 1247...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 2873
886 3221
2976 754
421 1989
4680 2229
3083 947
578 2177
1501 4564
3411 1101
687 107
40 768
4702 1355
508 3311
106 159
3709 947
4543 3934
637 3889
3583 1247...

output:

6
5000 2501
1 1054
4 37
5 4309
6 3221
7 3221
8 4383
10 4598
13 1101
15 1468
16 4383
17 4669
18 2229
20 4564
21 35
21 70
21 172
21 213
21 232
21 294
21 308
21 373
21 413
21 458
21 503
21 571
21 697
21 704
21 756
21 766
21 825
21 954
21 961
21 1022
21 1061
21 1130
21 1172
21 1202
21 1220
21 1228
21 14...

input:

6
5000 2501
1 1054
4 37
5 4309
6 3221
7 3221
8 4383
10 4598
13 1101
15 1468
16 4383
17 4669
18 2229
20 4564
21 35
21 70
21 172
21 213
21 232
21 294
21 308
21 373
21 413
21 458
21 503
21 571
21 697
21 704
21 756
21 766
21 825
21 954
21 961
21 1022
21 1061
21 1130
21 1172
21 1202
21 1220
21 1228
21 14...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
777434612360931036

Test #36:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2000kb,12288kb

input:

5
705262511549880222

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 947
578 4043
1501 4564
3411 18
687 3311
40 768
4702 3648
508 3311
106 4186
3709 947
4543 2229
637 1586
3583 2229...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 947
578 4043
1501 4564
3411 18
687 3311
40 768
4702 3648
508 3311
106 4186
3709 947
4543 2229
637 1586
3583 2229...

output:

6
5000 2553
3 18
4 1325
7 3311
11 4776
12 924
14 1508
18 96
18 121
18 169
18 198
18 232
18 244
18 329
18 332
18 363
18 374
18 512
18 522
18 594
18 599
18 696
18 769
18 865
18 884
18 900
18 901
18 933
18 947
18 1049
18 1053
18 1078
18 1124
18 1138
18 1162
18 1278
18 1310
18 1352
18 1380
18 1395
18 14...

input:

6
5000 2553
3 18
4 1325
7 3311
11 4776
12 924
14 1508
18 96
18 121
18 169
18 198
18 232
18 244
18 329
18 332
18 363
18 374
18 512
18 522
18 594
18 599
18 696
18 769
18 865
18 884
18 900
18 901
18 933
18 947
18 1049
18 1053
18 1078
18 1124
18 1138
18 1162
18 1278
18 1310
18 1352
18 1380
18 1395
18 14...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
705262511549880222

Test #37:

score: 65
Accepted
time: 4ms = 1ms + 3ms
memory: 2000kb,12320kb

input:

5
510318082834167951

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 754
421 1989
4680 2229
3083 947
578 2177
1501 3221
3411 1101
687 107
40 3934
4702 1355
508 3311
106 159
3709 1536
4543 2229
637 3889
3583 222...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 3221
2976 754
421 1989
4680 2229
3083 947
578 2177
1501 3221
3411 1101
687 107
40 3934
4702 1355
508 3311
106 159
3709 1536
4543 2229
637 3889
3583 222...

output:

6
5000 2560
5 3648
7 3311
9 1054
11 4776
12 3311
14 1508
15 159
17 3311
18 96
18 102
18 121
18 198
18 244
18 363
18 499
18 522
18 626
18 899
18 901
18 933
18 947
18 1030
18 1049
18 1162
18 1230
18 1246
18 1254
18 1278
18 1352
18 1380
18 1395
18 1543
18 1561
18 1649
18 1756
18 1805
18 1806
18 1874
18...

input:

6
5000 2560
5 3648
7 3311
9 1054
11 4776
12 3311
14 1508
15 159
17 3311
18 96
18 102
18 121
18 198
18 244
18 363
18 499
18 522
18 626
18 899
18 901
18 933
18 947
18 1030
18 1049
18 1162
18 1230
18 1246
18 1254
18 1278
18 1352
18 1380
18 1395
18 1543
18 1561
18 1649
18 1756
18 1805
18 1806
18 1874
18...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
510318082834167951

Test #38:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2004kb,12348kb

input:

5
914858813253258744

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 4186
2976 754
421 1989
4680 2229
3083 947
578 4043
1501 3221
3411 18
687 3311
40 768
4702 1355
508 1468
106 4186
3709 1536
4543 3934
637 1586
3583 1247...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 4186
2976 754
421 1989
4680 2229
3083 947
578 4043
1501 3221
3411 18
687 3311
40 768
4702 1355
508 1468
106 4186
3709 1536
4543 3934
637 1586
3583 1247...

output:

6
5000 2568
2 1989
4 1325
9 1054
11 4776
12 3311
13 1989
14 3889
18 102
18 121
18 198
18 244
18 329
18 416
18 417
18 499
18 512
18 522
18 599
18 635
18 865
18 884
18 900
18 915
18 933
18 947
18 992
18 1030
18 1049
18 1053
18 1124
18 1138
18 1211
18 1230
18 1310
18 1380
18 1395
18 1482
18 1543
18 154...

input:

6
5000 2568
2 1989
4 1325
9 1054
11 4776
12 3311
13 1989
14 3889
18 102
18 121
18 198
18 244
18 329
18 416
18 417
18 499
18 512
18 522
18 599
18 635
18 865
18 884
18 900
18 915
18 933
18 947
18 992
18 1030
18 1049
18 1053
18 1124
18 1138
18 1211
18 1230
18 1310
18 1380
18 1395
18 1482
18 1543
18 154...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
914858813253258744

Test #39:

score: 65
Accepted
time: 5ms = 0ms + 5ms
memory: 2000kb,12132kb

input:

5
659635316746638238

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 3311
578 4043
1501 3221
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 947
4543 3934
637 1586
3583 2229
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 3311
578 4043
1501 3221
3411 18
687 107
40 768
4702 3648
508 3311
106 159
3709 947
4543 3934
637 1586
3583 2229
...

output:

6
5000 2508
1 1054
3 1468
5 4309
6 3221
7 3221
8 4383
9 768
10 4598
13 1101
15 1468
16 4383
17 4669
18 2229
20 4564
21 35
21 61
21 70
21 172
21 213
21 265
21 269
21 294
21 308
21 331
21 367
21 373
21 413
21 503
21 506
21 593
21 604
21 697
21 704
21 774
21 805
21 825
21 961
21 1022
21 1130
21 1217
21...

input:

6
5000 2508
1 1054
3 1468
5 4309
6 3221
7 3221
8 4383
9 768
10 4598
13 1101
15 1468
16 4383
17 4669
18 2229
20 4564
21 35
21 61
21 70
21 172
21 213
21 265
21 269
21 294
21 308
21 331
21 367
21 373
21 413
21 503
21 506
21 593
21 604
21 697
21 704
21 774
21 805
21 825
21 961
21 1022
21 1130
21 1217
21...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659635316746638238

Test #40:

score: 65
Accepted
time: 2ms = 0ms + 2ms
memory: 2004kb,12136kb

input:

7
858490260563149759

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 2873
886 3221
2976 754
421 1989
4680 2873
3083 947
578 2177
1501 4564
3411 18
687 3311
40 3934
4702 3648
508 1468
106 159
3709 1536
4543 3934
637 3889
3583 124...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 2873
886 3221
2976 754
421 1989
4680 2873
3083 947
578 2177
1501 4564
3411 18
687 3311
40 3934
4702 3648
508 1468
106 159
3709 1536
4543 3934
637 3889
3583 124...

output:

8
5000 2500
1 1508
3 18
5 4309
7 3311
8 4383
10 2177
11 1536
12 924
15 159
17 3311
18 26
18 96
18 121
18 198
18 232
18 329
18 363
18 416
18 417
18 594
18 599
18 900
18 915
18 955
18 992
18 1049
18 1092
18 1138
18 1162
18 1230
18 1246
18 1310
18 1380
18 1387
18 1395
18 1506
18 1543
18 1549
18 1609
18...

input:

8
5000 2500
1 1508
3 18
5 4309
7 3311
8 4383
10 2177
11 1536
12 924
15 159
17 3311
18 26
18 96
18 121
18 198
18 232
18 329
18 363
18 416
18 417
18 594
18 599
18 900
18 915
18 955
18 992
18 1049
18 1092
18 1138
18 1162
18 1230
18 1246
18 1310
18 1380
18 1387
18 1395
18 1506
18 1543
18 1549
18 1609
18...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
858490260563149759

Test #41:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2000kb,12112kb

input:

7
860058643727731209

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 2873
886 3221
2976 754
421 1989
4680 2873
3083 947
578 2177
1501 4564
3411 18
687 107
40 3934
4702 1355
508 3311
106 159
3709 947
4543 3934
637 3889
3583 1247
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 2873
886 3221
2976 754
421 1989
4680 2873
3083 947
578 2177
1501 4564
3411 18
687 107
40 3934
4702 1355
508 3311
106 159
3709 947
4543 3934
637 3889
3583 1247
...

output:

8
5000 2500
3 18
5 3648
6 3221
7 3311
8 4383
11 1536
12 3311
13 1101
14 1508
16 4383
17 3311
18 26
18 102
18 121
18 198
18 363
18 374
18 416
18 417
18 499
18 599
18 696
18 900
18 955
18 1030
18 1049
18 1092
18 1138
18 1162
18 1230
18 1246
18 1278
18 1387
18 1395
18 1506
18 1543
18 1549
18 1649
18 17...

input:

8
5000 2500
3 18
5 3648
6 3221
7 3311
8 4383
11 1536
12 3311
13 1101
14 1508
16 4383
17 3311
18 26
18 102
18 121
18 198
18 363
18 374
18 416
18 417
18 499
18 599
18 696
18 900
18 955
18 1030
18 1049
18 1092
18 1138
18 1162
18 1230
18 1246
18 1278
18 1387
18 1395
18 1506
18 1543
18 1549
18 1649
18 17...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
860058643727731209

Test #42:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 2000kb,12128kb

input:

7
718861404514377808

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 3311
578 2177
1501 4564
3411 18
687 107
40 768
4702 1355
508 3311
106 4186
3709 947
4543 2229
637 3889
3583 1247...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 3311
578 2177
1501 4564
3411 18
687 107
40 768
4702 1355
508 3311
106 4186
3709 947
4543 2229
637 3889
3583 1247...

output:

8
5000 2500
3 18
4 1325
5 3648
6 1468
7 3311
11 1536
12 3311
13 1989
14 1508
15 1468
16 4383
17 4669
18 102
18 121
18 329
18 332
18 374
18 416
18 499
18 522
18 599
18 626
18 696
18 766
18 769
18 899
18 900
18 901
18 915
18 933
18 1030
18 1049
18 1078
18 1124
18 1352
18 1387
18 1395
18 1482
18 1506
1...

input:

8
5000 2500
3 18
4 1325
5 3648
6 1468
7 3311
11 1536
12 3311
13 1989
14 1508
15 1468
16 4383
17 4669
18 102
18 121
18 329
18 332
18 374
18 416
18 499
18 522
18 599
18 626
18 696
18 766
18 769
18 899
18 900
18 901
18 915
18 933
18 1030
18 1049
18 1078
18 1124
18 1352
18 1387
18 1395
18 1482
18 1506
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
718861404514377808

Test #43:

score: 65
Accepted
time: 5ms = 0ms + 5ms
memory: 2004kb,12136kb

input:

7
659192688464047828

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 3311
578 4043
1501 3221
3411 18
687 3311
40 3934
4702 3648
508 1468
106 159
3709 1536
4543 3934
637 1586
3583 22...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 3311
578 4043
1501 3221
3411 18
687 3311
40 3934
4702 3648
508 1468
106 159
3709 1536
4543 3934
637 1586
3583 22...

output:

8
5000 2500
1 1508
3 1468
5 3648
6 3221
7 3221
8 947
12 3311
13 1101
15 159
17 3311
19 159
20 4564
21 35
21 61
21 172
21 232
21 265
21 269
21 294
21 308
21 327
21 373
21 411
21 473
21 476
21 506
21 602
21 603
21 697
21 704
21 774
21 805
21 934
21 1022
21 1084
21 1207
21 1217
21 1269
21 1293
21 1323
...

input:

8
5000 2500
1 1508
3 1468
5 3648
6 3221
7 3221
8 947
12 3311
13 1101
15 159
17 3311
19 159
20 4564
21 35
21 61
21 172
21 232
21 265
21 269
21 294
21 308
21 327
21 373
21 411
21 473
21 476
21 506
21 602
21 603
21 697
21 704
21 774
21 805
21 934
21 1022
21 1084
21 1207
21 1217
21 1269
21 1293
21 1323
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659192688464047828

Test #44:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 2008kb,12120kb

input:

7
685730986714800201

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 947
578 2177
1501 4564
3411 18
687 3311
40 768
4702 3648
508 1468
106 159
3709 947
4543 2229
637 3889
3583 1247
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
2990 107
886 4186
2976 1247
421 1989
4680 2229
3083 947
578 2177
1501 4564
3411 18
687 3311
40 768
4702 3648
508 1468
106 159
3709 947
4543 2229
637 3889
3583 1247
...

output:

8
5000 2500
1 1508
2 947
3 18
7 3311
8 4383
9 768
10 2177
14 3889
16 4383
17 4669
18 26
18 121
18 198
18 232
18 244
18 374
18 417
18 594
18 599
18 696
18 900
18 901
18 955
18 992
18 1049
18 1124
18 1138
18 1211
18 1254
18 1278
18 1310
18 1380
18 1395
18 1482
18 1506
18 1543
18 1549
18 1561
18 1609
1...

input:

8
5000 2500
1 1508
2 947
3 18
7 3311
8 4383
9 768
10 2177
14 3889
16 4383
17 4669
18 26
18 121
18 198
18 232
18 244
18 374
18 417
18 594
18 599
18 696
18 900
18 901
18 955
18 992
18 1049
18 1124
18 1138
18 1211
18 1254
18 1278
18 1310
18 1380
18 1395
18 1482
18 1506
18 1543
18 1549
18 1561
18 1609
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
685730986714800201