QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#424992#8726. Magic Showlawsonwang100 ✓1ms1896kbC++141.4kb2024-05-29 20:36:362024-05-29 20:36:37

Judging History

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

  • [2024-05-29 20:36:37]
  • 评测
  • 测评结果:100
  • 用时:1ms
  • 内存:1896kb
  • [2024-05-29 20:36:36]
  • 提交

Alice

#include "Alice.h"

#include <bits/stdc++.h>
using namespace std;
const int n = 5000, l = 60, c = (n - 2) / l, Seed = 114514;

std::vector<std::pair<int, int>> Alice() {
    static mt19937 rnd(Seed);
    static int p[n + 10];
    iota(p + 1, p + n + 1, 1);
    shuffle(p + 3, p + n + 1, rnd);
    long long x = setN(n);
    vector<pair<int, int>> E;
    E.emplace_back(1, 2);
    for (int i = 1; i < n - 1; i++) {
        int b = (i - 1) / c, fa;
        if (b >= l) fa = 1;
        else fa = (rnd() % ((p[i + 2] - 1) / 2)) * 2 + 2 - (x >> b & 1);
        E.emplace_back(fa, p[i + 2]);
    }
    shuffle(E.begin(), E.end(), rnd);
    return E;
}

Bob

#include "Bob.h"

#include <bits/stdc++.h>
using namespace std;
const int n = 5000, l = 60, c = (n - 2) / l, Seed = 114514;

int mp[200];
long long Bob(vector<pair<int, int>> V) {
    static mt19937 rnd(Seed);
    static int p[n + 10], q[n + 10];
    iota(p + 1, p + n + 1, 1);
    shuffle(p + 3, p + n + 1, rnd);
    for (int i = 1; i <= n; i++) q[p[i]] = i;
    fill(&mp[0], &mp[100], -1);
    for (auto [x, y] : V) {
        if (y == 2) continue;
        int b = (q[y] - 3) / c, v = x & 1;
        if (b >= l) continue;
        mp[b] = v;
    }
    long long x = 0;
    for (int i = 0; i < 60; i++) {
        if (mp[i] == -1) mp[i] = rnd() & 1;
        x |= ((1ll * mp[i]) << i);
    }
    return x;
}

详细

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1852kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

2
5000 2878
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 21
2 34
2 37
2 41
2 45
2 112
4 6
4 23
4 62
4 64
4 581
4 628
4 854
4 871
4 895
4 4946
5 17
6 9
6 11
6 12
6 13
6 31
6 44
6 49
6 125
6 463
6 643
6 885
7 959
7 3633
8 14
8 60
8 69
8 400
8 7...

input:

2
5000 2878
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 21
2 34
2 37
2 41
2 45
2 112
4 6
4 23
4 62
4 64
4 581
4 628
4 854
4 871
4 895
4 4946
5 17
6 9
6 11
6 12
6 13
6 31
6 44
6 49
6 125
6 463
6 643
6 885
7 959
7 3633
8 14
8 60
8 69
8 400
8 7...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1856kb

input:

1
459

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

2
5000 2878
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 21
2 34
2 37
2 41
2 45
2 112
3 23
3 64
3 871
3 4946
4 6
4 62
4 581
4 628
4 854
4 895
5 17
5 463
5 885
6 9
6 11
6 12
6 13
6 31
6 44
6 49
6 125
6 643
7 959
7 3633
8 14
8 60
8 69
8 400
8 7...

input:

2
5000 2878
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 21
2 34
2 37
2 41
2 45
2 112
3 23
3 64
3 871
3 4946
4 6
4 62
4 581
4 628
4 854
4 895
5 17
5 463
5 885
6 9
6 11
6 12
6 13
6 31
6 44
6 49
6 125
6 643
7 959
7 3633
8 14
8 60
8 69
8 400
8 7...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1860kb

input:

1
2495

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

2
5000 2878
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 21
2 34
2 37
2 41
2 45
2 112
3 23
3 64
3 871
3 4946
4 6
4 62
4 581
4 628
4 854
4 895
5 17
5 463
5 885
6 9
6 11
6 12
6 13
6 31
6 44
6 49
6 125
6 643
7 959
7 3633
8 14
8 60
8 69
8 400
8 7...

input:

2
5000 2878
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 21
2 34
2 37
2 41
2 45
2 112
3 23
3 64
3 871
3 4946
4 6
4 62
4 581
4 628
4 854
4 895
5 17
5 463
5 885
6 9
6 11
6 12
6 13
6 31
6 44
6 49
6 125
6 643
7 959
7 3633
8 14
8 60
8 69
8 400
8 7...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1852kb

input:

3
1560

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

4
5000 2500
1 2
1 94
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
17 35
19 67
19 987
23 2093
29 908
31 1553
33 173
39 153
41 855
43 441
53 548
53 3131
55 507
61 2348
63 1195
67 107
69 213
71 106
75 87
83 2229
87 209
89 2...

input:

4
5000 2500
1 2
1 94
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
17 35
19 67
19 987
23 2093
29 908
31 1553
33 173
39 153
41 855
43 441
53 548
53 3131
55 507
61 2348
63 1195
67 107
69 213
71 106
75 87
83 2229
87 209
89 2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1848kb

input:

3
3594

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

4
5000 2500
1 2
1 94
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
5 463
5 885
11 2096
17 35
19 67
19 987
23 2093
29 908
33 173
39 153
41 4801
43 441
47 350
49 1323
53 548
53 950
53 3131
55 507
63 1195
67 107
69 213...

input:

4
5000 2500
1 2
1 94
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
5 463
5 885
11 2096
17 35
19 67
19 987
23 2093
29 908
33 173
39 153
41 4801
43 441
47 350
49 1323
53 548
53 950
53 3131
55 507
63 1195
67 107
69 213...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1848kb

input:

3
1750

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

4
5000 2500
1 2
1 94
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
5 17
5 463
5 885
9 57
11 2096
23 247
23 2093
25 27
25 2709
29 61
29 908
29 3020
31 1553
33 1065
37 749
41 855
41 4801
43 324
43 441
47 2693
49 1323
...

input:

4
5000 2500
1 2
1 94
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
5 17
5 463
5 885
9 57
11 2096
23 247
23 2093
25 27
25 2709
29 61
29 908
29 3020
31 1553
33 1065
37 749
41 855
41 4801
43 324
43 441
47 2693
49 1323
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1844kb

input:

5
4878

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

6
5000 2518
1 94
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
2 4
3 15
3 23
3 64
3 871
3 4946
4 62
4 75
4 91
4 581
4 628
4 854
4 895
4 1321
4 2203
5 463
5 885
6 13
7 3633
8 14
8 24
8 60
8 69
8 210
8 400
8 708
8 959
8 169...

input:

6
5000 2518
1 94
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
2 4
3 15
3 23
3 64
3 871
3 4946
4 62
4 75
4 91
4 581
4 628
4 854
4 895
4 1321
4 2203
5 463
5 885
6 13
7 3633
8 14
8 24
8 60
8 69
8 210
8 400
8 708
8 959
8 169...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1848kb

input:

5
1223

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

6
5000 2503
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
2 4
3 64
3 1321
3 2203
3 4946
4 15
4 23
4 62
4 75
4 91
4 581
4 628
4 854
4 871
4 895
5 17
5 463
5 885
6 13
7 959
8 14
8 24
8 60
8 69
8 210
8 400
8 708
8 1696...

input:

6
5000 2503
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
2 4
3 64
3 1321
3 2203
3 4946
4 15
4 23
4 62
4 75
4 91
4 581
4 628
4 854
4 871
4 895
5 17
5 463
5 885
6 13
7 959
8 14
8 24
8 60
8 69
8 210
8 400
8 708
8 1696...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1888kb,1848kb

input:

5
648

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

6
5000 2501
1 2
2 3
2 4
2 5
2 19
2 21
2 34
2 37
2 41
2 45
2 102
2 112
2 151
2 633
2 3162
6 8
6 9
6 10
6 11
6 12
6 13
6 31
6 44
6 49
6 110
6 125
6 463
6 643
6 885
6 1206
14 42
14 81
14 127
14 226
14 529
14 642
14 1018
14 1440
14 1853
14 2236
14 2490
14 3181
14 3394
16 26
16 29
16 39
16 109
16 181
16 ...

input:

6
5000 2501
1 2
2 3
2 4
2 5
2 19
2 21
2 34
2 37
2 41
2 45
2 102
2 112
2 151
2 633
2 3162
6 8
6 9
6 10
6 11
6 12
6 13
6 31
6 44
6 49
6 110
6 125
6 463
6 643
6 885
6 1206
14 42
14 81
14 127
14 226
14 529
14 642
14 1018
14 1440
14 1853
14 2236
14 2490
14 3181
14 3394
16 26
16 29
16 39
16 109
16 181
16 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1848kb

input:

7
4475

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

8
5000 2500
7 959
7 3310
7 3633
11 2096
17 35
17 2017
25 27
25 339
29 3020
31 1553
31 2905
33 1065
39 153
41 4801
52 63
53 1267
60 133
60 487
60 597
61 2348
69 917
69 1724
72 2261
72 4104
75 87
75 351
79 375
79 907
80 165
80 259
82 157
89 257
89 413
92 3033
92 3846
93 111
95 3151
95 4057
97 147
98 1...

input:

8
5000 2500
7 959
7 3310
7 3633
11 2096
17 35
17 2017
25 27
25 339
29 3020
31 1553
31 2905
33 1065
39 153
41 4801
52 63
53 1267
60 133
60 487
60 597
61 2348
69 917
69 1724
72 2261
72 4104
75 87
75 351
79 375
79 907
80 165
80 259
82 157
89 257
89 413
92 3033
92 3846
93 111
95 3151
95 4057
97 147
98 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1888kb,1848kb

input:

7
4240

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

8
5000 2500
3 1321
5 17
9 57
21 33
21 89
23 247
24 113
24 359
25 339
25 2709
28 3060
31 1553
37 749
49 2625
52 63
53 55
60 77
60 115
60 133
69 917
72 2261
72 4104
80 129
80 165
80 259
82 95
82 157
83 2229
92 3033
98 141
98 147
98 481
98 4249
100 791
100 1457
100 4471
106 311
106 1339
106 2077
112 38...

input:

8
5000 2500
3 1321
5 17
9 57
21 33
21 89
23 247
24 113
24 359
25 339
25 2709
28 3060
31 1553
37 749
49 2625
52 63
53 55
60 77
60 115
60 133
69 917
72 2261
72 4104
80 129
80 165
80 259
82 95
82 157
83 2229
92 3033
98 141
98 147
98 481
98 4249
100 791
100 1457
100 4471
106 311
106 1339
106 2077
112 38...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1848kb

input:

7
1291

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

8
5000 2500
3 15
3 2203
3 4946
7 959
7 3633
17 35
17 2017
18 2001
28 3060
31 2905
39 153
41 4801
49 1323
53 3131
60 115
60 133
60 487
60 597
64 93
64 1835
64 3271
69 1724
72 2261
72 4104
75 351
79 375
79 907
80 165
80 259
87 209
88 1081
88 3067
89 257
89 413
95 469
95 3151
95 4057
97 147
98 141
98 4...

input:

8
5000 2500
3 15
3 2203
3 4946
7 959
7 3633
17 35
17 2017
18 2001
28 3060
31 2905
39 153
41 4801
49 1323
53 3131
60 115
60 133
60 487
60 597
64 93
64 1835
64 3271
69 1724
72 2261
72 4104
75 351
79 375
79 907
80 165
80 259
87 209
88 1081
88 3067
89 257
89 413
95 469
95 3151
95 4057
97 147
98 141
98 4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1852kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

2
5000 2878
1 7
1 37
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 21
2 34
2 41
2 45
2 112
2 265
3 23
3 871
4 6
4 62
4 64
4 581
4 628
4 854
4 895
4 4946
6 9
6 11
6 12
6 13
6 17
6 31
6 44
6 49
6 125
6 463
6 643
6 885
8 14
8 60
8 69
8 400
8 708
8 959
8 16...

input:

2
5000 2878
1 7
1 37
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 21
2 34
2 41
2 45
2 112
2 265
3 23
3 871
4 6
4 62
4 64
4 581
4 628
4 854
4 895
4 4946
6 9
6 11
6 12
6 13
6 17
6 31
6 44
6 49
6 125
6 463
6 643
6 885
8 14
8 60
8 69
8 400
8 708
8 959
8 16...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1856kb

input:

1
11926600

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
339 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
339 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

2
5000 2878
1 5
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 7
2 21
2 34
2 37
2 41
2 45
2 112
2 265
3 6
3 23
3 871
4 62
4 64
4 581
4 628
4 854
4 895
4 4946
5 9
6 11
6 12
6 13
6 17
6 31
6 44
6 49
6 125
6 463
6 643
6 885
7 14
8 60
8 69
8 400
8 708
8 959
8 16...

input:

2
5000 2878
1 5
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 7
2 21
2 34
2 37
2 41
2 45
2 112
2 265
3 6
3 23
3 871
4 62
4 64
4 581
4 628
4 854
4 895
4 4946
5 9
6 11
6 12
6 13
6 17
6 31
6 44
6 49
6 125
6 463
6 643
6 885
7 14
8 60
8 69
8 400
8 708
8 959
8 16...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1852kb

input:

1
16602378

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
339 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
339 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

2
5000 2878
1 5
1 7
1 37
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 21
2 34
2 41
2 45
2 112
2 265
3 6
3 23
3 64
3 871
3 4946
4 62
4 581
4 628
4 854
4 895
5 9
5 125
5 463
5 885
6 11
6 12
6 13
6 17
6 31
6 44
6 49
6 643
7 14
7 400
7 3633
8 60
8 69
8 708
8 9...

input:

2
5000 2878
1 5
1 7
1 37
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 21
2 34
2 41
2 45
2 112
2 265
3 6
3 23
3 64
3 871
3 4946
4 62
4 581
4 628
4 854
4 895
5 9
5 125
5 463
5 885
6 11
6 12
6 13
6 17
6 31
6 44
6 49
6 643
7 14
7 400
7 3633
8 60
8 69
8 708
8 9...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1844kb

input:

3
13129243

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

4
5000 2500
1 2
1 4
1 5
1 7
1 37
1 94
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
7 959
11 2096
13 1853
15 29
17 35
17 2017
23 2093
25 339
25 754
29 908
31 1553
33 173
39 153
43 441
61 2348
63 1195
63 1835
69 213
69 917...

input:

4
5000 2500
1 2
1 4
1 5
1 7
1 37
1 94
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
7 959
11 2096
13 1853
15 29
17 35
17 2017
23 2093
25 339
25 754
29 908
31 1553
33 173
39 153
43 441
61 2348
63 1195
63 1835
69 213
69 917...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1848kb

input:

3
7892141

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

4
5000 2500
1 2
1 4
1 5
1 7
1 37
1 151
1 265
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
9 511
15 215
15 3914
29 61
31 391
33 173
35 716
37 749
39 153
43 441
47 350
47 2693
61 532
67 565
71 106
71 200
79 165
79 90...

input:

4
5000 2500
1 2
1 4
1 5
1 7
1 37
1 151
1 265
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
9 511
15 215
15 3914
29 61
31 391
33 173
35 716
37 749
39 153
43 441
47 350
47 2693
61 532
67 565
71 106
71 200
79 165
79 90...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1852kb

input:

3
21314775

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
339 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
339 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

4
5000 2500
1 2
1 265
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
9 57
13 3181
17 2017
23 247
27 1648
29 3020
33 1065
37 749
65 1557
69 917
71 106
75 351
83 219
83 2229
87 209
93 831
97 141
103 2446
103 2815
105 1...

input:

4
5000 2500
1 2
1 265
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
9 57
13 3181
17 2017
23 247
27 1648
29 3020
33 1065
37 749
65 1557
69 917
71 106
75 351
83 219
83 2229
87 209
93 831
97 141
103 2446
103 2815
105 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1852kb

input:

5
5559540

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

6
5000 2506
1 2
1 151
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
3 6
3 91
3 1321
3 2203
4 15
4 23
4 62
4 64
4 75
4 581
4 628
4 854
4 871
4 895
4 4946
5 17
7 14
7 400
7 3310
8 24
8 60
8 69
8 210
8 708
8 959
8 1696...

input:

6
5000 2506
1 2
1 151
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
3 6
3 91
3 1321
3 2203
4 15
4 23
4 62
4 64
4 75
4 581
4 628
4 854
4 871
4 895
4 4946
5 17
7 14
7 400
7 3310
8 24
8 60
8 69
8 210
8 708
8 959
8 1696...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1844kb

input:

5
9424319

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
339 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
339 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

6
5000 2517
1 5
2 3
2 19
2 21
2 34
2 41
2 45
2 94
2 112
2 151
2 3162
4 62
4 75
4 581
4 628
4 854
4 895
5 8
5 17
5 463
5 885
6 9
6 11
6 12
6 13
6 31
6 44
6 49
6 110
6 125
6 643
6 1206
7 14
7 959
7 3310
7 3633
10 18
15 29
15 39
16 26
16 109
16 181
16 193
16 215
16 232
16 524
16 594
16 720
16 761
16 83...

input:

6
5000 2517
1 5
2 3
2 19
2 21
2 34
2 41
2 45
2 94
2 112
2 151
2 3162
4 62
4 75
4 581
4 628
4 854
4 895
5 8
5 17
5 463
5 885
6 9
6 11
6 12
6 13
6 31
6 44
6 49
6 110
6 125
6 643
6 1206
7 14
7 959
7 3310
7 3633
10 18
15 29
15 39
16 26
16 109
16 181
16 193
16 215
16 232
16 524
16 594
16 720
16 761
16 83...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1844kb

input:

5
10955780

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
339 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
339 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

6
5000 2508
1 2
2 3
2 5
2 7
2 19
2 21
2 34
2 37
2 41
2 45
2 94
2 112
2 151
2 265
2 3162
4 15
6 11
6 12
6 13
6 17
6 31
6 44
6 49
6 110
6 125
6 463
6 643
6 885
6 1206
8 24
8 60
8 69
8 210
8 400
8 708
8 959
8 1696
8 1994
8 3310
8 3633
9 511
10 18
10 57
10 71
10 84
10 401
10 1072
10 2147
14 42
14 81
14 ...

input:

6
5000 2508
1 2
2 3
2 5
2 7
2 19
2 21
2 34
2 37
2 41
2 45
2 94
2 112
2 151
2 265
2 3162
4 15
6 11
6 12
6 13
6 17
6 31
6 44
6 49
6 110
6 125
6 463
6 643
6 885
6 1206
8 24
8 60
8 69
8 210
8 400
8 708
8 959
8 1696
8 1994
8 3310
8 3633
9 511
10 18
10 57
10 71
10 84
10 401
10 1072
10 2147
14 42
14 81
14 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1888kb,1844kb

input:

7
19938721

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

8
5000 2500
3 1321
3 2203
7 959
7 3310
7 3633
9 57
9 511
13 2236
13 3181
15 215
15 3914
17 2017
21 33
23 247
25 339
25 2709
31 2905
37 749
51 63
53 3131
55 3696
61 443
63 1195
63 3271
65 1557
69 917
69 1724
72 2261
72 4104
75 137
75 351
77 3237
79 165
79 907
80 375
85 341
85 4098
87 3067
88 991
91 3...

input:

8
5000 2500
3 1321
3 2203
7 959
7 3310
7 3633
9 57
9 511
13 2236
13 3181
15 215
15 3914
17 2017
21 33
23 247
25 339
25 2709
31 2905
37 749
51 63
53 3131
55 3696
61 443
63 1195
63 3271
65 1557
69 917
69 1724
72 2261
72 4104
75 137
75 351
77 3237
79 165
79 907
80 375
85 341
85 4098
87 3067
88 991
91 3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1852kb

input:

7
5129508

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
340 4358
1642 1870
180 446
1700 2042
992 1761
1650 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

8
5000 2500
3 15
3 2203
7 3310
7 3633
13 1853
17 2001
28 3060
31 2905
35 4125
36 4050
53 563
53 3131
55 551
64 1930
64 3271
69 1724
71 106
72 2261
72 4104
75 765
87 991
88 1081
88 3067
89 413
93 111
98 141
98 4249
99 4471
100 791
100 1457
106 311
107 179
108 2061
109 475
109 915
112 1503
112 2850
11...

input:

8
5000 2500
3 15
3 2203
7 3310
7 3633
13 1853
17 2001
28 3060
31 2905
35 4125
36 4050
53 563
53 3131
55 551
64 1930
64 3271
69 1724
71 106
72 2261
72 4104
75 765
87 991
88 1081
88 3067
89 413
93 111
98 141
98 4249
99 4471
100 791
100 1457
106 311
107 179
108 2061
109 475
109 915
112 1503
112 2850
11...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1848kb

input:

7
15332941

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
339 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
339 4358
1642 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

8
5000 2500
3 2203
7 959
9 511
13 1853
17 35
17 2017
23 2093
29 908
29 3020
37 4594
39 153
47 2693
47 4948
49 2051
52 1140
61 175
61 543
63 1195
63 1835
64 1930
64 3271
72 2261
72 4104
75 351
77 775
79 907
85 1181
85 4098
87 3067
88 1081
89 1945
95 3151
95 4057
97 4249
99 791
99 4471
100 1457
100 20...

input:

8
5000 2500
3 2203
7 959
9 511
13 1853
17 35
17 2017
23 2093
29 908
29 3020
37 4594
39 153
47 2693
47 4948
49 2051
52 1140
61 175
61 543
63 1195
63 1835
64 1930
64 3271
72 2261
72 4104
75 351
77 775
79 907
85 1181
85 4098
87 3067
88 1081
89 1945
95 3151
95 4057
97 4249
99 791
99 4471
100 1457
100 20...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 65
Accepted

Test #25:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1856kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
745 1361
339 4358
1642 1870
180 446
1699 2042
992 1761
1649 2497
1961 3502
211 2558
4542 4766
3146 3411
554 574
513 2840
551 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
745 1361
339 4358
1642 1870
180 446
1699 2042
992 1761
1649 2497
1961 3502
211 2558
4542 4766
3146 3411
554 574
513 2840
551 4554
2698 3496
3290 3868
2840 4371
1190...

output:

2
5000 2878
1 3
1 21
1 34
1 112
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 5
2 7
2 37
2 41
2 45
3 6
3 23
3 64
3 581
3 871
3 4946
4 62
4 628
4 854
4 895
5 9
5 12
5 13
5 17
5 463
5 643
5 885
6 11
6 31
6 44
6 49
6 125
7 14
7 708
7 959
7 3633
8 60
8 69
8 4...

input:

2
5000 2878
1 3
1 21
1 34
1 112
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 5
2 7
2 37
2 41
2 45
3 6
3 23
3 64
3 581
3 871
3 4946
4 62
4 628
4 854
4 895
5 9
5 12
5 13
5 17
5 463
5 643
5 885
6 11
6 31
6 44
6 49
6 125
7 14
7 708
7 959
7 3633
8 60
8 69
8 4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
355365355024496523

Test #26:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1856kb

input:

1
727827999106414164

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1641 1870
179 446
1700 2042
991 1761
1650 2497
1962 3502
211 2558
4541 4766
3145 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1189...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1641 1870
179 446
1700 2042
991 1761
1650 2497
1962 3502
211 2558
4541 4766
3145 3411
554 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1189...

output:

2
5000 2878
1 34
1 41
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 21
2 37
2 45
2 112
2 265
4 6
4 23
4 62
4 64
4 581
4 628
4 854
4 871
4 895
4 4946
5 12
5 125
6 9
6 11
6 13
6 17
6 31
6 44
6 49
6 463
6 643
6 885
7 60
7 400
7 1696
8 14
8 69
8 708
8 9...

input:

2
5000 2878
1 34
1 41
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 21
2 37
2 45
2 112
2 265
4 6
4 23
4 62
4 64
4 581
4 628
4 854
4 871
4 895
4 4946
5 12
5 125
6 9
6 11
6 13
6 17
6 31
6 44
6 49
6 463
6 643
6 885
7 60
7 400
7 1696
8 14
8 69
8 708
8 9...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
727827999106414164

Test #27:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1888kb,1860kb

input:

1
656410143989222955

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
179 446
1699 2042
992 1761
1649 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
551 4554
2697 3496
3290 3868
2839 4371
1189...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
746 1361
340 4358
1642 1870
179 446
1699 2042
992 1761
1649 2497
1962 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
551 4554
2697 3496
3290 3868
2839 4371
1189...

output:

2
5000 2878
1 5
1 45
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 7
2 21
2 34
2 37
2 41
2 112
2 265
3 23
3 64
3 854
3 871
3 4946
4 6
4 62
4 581
4 628
4 895
5 9
5 12
5 125
5 463
5 885
6 11
6 13
6 17
6 31
6 44
6 49
6 643
7 60
7 400
7 959
8 14
8 69
8 708
8 16...

input:

2
5000 2878
1 5
1 45
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 7
2 21
2 34
2 37
2 41
2 112
2 265
3 23
3 64
3 854
3 871
3 4946
4 6
4 62
4 581
4 628
4 895
5 9
5 12
5 125
5 463
5 885
6 11
6 13
6 17
6 31
6 44
6 49
6 643
7 60
7 400
7 959
8 14
8 69
8 708
8 16...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
656410143989222955

Test #28:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1856kb

input:

1
410366615149657534

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
745 1361
340 4358
1642 1870
180 446
1700 2042
991 1761
1650 2497
1961 3502
211 2558
4542 4766
3145 3411
553 574
513 2840
552 4554
2697 3496
3290 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
745 1361
340 4358
1642 1870
180 446
1700 2042
991 1761
1650 2497
1961 3502
211 2558
4542 4766
3145 3411
553 574
513 2840
552 4554
2697 3496
3290 3868
2839 4371
1190...

output:

2
5000 2878
1 3
1 7
1 21
1 37
1 45
1 112
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 5
2 34
2 41
3 6
3 23
3 64
3 628
3 854
3 871
3 895
3 4946
4 62
4 581
5 9
5 11
5 13
5 17
5 31
5 463
5 885
6 12
6 44
6 49
6 125
6 643
7 14
7 69
7 3633
8 60
8 400
8 708
8 9...

input:

2
5000 2878
1 3
1 7
1 21
1 37
1 45
1 112
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 5
2 34
2 41
3 6
3 23
3 64
3 628
3 854
3 871
3 895
3 4946
4 62
4 581
5 9
5 11
5 13
5 17
5 31
5 463
5 885
6 12
6 44
6 49
6 125
6 643
7 14
7 69
7 3633
8 60
8 400
8 708
8 9...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
410366615149657534

Test #29:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1852kb

input:

1
298090682780948428

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
745 1361
339 4358
1642 1870
180 446
1700 2042
991 1761
1650 2497
1962 3502
211 2558
4541 4766
3145 3411
554 574
513 2840
552 4554
2698 3496
3289 3868
2840 4371
1189...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
745 1361
339 4358
1642 1870
180 446
1700 2042
991 1761
1650 2497
1962 3502
211 2558
4541 4766
3145 3411
554 574
513 2840
552 4554
2698 3496
3289 3868
2840 4371
1189...

output:

2
5000 2878
1 21
1 34
1 112
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 37
2 41
2 45
3 23
3 62
3 871
4 6
4 64
4 581
4 628
4 854
4 895
4 4946
5 12
5 17
5 44
5 49
6 9
6 11
6 13
6 31
6 125
6 463
6 643
6 885
7 1696
7 3633
8 14
8 60
8 69
8 400
8 ...

input:

2
5000 2878
1 21
1 34
1 112
1 265
1 553
1 1116
1 1250
1 1603
1 2462
1 2869
1 3344
1 3616
1 3682
1 3912
1 4921
1 4994
2 3
2 5
2 7
2 37
2 41
2 45
3 23
3 62
3 871
4 6
4 64
4 581
4 628
4 854
4 895
4 4946
5 12
5 17
5 44
5 49
6 9
6 11
6 13
6 31
6 125
6 463
6 643
6 885
7 1696
7 3633
8 14
8 60
8 69
8 400
8 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
298090682780948428

Test #30:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1852kb

input:

3
969441916331132577

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
745 1361
340 4358
1642 1870
179 446
1699 2042
992 1761
1649 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
513 2840
551 4554
2698 3496
3289 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
745 1361
340 4358
1642 1870
179 446
1699 2042
992 1761
1649 2497
1962 3502
212 2558
4542 4766
3146 3411
553 574
513 2840
551 4554
2698 3496
3289 3868
2839 4371
1190...

output:

4
5000 2500
1 2
1 4
1 7
1 21
1 37
1 45
1 94
1 102
1 112
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
27 3060
52 1028
61 934
63 1195
72 4104
87 216
98 481
100 2056
105 1339
106 311
106 2077
107 2061
111 2850
118 801...

input:

4
5000 2500
1 2
1 4
1 7
1 21
1 37
1 45
1 94
1 102
1 112
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
27 3060
52 1028
61 934
63 1195
72 4104
87 216
98 481
100 2056
105 1339
106 311
106 2077
107 2061
111 2850
118 801...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
969441916331132577

Test #31:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1848kb

input:

3
929489812741933634

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
745 1361
339 4358
1642 1870
179 446
1700 2042
992 1761
1649 2497
1961 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
551 4554
2698 3496
3289 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
745 1361
339 4358
1642 1870
179 446
1700 2042
992 1761
1649 2497
1961 3502
212 2558
4542 4766
3146 3411
554 574
514 2840
551 4554
2698 3496
3289 3868
2840 4371
1190...

output:

4
5000 2500
1 2
1 3
1 5
1 19
1 21
1 94
1 102
1 112
1 151
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3162
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
9 71
24 247
27 3060
52 63
63 1835
63 3271
71 2261
80 129
80 907
99 791
99 1457
100 2056
100 4471
108 179
...

input:

4
5000 2500
1 2
1 3
1 5
1 19
1 21
1 94
1 102
1 112
1 151
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3162
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
9 71
24 247
27 3060
52 63
63 1835
63 3271
71 2261
80 129
80 907
99 791
99 1457
100 2056
100 4471
108 179
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
929489812741933634

Test #32:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1892kb,1844kb

input:

3
144032041325838295

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
745 1361
340 4358
1642 1870
180 446
1699 2042
991 1761
1649 2497
1961 3502
211 2558
4541 4766
3145 3411
554 574
513 2840
551 4554
2698 3496
3289 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
745 1361
340 4358
1642 1870
180 446
1699 2042
991 1761
1649 2497
1961 3502
211 2558
4541 4766
3145 3411
554 574
513 2840
551 4554
2698 3496
3289 3868
2839 4371
1190...

output:

4
5000 2500
1 2
1 3
1 19
1 34
1 45
1 94
1 112
1 265
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
32 325
32 2550
44 674
51 1140
52 1028
64 1930
64 3271
72 2261
73 3901
80 606
82 602
84 1597
96 1094
99 791
99 1457
10...

input:

4
5000 2500
1 2
1 3
1 19
1 34
1 45
1 94
1 112
1 265
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
32 325
32 2550
44 674
51 1140
52 1028
64 1930
64 3271
72 2261
73 3901
80 606
82 602
84 1597
96 1094
99 791
99 1457
10...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
144032041325838295

Test #33:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1888kb,1848kb

input:

3
832110946250826180

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1641 1870
179 446
1700 2042
992 1761
1649 2497
1961 3502
212 2558
4542 4766
3146 3411
553 574
513 2840
552 4554
2698 3496
3290 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
746 1361
340 4358
1641 1870
179 446
1700 2042
992 1761
1649 2497
1961 3502
212 2558
4542 4766
3146 3411
553 574
513 2840
552 4554
2698 3496
3290 3868
2839 4371
1190...

output:

4
5000 2500
1 2
1 3
1 4
1 7
1 34
1 37
1 41
1 45
1 102
1 151
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3162
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
17 2001
28 3060
58 171
60 115
64 1195
64 1930
65 2720
72 106
72 4104
82 602
87 3067
95 1094
97 4249
99...

input:

4
5000 2500
1 2
1 3
1 4
1 7
1 34
1 37
1 41
1 45
1 102
1 151
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3162
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
17 2001
28 3060
58 171
60 115
64 1195
64 1930
65 2720
72 106
72 4104
82 602
87 3067
95 1094
97 4249
99...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
832110946250826180

Test #34:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1848kb

input:

3
85728715707691821

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
745 1361
340 4358
1641 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
553 574
513 2840
552 4554
2698 3496
3290 3868
2839 4371
1189...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
745 1361
340 4358
1641 1870
180 446
1699 2042
992 1761
1650 2497
1962 3502
211 2558
4542 4766
3146 3411
553 574
513 2840
552 4554
2698 3496
3290 3868
2839 4371
1189...

output:

4
5000 2500
1 2
1 4
1 7
1 19
1 37
1 41
1 45
1 94
1 102
1 112
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
9 1072
27 468
27 1648
29 908
51 1140
61 175
61 3118
81 602
87 1081
93 111
93 1487
97 4249
103 445
105 1339
106 311...

input:

4
5000 2500
1 2
1 4
1 7
1 19
1 37
1 41
1 45
1 94
1 102
1 112
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
9 1072
27 468
27 1648
29 908
51 1140
61 175
61 3118
81 602
87 1081
93 111
93 1487
97 4249
103 445
105 1339
106 311...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
85728715707691821

Test #35:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1844kb

input:

5
777434612360931036

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
339 4358
1642 1870
179 446
1700 2042
992 1761
1650 2497
1961 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
339 4358
1642 1870
179 446
1700 2042
992 1761
1650 2497
1961 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2840 4371
1190...

output:

6
5000 2508
1 5
2 19
2 21
2 41
2 45
2 102
2 112
2 633
2 3162
3 6
3 23
3 75
3 91
3 871
3 1321
3 2203
4 15
4 62
4 64
4 581
4 628
4 854
4 895
4 4946
5 8
5 10
5 12
5 13
5 17
5 125
5 643
5 1206
7 14
7 24
7 60
7 400
7 708
7 1994
9 18
9 57
9 71
9 84
9 2147
11 30
16 26
16 181
16 193
16 232
16 524
16 761
16 ...

input:

6
5000 2508
1 5
2 19
2 21
2 41
2 45
2 102
2 112
2 633
2 3162
3 6
3 23
3 75
3 91
3 871
3 1321
3 2203
4 15
4 62
4 64
4 581
4 628
4 854
4 895
4 4946
5 8
5 10
5 12
5 13
5 17
5 125
5 643
5 1206
7 14
7 24
7 60
7 400
7 708
7 1994
9 18
9 57
9 71
9 84
9 2147
11 30
16 26
16 181
16 193
16 232
16 524
16 761
16 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
777434612360931036

Test #36:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1844kb

input:

5
705262511549880222

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
179 446
1700 2042
991 1761
1650 2497
1961 3502
211 2558
4541 4766
3145 3411
554 574
514 2840
552 4554
2697 3496
3290 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
340 4358
1642 1870
179 446
1700 2042
991 1761
1650 2497
1961 3502
211 2558
4541 4766
3145 3411
554 574
514 2840
552 4554
2697 3496
3290 3868
2839 4371
1190...

output:

6
5000 2532
1 2
2 4
2 7
2 21
2 34
2 37
2 41
2 102
2 112
2 633
2 3162
3 6
3 15
3 23
3 64
3 75
3 91
3 854
3 871
3 1321
3 2203
3 4946
5 17
8 69
8 210
8 959
8 1994
8 3310
9 57
9 71
9 84
10 18
10 401
10 511
10 1072
10 2147
11 30
11 118
11 963
11 1746
11 2096
11 2428
11 2994
12 16
12 28
12 53
12 78
12 280...

input:

6
5000 2532
1 2
2 4
2 7
2 21
2 34
2 37
2 41
2 102
2 112
2 633
2 3162
3 6
3 15
3 23
3 64
3 75
3 91
3 854
3 871
3 1321
3 2203
3 4946
5 17
8 69
8 210
8 959
8 1994
8 3310
9 57
9 71
9 84
10 18
10 401
10 511
10 1072
10 2147
11 30
11 118
11 963
11 1746
11 2096
11 2428
11 2994
12 16
12 28
12 53
12 78
12 280...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
705262511549880222

Test #37:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1896kb,1848kb

input:

5
510318082834167951

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
339 4358
1641 1870
180 446
1699 2042
991 1761
1649 2497
1962 3502
211 2558
4541 4766
3145 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2839 4371
1189...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
746 1361
339 4358
1641 1870
180 446
1699 2042
991 1761
1649 2497
1962 3502
211 2558
4541 4766
3145 3411
553 574
514 2840
552 4554
2698 3496
3290 3868
2839 4371
1189...

output:

6
5000 2521
1 5
2 3
2 19
2 34
2 94
2 102
2 112
2 151
4 6
4 15
4 62
4 91
4 581
4 628
4 2203
5 8
5 10
5 11
5 12
5 31
5 125
5 463
5 885
7 400
7 959
7 1696
9 18
9 57
9 2147
13 81
13 1018
13 1853
13 2490
13 3181
14 42
14 127
14 226
14 529
14 642
14 1440
14 2236
14 3394
16 193
16 215
16 232
16 594
16 720
...

input:

6
5000 2521
1 5
2 3
2 19
2 34
2 94
2 102
2 112
2 151
4 6
4 15
4 62
4 91
4 581
4 628
4 2203
5 8
5 10
5 11
5 12
5 31
5 125
5 463
5 885
7 400
7 959
7 1696
9 18
9 57
9 2147
13 81
13 1018
13 1853
13 2490
13 3181
14 42
14 127
14 226
14 529
14 642
14 1440
14 2236
14 3394
16 193
16 215
16 232
16 594
16 720
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
510318082834167951

Test #38:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1844kb

input:

5
914858813253258744

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
745 1361
340 4358
1641 1870
179 446
1700 2042
992 1761
1650 2497
1961 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
551 4554
2697 3496
3290 3868
2840 4371
1189...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
745 1361
340 4358
1641 1870
179 446
1700 2042
992 1761
1650 2497
1961 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
551 4554
2697 3496
3290 3868
2840 4371
1189...

output:

6
5000 2522
1 2
1 4
1 7
1 19
1 21
1 34
1 37
1 41
1 112
1 151
1 265
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3162
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
3 23
5 8
5 13
5 17
5 31
5 1206
6 9
6 10
6 11
6 12
6 44
6 49
6 110
6 125
6 463
6 643
6 885
14 10...

input:

6
5000 2522
1 2
1 4
1 7
1 19
1 21
1 34
1 37
1 41
1 112
1 151
1 265
1 553
1 633
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3162
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
3 23
5 8
5 13
5 17
5 31
5 1206
6 9
6 10
6 11
6 12
6 44
6 49
6 110
6 125
6 463
6 643
6 885
14 10...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
914858813253258744

Test #39:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1896kb,1848kb

input:

5
659635316746638238

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
745 1361
340 4358
1641 1870
179 446
1700 2042
991 1761
1649 2497
1962 3502
211 2558
4542 4766
3145 3411
553 574
513 2840
551 4554
2697 3496
3289 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
745 1361
340 4358
1641 1870
179 446
1700 2042
991 1761
1649 2497
1962 3502
211 2558
4542 4766
3145 3411
553 574
513 2840
551 4554
2697 3496
3289 3868
2839 4371
1190...

output:

6
5000 2536
1 2
1 4
1 7
1 19
1 37
1 41
1 45
1 94
1 112
1 151
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3162
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
3 6
3 15
3 23
3 62
3 64
3 75
3 91
3 581
3 628
3 854
3 871
3 895
3 1321
3 4946
5 49
8 708
8 959
8 1696...

input:

6
5000 2536
1 2
1 4
1 7
1 19
1 37
1 41
1 45
1 94
1 112
1 151
1 265
1 553
1 1012
1 1116
1 1250
1 1603
1 1958
1 1962
1 2462
1 2869
1 3162
1 3344
1 3466
1 3579
1 3616
1 3682
1 3912
1 4536
1 4921
1 4994
3 6
3 15
3 23
3 62
3 64
3 75
3 91
3 581
3 628
3 854
3 871
3 895
3 1321
3 4946
5 49
8 708
8 959
8 1696...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659635316746638238

Test #40:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1892kb,1844kb

input:

7
858490260563149759

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
745 1361
339 4358
1641 1870
179 446
1699 2042
991 1761
1650 2497
1961 3502
212 2558
4541 4766
3145 3411
553 574
513 2840
551 4554
2697 3496
3290 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
745 1361
339 4358
1641 1870
179 446
1699 2042
991 1761
1650 2497
1961 3502
212 2558
4541 4766
3145 3411
553 574
513 2840
551 4554
2697 3496
3290 3868
2839 4371
1190...

output:

8
5000 2500
6 1206
8 210
14 3181
14 3394
16 838
16 2572
17 2017
20 2409
24 312
28 924
29 908
30 3020
32 2550
34 1065
34 4350
46 3112
48 166
48 350
51 1140
52 92
60 230
62 3118
64 1930
70 252
71 200
71 4104
72 106
76 98
79 907
88 216
92 510
92 3033
96 4494
97 4249
98 2012
100 2056
101 1282
101 1970
1...

input:

8
5000 2500
6 1206
8 210
14 3181
14 3394
16 838
16 2572
17 2017
20 2409
24 312
28 924
29 908
30 3020
32 2550
34 1065
34 4350
46 3112
48 166
48 350
51 1140
52 92
60 230
62 3118
64 1930
70 252
71 200
71 4104
72 106
76 98
79 907
88 216
92 510
92 3033
96 4494
97 4249
98 2012
100 2056
101 1282
101 1970
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
858490260563149759

Test #41:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1888kb,1844kb

input:

7
860058643727731209

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
745 1361
339 4358
1642 1870
179 446
1699 2042
991 1761
1649 2497
1961 3502
212 2558
4541 4766
3145 3411
554 574
513 2840
552 4554
2697 3496
3290 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
745 1361
339 4358
1642 1870
179 446
1699 2042
991 1761
1649 2497
1961 3502
212 2558
4541 4766
3145 3411
554 574
513 2840
552 4554
2697 3496
3290 3868
2839 4371
1190...

output:

8
5000 2500
23 1299
23 2093
27 1648
30 3020
35 4050
38 4594
51 63
51 1140
52 92
70 222
70 1724
71 2261
71 4104
72 106
72 200
74 1760
74 3901
82 258
88 216
92 510
98 4249
99 791
99 1457
100 4471
105 1339
108 2061
114 1154
118 1061
119 1075
119 1570
121 2142
123 669
124 607
125 3195
127 1883
130 3760
...

input:

8
5000 2500
23 1299
23 2093
27 1648
30 3020
35 4050
38 4594
51 63
51 1140
52 92
70 222
70 1724
71 2261
71 4104
72 106
72 200
74 1760
74 3901
82 258
88 216
92 510
98 4249
99 791
99 1457
100 4471
105 1339
108 2061
114 1154
118 1061
119 1075
119 1570
121 2142
123 669
124 607
125 3195
127 1883
130 3760
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
860058643727731209

Test #42:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1888kb,1844kb

input:

7
718861404514377808

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
745 1361
339 4358
1642 1870
179 446
1700 2042
991 1761
1650 2497
1961 3502
212 2558
4541 4766
3145 3411
554 574
514 2840
552 4554
2697 3496
3290 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
745 1361
339 4358
1642 1870
179 446
1700 2042
991 1761
1650 2497
1961 3502
212 2558
4541 4766
3145 3411
554 574
514 2840
552 4554
2697 3496
3290 3868
2839 4371
1190...

output:

8
5000 2500
23 359
27 924
27 3060
36 4125
51 1140
55 4260
63 1835
69 301
71 4104
72 106
77 775
79 129
91 418
93 1486
99 1457
100 791
100 4471
103 797
105 1339
105 2077
108 2061
112 2850
112 3058
113 1196
115 4692
117 2859
123 607
123 1396
124 669
127 1883
129 435
137 4084
143 1329
145 3714
153 1241
...

input:

8
5000 2500
23 359
27 924
27 3060
36 4125
51 1140
55 4260
63 1835
69 301
71 4104
72 106
77 775
79 129
91 418
93 1486
99 1457
100 791
100 4471
103 797
105 1339
105 2077
108 2061
112 2850
112 3058
113 1196
115 4692
117 2859
123 607
123 1396
124 669
127 1883
129 435
137 4084
143 1329
145 3714
153 1241
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
718861404514377808

Test #43:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1888kb,1848kb

input:

7
659192688464047828

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
745 1361
339 4358
1642 1870
179 446
1700 2042
991 1761
1649 2497
1962 3502
212 2558
4541 4766
3145 3411
553 574
513 2840
551 4554
2697 3496
3289 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
745 1361
339 4358
1642 1870
179 446
1700 2042
991 1761
1649 2497
1962 3502
212 2558
4541 4766
3145 3411
553 574
513 2840
551 4554
2697 3496
3289 3868
2839 4371
1190...

output:

8
5000 2500
28 924
32 2550
32 2905
36 716
42 486
42 4801
44 674
48 166
48 260
51 1140
67 126
96 3151
96 4057
99 791
99 1457
99 4471
100 2056
105 1339
106 311
107 579
110 1086
111 2850
112 1503
112 3058
116 2768
118 2389
118 3540
122 2238
123 607
123 1559
124 669
128 1883
138 717
144 148
144 174
154 ...

input:

8
5000 2500
28 924
32 2550
32 2905
36 716
42 486
42 4801
44 674
48 166
48 260
51 1140
67 126
96 3151
96 4057
99 791
99 1457
99 4471
100 2056
105 1339
106 311
107 579
110 1086
111 2850
112 1503
112 3058
116 2768
118 2389
118 3540
122 2238
123 607
123 1559
124 669
128 1883
138 717
144 148
144 174
154 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659192688464047828

Test #44:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1888kb,1844kb

input:

7
685730986714800201

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
339 4358
1641 1870
179 446
1699 2042
992 1761
1649 2497
1961 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3289 3868
2839 4371
1190...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
746 1361
339 4358
1641 1870
179 446
1699 2042
992 1761
1649 2497
1961 3502
212 2558
4542 4766
3146 3411
553 574
514 2840
552 4554
2698 3496
3289 3868
2839 4371
1190...

output:

8
5000 2500
29 1485
29 3020
31 1893
43 324
43 1642
47 4948
51 1028
52 1140
55 3696
57 3360
60 115
63 1835
63 3271
69 301
73 2520
73 3901
79 907
82 157
83 360
93 199
93 1487
100 791
100 1457
101 345
103 445
103 797
103 2512
105 2077
106 1339
107 1374
111 1503
111 2850
112 3058
123 607
123 669
126 131...

input:

8
5000 2500
29 1485
29 3020
31 1893
43 324
43 1642
47 4948
51 1028
52 1140
55 3696
57 3360
60 115
63 1835
63 3271
69 301
73 2520
73 3901
79 907
82 157
83 360
93 199
93 1487
100 791
100 1457
101 345
103 445
103 797
103 2512
105 2077
106 1339
107 1374
111 1503
111 2850
112 3058
123 607
123 669
126 131...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
685730986714800201