QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#422703#8726. Magic ShowCall_me_Eric100 ✓1ms1872kbC++141.4kb2024-05-27 18:52:152024-05-27 18:52:15

Judging History

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

  • [2024-05-27 18:52:15]
  • 评测
  • 测评结果:100
  • 用时:1ms
  • 内存:1872kb
  • [2024-05-27 18:52:15]
  • 提交

Alice

#include<bits/stdc++.h>
#include "Alice.h"
using namespace std;
std::vector<std::pair<int,int>> Alice(){
    int n = 5000;
    long long X = setN(n);
    vector<pair<int,int> > ans;
    for(int i = 2;i < n;i++)ans.emplace_back(i,(X % i == 0) ? n : (X % i));
    ans.emplace_back(n, 1);
    return ans;
}

Bob

#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
#define i128 __int128
i128 exgcd(i128 a,i128 b,i128 &x,i128 &y){
    i128 g = a;
    if(b == 0){x = 1, y = 0;}
    else{g = exgcd(b,a % b,y,x);y -= a / b * x;}
    return g;
}
inline i128 gcd(i128 x,i128 y){return __gcd(x, y);}
inline i128 lcm(i128 x,i128 y){return x / gcd(x, y) * y;}
i128 a = -1, b;
void add(i128 A,i128 B){
    if(a == -1){a = A, b = B;return;}
    i128 y0, Y0;exgcd(a,A,y0,Y0);
    i128 t0 = y0 * ((B - b) / gcd(a,A)) % (A / gcd(a, A));
    t0 = (t0 + A / gcd(a, A)) % (A / gcd(a,A));
    b = (b + a * t0);a = lcm(a,A);b %= a;
}
long long Bob(std::vector<std::pair<int,int>> V){
    int p = 0;long long mx = 1e18;
    while(a < 1e18){
        if(V[p].second != 5000)add(V[p].second,V[p].first);
        p++;
    }
    return b % mx;
}

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

1
4005

output:

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

input:

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

output:

2
5000 3882
1 2
1 4
1 7
1 11
1 22
1 28
1 44
1 52
1 77
1 91
1 154
1 364
1 2002
1 4004
1 5000
3 6
3 29
3 58
3 69
3 87
3 138
3 174
3 667
3 1334
3 4002
4 4001
5 8
5 10
5 16
5 20
5 25
5 32
5 40
5 50
5 80
5 100
5 125
5 200
5 250
5 400
5 500
5 800
5 1000
5 5000
6 31
6 43
6 93
6 129
6 3999
7 1999
7 3998
8 5...

input:

2
5000 3882
1 2
1 4
1 7
1 11
1 22
1 28
1 44
1 52
1 77
1 91
1 154
1 364
1 2002
1 4004
1 5000
3 6
3 29
3 58
3 69
3 87
3 138
3 174
3 667
3 1334
3 4002
4 4001
5 8
5 10
5 16
5 20
5 25
5 32
5 40
5 50
5 80
5 100
5 125
5 200
5 250
5 400
5 500
5 800
5 1000
5 5000
6 31
6 43
6 93
6 129
6 3999
7 1999
7 3998
8 5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

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

input:

1
459

output:

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

input:

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

output:

2
5000 3882
1 2
1 229
1 458
1 5000
2 457
3 4
3 6
3 8
3 12
3 19
3 24
3 38
3 57
3 76
3 114
3 152
3 228
3 456
4 5
4 7
4 35
4 65
4 91
5 454
6 151
6 453
7 113
7 226
7 452
8 11
8 41
8 451
9 10
9 15
9 18
9 25
9 30
9 45
9 50
9 75
9 90
9 150
9 225
9 450
9 5000
10 449
11 16
11 28
11 32
11 64
11 224
11 448
12 ...

input:

2
5000 3882
1 2
1 229
1 458
1 5000
2 457
3 4
3 6
3 8
3 12
3 19
3 24
3 38
3 57
3 76
3 114
3 152
3 228
3 456
4 5
4 7
4 35
4 65
4 91
5 454
6 151
6 453
7 113
7 226
7 452
8 11
8 41
8 451
9 10
9 15
9 18
9 25
9 30
9 45
9 50
9 75
9 90
9 150
9 225
9 450
9 5000
10 449
11 16
11 28
11 32
11 64
11 224
11 448
12 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

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

input:

1
2495

output:

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

input:

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

output:

2
5000 3882
1 2
1 29
1 43
1 58
1 86
1 1247
1 2494
1 5000
2 9
2 277
2 831
3 4
3 7
3 28
3 89
3 178
3 356
3 1246
3 2492
4 53
4 2491
5 6
5 10
5 15
5 30
5 83
5 166
5 249
5 415
5 498
5 830
5 1245
5 2490
5 5000
6 19
6 131
6 2489
7 8
7 311
7 622
7 1244
7 2488
8 829
8 2487
9 11
9 22
9 113
9 226
9 1243
9 2486...

input:

2
5000 3882
1 2
1 29
1 43
1 58
1 86
1 1247
1 2494
1 5000
2 9
2 277
2 831
3 4
3 7
3 28
3 89
3 178
3 356
3 1246
3 2492
4 53
4 2491
5 6
5 10
5 15
5 30
5 83
5 166
5 249
5 415
5 498
5 830
5 1245
5 2490
5 5000
6 19
6 131
6 2489
7 8
7 311
7 622
7 1244
7 2488
8 829
8 2487
9 11
9 22
9 113
9 226
9 1243
9 2486...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

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

input:

3
1560

output:

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

input:

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

output:

4
5000 3438
1560 1561
1560 1562
1560 1563
1560 1564
1560 1565
1560 1566
1560 1567
1560 1568
1560 1569
1560 1570
1560 1571
1560 1572
1560 1573
1560 1574
1560 1575
1560 1576
1560 1577
1560 1578
1560 1579
1560 1580
1560 1581
1560 1582
1560 1583
1560 1584
1560 1585
1560 1586
1560 1587
1560 1588
1560 158...

input:

4
5000 3438
1560 1561
1560 1562
1560 1563
1560 1564
1560 1565
1560 1566
1560 1567
1560 1568
1560 1569
1560 1570
1560 1571
1560 1572
1560 1573
1560 1574
1560 1575
1560 1576
1560 1577
1560 1578
1560 1579
1560 1580
1560 1581
1560 1582
1560 1583
1560 1584
1560 1585
1560 1586
1560 1587
1560 1588
1560 158...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

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

input:

3
3594

output:

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

input:

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

output:

4
5000 2500
1 3593
11 3583
13 3581
23 3571
35 3559
37 3557
47 3547
53 3541
55 3539
61 3533
65 3529
67 3527
77 3517
83 3511
95 3499
103 3491
113 3481
125 3469
127 3467
131 3463
133 3461
137 3457
145 3449
161 3433
163 3431
167 3427
181 3413
187 3407
191 3403
193 3401
197 3397
203 3391
205 3389
211 338...

input:

4
5000 2500
1 3593
11 3583
13 3581
23 3571
35 3559
37 3557
47 3547
53 3541
55 3539
61 3533
65 3529
67 3527
77 3517
83 3511
95 3499
103 3491
113 3481
125 3469
127 3467
131 3463
133 3461
137 3457
145 3449
161 3433
163 3431
167 3427
181 3413
187 3407
191 3403
193 3401
197 3397
203 3391
205 3389
211 338...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

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

input:

3
1750

output:

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

input:

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

output:

4
5000 3248
1750 1751
1750 1752
1750 1753
1750 1754
1750 1755
1750 1756
1750 1757
1750 1758
1750 1759
1750 1760
1750 1761
1750 1762
1750 1763
1750 1764
1750 1765
1750 1766
1750 1767
1750 1768
1750 1769
1750 1770
1750 1771
1750 1772
1750 1773
1750 1774
1750 1775
1750 1776
1750 1777
1750 1778
1750 177...

input:

4
5000 3248
1750 1751
1750 1752
1750 1753
1750 1754
1750 1755
1750 1756
1750 1757
1750 1758
1750 1759
1750 1760
1750 1761
1750 1762
1750 1763
1750 1764
1750 1765
1750 1766
1750 1767
1750 1768
1750 1769
1750 1770
1750 1771
1750 1772
1750 1773
1750 1774
1750 1775
1750 1776
1750 1777
1750 1778
1750 177...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

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

input:

5
4878

output:

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

input:

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

output:

6
5000 2560
1 4877
2 4
2 23
2 46
2 53
2 92
2 106
2 212
2 1219
2 2438
2 4876
3 5
3 13
3 15
3 25
3 39
3 65
3 75
3 125
3 195
3 325
3 375
3 975
3 1625
3 4875
6 7
6 8
6 12
6 14
6 21
6 24
6 28
6 29
6 42
6 56
6 58
6 84
6 87
6 116
6 168
6 174
6 203
6 232
6 348
6 406
6 609
6 696
6 812
6 1218
6 1624
6 2436
6 ...

input:

6
5000 2560
1 4877
2 4
2 23
2 46
2 53
2 92
2 106
2 212
2 1219
2 2438
2 4876
3 5
3 13
3 15
3 25
3 39
3 65
3 75
3 125
3 195
3 325
3 375
3 975
3 1625
3 4875
6 7
6 8
6 12
6 14
6 21
6 24
6 28
6 29
6 42
6 56
6 58
6 84
6 87
6 116
6 168
6 174
6 203
6 232
6 348
6 406
6 609
6 696
6 812
6 1218
6 1624
6 2436
6 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

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

input:

5
1223

output:

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

input:

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

output:

6
5000 4388
1 2
1 13
1 26
1 47
1 94
1 1222
1 5000
3 4
3 5
3 10
3 20
3 61
3 122
3 244
3 305
3 610
3 1220
6 1217
7 8
7 16
7 19
7 32
7 38
7 64
7 76
7 152
7 304
7 608
7 1216
9 607
9 1214
11 12
11 101
11 202
11 303
11 404
11 606
11 1212
14 31
14 39
14 93
14 403
14 1209
15 151
15 302
15 604
15 1208
17 18
...

input:

6
5000 4388
1 2
1 13
1 26
1 47
1 94
1 1222
1 5000
3 4
3 5
3 10
3 20
3 61
3 122
3 244
3 305
3 610
3 1220
6 1217
7 8
7 16
7 19
7 32
7 38
7 64
7 76
7 152
7 304
7 608
7 1216
9 607
9 1214
11 12
11 101
11 202
11 303
11 404
11 606
11 1212
14 31
14 39
14 93
14 403
14 1209
15 151
15 302
15 604
15 1208
17 18
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

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

input:

5
648

output:

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

input:

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

output:

6
5000 4675
1 647
2 17
2 19
2 34
2 38
2 323
2 646
3 5
3 15
3 43
3 129
3 215
3 645
4 7
4 14
4 23
4 28
4 46
4 92
4 161
4 322
4 644
6 107
6 214
6 321
6 642
8 10
8 16
8 20
8 32
8 40
8 64
8 80
8 128
8 160
8 320
8 640
9 71
9 213
9 639
11 13
11 49
11 91
11 637
12 53
12 106
12 159
12 212
12 318
12 636
18 21...

input:

6
5000 4675
1 647
2 17
2 19
2 34
2 38
2 323
2 646
3 5
3 15
3 43
3 129
3 215
3 645
4 7
4 14
4 23
4 28
4 46
4 92
4 161
4 322
4 644
6 107
6 214
6 321
6 642
8 10
8 16
8 20
8 32
8 40
8 64
8 80
8 128
8 160
8 320
8 640
9 71
9 213
9 639
11 13
11 49
11 91
11 637
12 53
12 106
12 159
12 212
12 318
12 636
18 21...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

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

input:

7
4475

output:

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

input:

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

output:

8
5000 2500
8 4467
12 4463
14 4461
18 4457
24 4451
26 4449
28 4447
32 4443
33 4442
34 4441
36 4439
40 4435
46 4429
48 4427
49 4426
52 4423
54 4421
58 4417
60 4415
61 2207
61 4414
62 4413
64 4411
66 4409
69 4406
70 4405
76 4399
78 4397
82 4393
84 4391
88 4387
90 4385
94 4381
96 4379
98 4377
102 4373
...

input:

8
5000 2500
8 4467
12 4463
14 4461
18 4457
24 4451
26 4449
28 4447
32 4443
33 4442
34 4441
36 4439
40 4435
46 4429
48 4427
49 4426
52 4423
54 4421
58 4417
60 4415
61 2207
61 4414
62 4413
64 4411
66 4409
69 4406
70 4405
76 4399
78 4397
82 4393
84 4391
88 4387
90 4385
94 4381
96 4379
98 4377
102 4373
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

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

input:

7
4240

output:

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

input:

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

output:

8
5000 2500
9 4231
11 4229
13 4227
14 4226
18 4222
21 4219
23 4217
27 4213
29 4211
33 4207
39 4201
42 4198
43 4197
45 4195
47 4193
53 4187
57 4183
59 113
59 4181
62 2089
62 4178
63 4177
66 4174
69 4171
71 4169
74 4166
77 4163
78 4162
81 4159
83 4157
87 4153
89 593
89 4151
95 4145
97 4143
99 4141
101...

input:

8
5000 2500
9 4231
11 4229
13 4227
14 4226
18 4222
21 4219
23 4217
27 4213
29 4211
33 4207
39 4201
42 4198
43 4197
45 4195
47 4193
53 4187
57 4183
59 113
59 4181
62 2089
62 4178
63 4177
66 4174
69 4171
71 4169
74 4166
77 4163
78 4162
81 4159
83 4157
87 4153
89 593
89 4151
95 4145
97 4143
99 4141
101...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

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

input:

7
1291

output:

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

input:

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

output:

8
5000 2500
1291 1293
1291 1294
1291 1295
1291 1296
1291 1297
1291 1298
1291 1301
1291 1302
1291 1303
1291 1304
1291 1305
1291 1306
1291 1307
1291 1308
1291 1309
1291 1310
1291 1311
1291 1312
1291 1313
1291 1314
1291 1316
1291 1317
1291 1318
1291 1319
1291 1321
1291 1322
1291 1323
1291 1324
1291 132...

input:

8
5000 2500
1291 1293
1291 1294
1291 1295
1291 1296
1291 1297
1291 1298
1291 1301
1291 1302
1291 1303
1291 1304
1291 1305
1291 1306
1291 1307
1291 1308
1291 1309
1291 1310
1291 1311
1291 1312
1291 1313
1291 1314
1291 1316
1291 1317
1291 1318
1291 1319
1291 1321
1291 1322
1291 1323
1291 1324
1291 132...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1828kb

input:

1
17476204

output:

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

input:

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

output:

2
5000 3882
1 321
1 5000
2 5000
3 1187
4 5
4 6
4 7
4 8
4 9
4 10
4 12
4 15
4 18
4 19
4 20
4 21
4 24
4 25
4 28
4 30
4 35
4 36
4 38
4 40
4 42
4 45
4 50
4 57
4 60
4 63
4 70
4 72
4 73
4 75
4 76
4 84
4 90
4 95
4 100
4 105
4 114
4 120
4 126
4 140
4 146
4 150
4 152
4 168
4 171
4 180
4 190
4 200
4 210
4 219
...

input:

2
5000 3882
1 321
1 5000
2 5000
3 1187
4 5
4 6
4 7
4 8
4 9
4 10
4 12
4 15
4 18
4 19
4 20
4 21
4 24
4 25
4 28
4 30
4 35
4 36
4 38
4 40
4 42
4 45
4 50
4 57
4 60
4 63
4 70
4 72
4 73
4 75
4 76
4 84
4 90
4 95
4 100
4 105
4 114
4 120
4 126
4 140
4 146
4 150
4 152
4 168
4 171
4 180
4 190
4 200
4 210
4 219
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1872kb,1828kb

input:

1
11926600

output:

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

input:

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

output:

2
5000 3882
1 31
1 93
1 257
1 499
1 771
1 1497
1 5000
2 29
2 58
2 122
2 1769
2 3371
2 3538
2 5000
3 2137
4 6
4 11
4 12
4 22
4 44
4 66
4 132
4 5000
5 5000
6 73
6 146
7 9
7 21
7 63
7 5000
8 16
8 32
8 64
8 331
8 563
8 1126
8 1324
8 2252
8 4504
8 5000
9 179
10 15
10 30
10 39
10 53
10 65
10 78
10 130
10 ...

input:

2
5000 3882
1 31
1 93
1 257
1 499
1 771
1 1497
1 5000
2 29
2 58
2 122
2 1769
2 3371
2 3538
2 5000
3 2137
4 6
4 11
4 12
4 22
4 44
4 66
4 132
4 5000
5 5000
6 73
6 146
7 9
7 21
7 63
7 5000
8 16
8 32
8 64
8 331
8 563
8 1126
8 1324
8 2252
8 4504
8 5000
9 179
10 15
10 30
10 39
10 53
10 65
10 78
10 130
10 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1828kb

input:

1
16602378

output:

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

input:

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

output:

2
5000 3882
1 11
1 5000
2 4
2 7
2 8
2 28
2 41
2 49
2 82
2 98
2 164
2 196
2 287
2 328
2 392
2 574
2 1033
2 1148
2 2066
2 2296
2 4132
2 5000
3 5
3 15
3 25
3 75
3 125
3 375
4 94
4 478
4 1478
5 2417
6 9
6 12
6 18
6 36
6 197
6 394
6 591
6 788
6 1182
6 2341
6 2364
6 5000
7 19
7 199
7 4391
8 10
8 17
8 34
8...

input:

2
5000 3882
1 11
1 5000
2 4
2 7
2 8
2 28
2 41
2 49
2 82
2 98
2 164
2 196
2 287
2 328
2 392
2 574
2 1033
2 1148
2 2066
2 2296
2 4132
2 5000
3 5
3 15
3 25
3 75
3 125
3 375
4 94
4 478
4 1478
5 2417
6 9
6 12
6 18
6 36
6 197
6 394
6 591
6 788
6 1182
6 2341
6 2364
6 5000
7 19
7 199
7 4391
8 10
8 17
8 34
8...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1800kb

input:

3
13129243

output:

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

input:

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

output:

4
5000 2500
5 467
5 934
6 11
8 35
9 1226
10 43
11 16
16 373
16 1119
16 3357
16 3911
18 41
18 1025
20 263
22 107
22 321
22 749
22 2247
23 26
23 65
23 130
23 260
24 2729
24 4811
27 32
27 64
27 128
27 256
27 512
32 59
32 1153
35 947
35 1733
35 1894
35 3466
35 3788
36 49
36 637
37 167
37 334
37 501
37 1...

input:

4
5000 2500
5 467
5 934
6 11
8 35
9 1226
10 43
11 16
16 373
16 1119
16 3357
16 3911
18 41
18 1025
20 263
22 107
22 321
22 749
22 2247
23 26
23 65
23 130
23 260
24 2729
24 4811
27 32
27 64
27 128
27 256
27 512
32 59
32 1153
35 947
35 1733
35 1894
35 3466
35 3788
36 49
36 637
37 167
37 334
37 501
37 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1804kb

input:

3
7892141

output:

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

input:

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

output:

4
5000 2500
2 3
3 83
3 166
4 11
4 407
8 557
8 1671
8 4723
10 41
11 15
11 30
15 22
18 877
24 2713
24 2909
25 547
25 1094
25 2188
25 3607
28 857
29 48
31 358
31 895
31 1790
31 4409
32 227
32 2043
32 3863
36 115
36 1495
38 73
38 219
41 45
41 50
41 54
41 60
41 74
41 75
41 79
41 90
41 100
41 108
41 111
4...

input:

4
5000 2500
2 3
3 83
3 166
4 11
4 407
8 557
8 1671
8 4723
10 41
11 15
11 30
15 22
18 877
24 2713
24 2909
25 547
25 1094
25 2188
25 3607
28 857
29 48
31 358
31 895
31 1790
31 4409
32 227
32 2043
32 3863
36 115
36 1495
38 73
38 219
41 45
41 50
41 54
41 60
41 74
41 75
41 79
41 90
41 100
41 108
41 111
4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1864kb,1804kb

input:

3
21314775

output:

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

input:

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

output:

4
5000 2500
1 2
1 13
1 26
8 439
8 2111
9 11
9 33
9 66
10 1231
10 3463
11 853
11 1706
11 3412
13 14
16 73
19 86
19 172
24 57
25 50
25 125
25 250
28 1237
33 61
33 122
33 366
34 1267
37 74
37 113
37 226
37 2549
37 4181
38 101
38 239
38 883
40 47
40 611
40 3055
41 137
41 274
41 959
41 1918
52 809
53 143...

input:

4
5000 2500
1 2
1 13
1 26
8 439
8 2111
9 11
9 33
9 66
10 1231
10 3463
11 853
11 1706
11 3412
13 14
16 73
19 86
19 172
24 57
25 50
25 125
25 250
28 1237
33 61
33 122
33 366
34 1267
37 74
37 113
37 226
37 2549
37 4181
38 101
38 239
38 883
40 47
40 611
40 3055
41 137
41 274
41 959
41 1918
52 809
53 143...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1808kb

input:

5
5559540

output:

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

input:

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

output:

6
5000 2532
1 2333
1 2383
2 5000
3 23
3 69
3 197
3 409
3 591
3 1227
3 4531
4 8
4 16
4 47
4 94
4 188
4 376
4 752
5 283
5 1415
5 3929
6 9
6 18
6 73
6 146
6 219
6 438
6 657
6 1314
6 4231
7 19
7 133
12 13
12 24
12 26
12 39
12 52
12 78
12 103
12 104
12 156
12 173
12 206
12 309
12 312
12 346
12 412
12 519...

input:

6
5000 2532
1 2333
1 2383
2 5000
3 23
3 69
3 197
3 409
3 591
3 1227
3 4531
4 8
4 16
4 47
4 94
4 188
4 376
4 752
5 283
5 1415
5 3929
6 9
6 18
6 73
6 146
6 219
6 438
6 657
6 1314
6 4231
7 19
7 133
12 13
12 24
12 26
12 39
12 52
12 78
12 103
12 104
12 156
12 173
12 206
12 309
12 312
12 346
12 412
12 519...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1872kb,1804kb

input:

5
9424319

output:

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

input:

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

output:

6
5000 2642
1 83
1 166
1 5000
2 3
3 11
3 22
3 44
4 5
5 6
5 18
7 8
9 10
12 17
12 37
12 629
13 59
13 118
14 15
14 33
14 45
14 55
14 79
14 99
14 165
14 237
14 241
14 395
14 495
14 711
14 723
14 869
14 1185
14 1205
14 2169
14 2607
14 2651
14 3555
14 3615
14 4345
16 389
16 2723
16 3461
19 20
19 25
19 50
...

input:

6
5000 2642
1 83
1 166
1 5000
2 3
3 11
3 22
3 44
4 5
5 6
5 18
7 8
9 10
12 17
12 37
12 629
13 59
13 118
14 15
14 33
14 45
14 55
14 79
14 99
14 165
14 237
14 241
14 395
14 495
14 711
14 723
14 869
14 1185
14 1205
14 2169
14 2607
14 2651
14 3555
14 3615
14 4345
16 389
16 2723
16 3461
19 20
19 25
19 50
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1864kb,1804kb

input:

5
10955780

output:

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

input:

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

output:

6
5000 2505
1 283
2 3
2 6
4 8
4 13
4 26
4 32
4 52
4 64
4 104
4 128
4 208
4 256
4 416
4 512
4 823
4 832
4 1024
4 1646
4 1664
4 3292
4 3328
4 5000
5 15
5 25
5 75
7 67
7 101
7 1619
9 2477
9 4423
10 14
10 35
10 70
11 17
11 33
11 51
11 59
11 177
11 187
11 331
11 561
11 649
11 993
11 1003
11 1947
11 3009
...

input:

6
5000 2505
1 283
2 3
2 6
4 8
4 13
4 26
4 32
4 52
4 64
4 104
4 128
4 208
4 256
4 416
4 512
4 823
4 832
4 1024
4 1646
4 1664
4 3292
4 3328
4 5000
5 15
5 25
5 75
7 67
7 101
7 1619
9 2477
9 4423
10 14
10 35
10 70
11 17
11 33
11 51
11 59
11 177
11 187
11 331
11 561
11 649
11 993
11 1003
11 1947
11 3009
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1872kb,1800kb

input:

7
19938721

output:

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

input:

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

output:

8
5000 2500
3 29
3 58
4 9
4 81
4 1917
4 3467
6 1865
7 38
8 43
8 4343
8 4591
10 39
10 1109
10 1383
10 3327
12 73
13 37
13 74
13 111
13 333
13 1332
15 53
15 106
15 1373
15 2746
16 255
19 42
19 727
19 1306
19 1454
19 1959
19 2181
19 3918
19 4362
19 4571
24 547
25 59
25 118
25 236
25 354
25 708
26 95
26...

input:

8
5000 2500
3 29
3 58
4 9
4 81
4 1917
4 3467
6 1865
7 38
8 43
8 4343
8 4591
10 39
10 1109
10 1383
10 3327
12 73
13 37
13 74
13 111
13 333
13 1332
15 53
15 106
15 1373
15 2746
16 255
19 42
19 727
19 1306
19 1454
19 1959
19 2181
19 3918
19 4362
19 4571
24 547
25 59
25 118
25 236
25 354
25 708
26 95
26...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1872kb,1804kb

input:

7
5129508

output:

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

input:

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

output:

8
5000 2500
1 331
2 19
2 23
2 437
6 14
8 100
8 125
8 500
9 53
9 159
15 563
15 3037
16 797
16 1594
16 1609
17 29
17 73
17 2423
22 94
22 197
25 1909
25 2687
31 337
31 491
33 195
33 975
34 298
34 1043
34 2086
34 2459
34 4918
35 107
36 96
36 128
36 768
37 1201
37 4271
39 123
39 369
41 49
42 71
42 213
44...

input:

8
5000 2500
1 331
2 19
2 23
2 437
6 14
8 100
8 125
8 500
9 53
9 159
15 563
15 3037
16 797
16 1594
16 1609
17 29
17 73
17 2423
22 94
22 197
25 1909
25 2687
31 337
31 491
33 195
33 975
34 298
34 1043
34 2086
34 2459
34 4918
35 107
36 96
36 128
36 768
37 1201
37 4271
39 123
39 369
41 49
42 71
42 213
44...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1804kb

input:

7
15332941

output:

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

input:

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

output:

8
5000 2500
3 167
3 3166
3 4843
7 82
7 314
8 11
8 49
14 23
16 25
16 75
17 76
17 458
17 881
17 916
17 3524
20 163
20 863
27 2182
28 331
28 993
28 2979
30 101
30 373
30 1111
30 3737
30 4103
31 62
32 271
32 1951
33 1412
34 573
36 95
36 665
38 137
39 482
39 2447
39 4894
48 367
48 1019
51 718
51 1795
51 ...

input:

8
5000 2500
3 167
3 3166
3 4843
7 82
7 314
8 11
8 49
14 23
16 25
16 75
17 76
17 458
17 881
17 916
17 3524
20 163
20 863
27 2182
28 331
28 993
28 2979
30 101
30 373
30 1111
30 3737
30 4103
31 62
32 271
32 1951
33 1412
34 573
36 95
36 665
38 137
39 482
39 2447
39 4894
48 367
48 1019
51 718
51 1795
51 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 65
Accepted

Test #25:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1824kb

input:

1
355365355024496523

output:

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

input:

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

output:

2
5000 3882
1 2
1 5000
2 257
3 4
3 5
3 6
3 8
3 9
3 10
3 11
3 12
3 15
3 18
3 20
3 22
3 24
3 30
3 36
3 40
3 44
3 45
3 55
3 60
3 66
3 72
3 88
3 90
3 110
3 120
3 132
3 165
3 180
3 220
3 264
3 283
3 330
3 360
3 440
3 495
3 566
3 660
3 792
3 849
3 990
3 1320
3 1698
3 1980
3 2264
3 2547
3 3396
3 3960
3 424...

input:

2
5000 3882
1 2
1 5000
2 257
3 4
3 5
3 6
3 8
3 9
3 10
3 11
3 12
3 15
3 18
3 20
3 22
3 24
3 30
3 36
3 40
3 44
3 45
3 55
3 60
3 66
3 72
3 88
3 90
3 110
3 120
3 132
3 165
3 180
3 220
3 264
3 283
3 330
3 360
3 440
3 495
3 566
3 660
3 792
3 849
3 990
3 1320
3 1698
3 1980
3 2264
3 2547
3 3396
3 3960
3 424...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
355365355024496523

Test #26:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1868kb,1832kb

input:

1
727827999106414164

output:

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

input:

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

output:

2
5000 3882
1 5000
2 11
2 22
2 121
2 5000
3 183
4 5
4 8
4 10
4 16
4 20
4 40
4 80
4 5000
6 9
6 18
6 5000
7 5000
9 15
10 193
10 386
10 1231
10 2462
10 2509
10 4799
11 17
11 197
11 2371
11 3349
12 24
12 5000
13 19
13 209
14 25
14 35
14 50
14 70
14 113
14 226
14 791
14 1130
14 1582
14 3955
15 563
15 717...

input:

2
5000 3882
1 5000
2 11
2 22
2 121
2 5000
3 183
4 5
4 8
4 10
4 16
4 20
4 40
4 80
4 5000
6 9
6 18
6 5000
7 5000
9 15
10 193
10 386
10 1231
10 2462
10 2509
10 4799
11 17
11 197
11 2371
11 3349
12 24
12 5000
13 19
13 209
14 25
14 35
14 50
14 70
14 113
14 226
14 791
14 1130
14 1582
14 3955
15 563
15 717...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
727827999106414164

Test #27:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1868kb,1828kb

input:

1
656410143989222955

output:

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

input:

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

output:

2
5000 3882
1 2
1 17
1 34
1 4483
1 5000
2 11
3 4
3 6
3 7
3 8
3 12
3 21
3 24
3 28
3 42
3 84
3 168
3 2083
3 4166
4 73
5 10
5 25
5 50
5 5000
6 53
6 159
6 1041
7 52
7 1583
7 3166
8 37
8 41
9 18
9 69
9 138
9 207
9 414
9 802
9 1203
9 2406
9 3609
9 5000
10 35
11 16
11 32
13 22
14 197
14 3671
15 19
15 20
15...

input:

2
5000 3882
1 2
1 17
1 34
1 4483
1 5000
2 11
3 4
3 6
3 7
3 8
3 12
3 21
3 24
3 28
3 42
3 84
3 168
3 2083
3 4166
4 73
5 10
5 25
5 50
5 5000
6 53
6 159
6 1041
7 52
7 1583
7 3166
8 37
8 41
9 18
9 69
9 138
9 207
9 414
9 802
9 1203
9 2406
9 3609
9 5000
10 35
11 16
11 32
13 22
14 197
14 3671
15 19
15 20
15...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
656410143989222955

Test #28:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1824kb

input:

1
410366615149657534

output:

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

input:

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

output:

2
5000 3882
1 5000
2 4
2 53
2 71
2 142
2 212
2 284
2 1219
2 2438
2 3266
2 3763
2 4876
2 5000
4 5
4 6
4 7
4 9
4 10
4 15
4 18
4 21
4 27
4 30
4 35
4 39
4 42
4 45
4 63
4 65
4 70
4 78
4 90
4 91
4 105
4 117
4 126
4 130
4 189
4 195
4 210
4 234
4 270
4 273
4 315
4 546
4 585
4 630
4 702
4 819
4 910
4 945
4 1...

input:

2
5000 3882
1 5000
2 4
2 53
2 71
2 142
2 212
2 284
2 1219
2 2438
2 3266
2 3763
2 4876
2 5000
4 5
4 6
4 7
4 9
4 10
4 15
4 18
4 21
4 27
4 30
4 35
4 39
4 42
4 45
4 63
4 65
4 70
4 78
4 90
4 91
4 105
4 117
4 126
4 130
4 189
4 195
4 210
4 234
4 270
4 273
4 315
4 546
4 585
4 630
4 702
4 819
4 910
4 945
4 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
410366615149657534

Test #29:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1828kb

input:

1
298090682780948428

output:

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

input:

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

output:

2
5000 3882
1 1171
1 3513
1 5000
2 5000
3 5
3 25
4 6
4 8
4 9
4 12
4 18
4 24
4 36
4 69
4 72
4 138
4 184
4 207
4 276
4 414
4 552
4 617
4 1234
4 1656
4 2468
4 3702
4 5000
5 397
5 2797
7 21
7 37
7 39
7 91
7 111
7 169
7 259
7 273
7 481
7 507
7 777
7 1183
7 1443
7 3549
7 5000
8 10
8 11
8 20
8 22
8 44
8 55...

input:

2
5000 3882
1 1171
1 3513
1 5000
2 5000
3 5
3 25
4 6
4 8
4 9
4 12
4 18
4 24
4 36
4 69
4 72
4 138
4 184
4 207
4 276
4 414
4 552
4 617
4 1234
4 1656
4 2468
4 3702
4 5000
5 397
5 2797
7 21
7 37
7 39
7 91
7 111
7 169
7 259
7 273
7 481
7 507
7 777
7 1183
7 1443
7 3549
7 5000
8 10
8 11
8 20
8 22
8 44
8 55...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
298090682780948428

Test #30:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1804kb

input:

3
969441916331132577

output:

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

input:

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

output:

4
5000 2500
4 389
4 2723
6 61
6 183
6 1461
11 14
15 134
15 402
16 593
16 911
17 20
17 40
17 80
20 2341
22 85
23 46
23 5000
28 103
30 31
30 93
31 38
35 797
35 1154
35 1594
40 43
40 1319
43 166
44 53
45 54
45 108
50 59
50 1121
51 163
51 489
51 978
53 809
53 1618
53 3236
54 1429
54 4287
57 60
57 120
59...

input:

4
5000 2500
4 389
4 2723
6 61
6 183
6 1461
11 14
15 134
15 402
16 593
16 911
17 20
17 40
17 80
20 2341
22 85
23 46
23 5000
28 103
30 31
30 93
31 38
35 797
35 1154
35 1594
40 43
40 1319
43 166
44 53
45 54
45 108
50 59
50 1121
51 163
51 489
51 978
53 809
53 1618
53 3236
54 1429
54 4287
57 60
57 120
59...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
969441916331132577

Test #31:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1800kb

input:

3
929489812741933634

output:

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

input:

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

output:

4
5000 2500
1 97
1 5000
6 31
6 62
6 3373
7 2237
7 3847
8 593
8 1186
8 1779
8 3558
13 53
13 2269
14 15
14 20
14 60
15 179
15 1969
22 52
23 57
23 133
25 149
33 523
46 694
48 143
48 286
49 107
49 535
52 167
53 617
53 1851
56 3697
64 71
64 355
64 710
67 139
67 241
67 4031
69 73
69 365
71 1167
72 463
72 ...

input:

4
5000 2500
1 97
1 5000
6 31
6 62
6 3373
7 2237
7 3847
8 593
8 1186
8 1779
8 3558
13 53
13 2269
14 15
14 20
14 60
15 179
15 1969
22 52
23 57
23 133
25 149
33 523
46 694
48 143
48 286
49 107
49 535
52 167
53 617
53 1851
56 3697
64 71
64 355
64 710
67 139
67 241
67 4031
69 73
69 365
71 1167
72 463
72 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
929489812741933634

Test #32:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1800kb

input:

3
144032041325838295

output:

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

input:

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

output:

4
5000 2500
2 41
2 1097
6 13
6 1931
8 1013
8 4243
9 17
9 34
11 691
11 1382
11 2764
12 89
12 163
12 1297
15 40
17 613
17 1226
18 1373
24 61
24 457
24 1171
26 799
26 1951
29 3917
30 449
30 643
30 2245
30 3215
34 291
34 4051
37 863
37 1726
37 2589
40 249
40 415
40 1245
42 133
51 466
51 932
53 158
56 16...

input:

4
5000 2500
2 41
2 1097
6 13
6 1931
8 1013
8 4243
9 17
9 34
11 691
11 1382
11 2764
12 89
12 163
12 1297
15 40
17 613
17 1226
18 1373
24 61
24 457
24 1171
26 799
26 1951
29 3917
30 449
30 643
30 2245
30 3215
34 291
34 4051
37 863
37 1726
37 2589
40 249
40 415
40 1245
42 133
51 466
51 932
53 158
56 16...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
144032041325838295

Test #33:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1868kb,1800kb

input:

3
832110946250826180

output:

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

input:

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

output:

4
5000 2500
1 7
1 1409
3 9
3 13
3 39
3 117
6 107
6 214
6 321
6 642
7 2521
7 4951
12 36
13 277
14 281
14 562
16 52
19 787
19 883
22 29
22 58
22 203
22 406
23 829
25 983
25 4915
27 1451
27 3467
27 4353
28 61
28 122
28 244
28 488
29 91
32 47
32 94
32 188
34 59
34 118
34 587
34 1174
36 37
36 42
36 48
36...

input:

4
5000 2500
1 7
1 1409
3 9
3 13
3 39
3 117
6 107
6 214
6 321
6 642
7 2521
7 4951
12 36
13 277
14 281
14 562
16 52
19 787
19 883
22 29
22 58
22 203
22 406
23 829
25 983
25 4915
27 1451
27 3467
27 4353
28 61
28 122
28 244
28 488
29 91
32 47
32 94
32 188
34 59
34 118
34 587
34 1174
36 37
36 42
36 48
36...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
832110946250826180

Test #34:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1808kb

input:

3
85728715707691821

output:

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

input:

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

output:

4
5000 2500
3 18
3 5000
4 31
4 463
5 8
5 2102
5 4204
8 227
12 1777
12 2213
16 439
16 2195
16 3073
24 4583
28 313
28 3443
28 4451
31 4139
36 213
36 355
36 1065
40 1049
43 82
44 133
44 1999
48 409
48 3681
50 143
51 210
58 2303
59 383
59 766
59 1087
59 2174
62 953
62 1579
67 3637
72 77
72 231
72 1931
7...

input:

4
5000 2500
3 18
3 5000
4 31
4 463
5 8
5 2102
5 4204
8 227
12 1777
12 2213
16 439
16 2195
16 3073
24 4583
28 313
28 3443
28 4451
31 4139
36 213
36 355
36 1065
40 1049
43 82
44 133
44 1999
48 409
48 3681
50 143
51 210
58 2303
59 383
59 766
59 1087
59 2174
62 953
62 1579
67 3637
72 77
72 231
72 1931
7...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
85728715707691821

Test #35:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1868kb,1804kb

input:

5
777434612360931036

output:

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

input:

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

output:

6
5000 2509
1 5000
3 5000
4 5000
5 13
5 37
5 481
6 5000
7 1783
8 14
8 28
9 5000
10 1907
10 3814
11 25
11 137
11 167
11 685
11 835
11 3425
11 4175
12 5000
15 21
15 4679
16 20
17 367
17 4037
18 5000
22 38
22 133
22 266
24 4253
26 46
26 115
26 230
27 43
27 83
27 129
27 249
27 387
27 747
27 3569
29 67
2...

input:

6
5000 2509
1 5000
3 5000
4 5000
5 13
5 37
5 481
6 5000
7 1783
8 14
8 28
9 5000
10 1907
10 3814
11 25
11 137
11 167
11 685
11 835
11 3425
11 4175
12 5000
15 21
15 4679
16 20
17 367
17 4037
18 5000
22 38
22 133
22 266
24 4253
26 46
26 115
26 230
27 43
27 83
27 129
27 249
27 387
27 747
27 3569
29 67
2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
777434612360931036

Test #36:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1804kb

input:

5
705262511549880222

output:

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

input:

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

output:

6
5000 2527
1 5000
2 4
2 5
2 10
2 20
2 101
2 202
2 404
2 505
2 1010
2 2020
3 13
3 39
3 169
3 507
6 8
6 9
6 12
6 18
6 24
6 36
6 72
6 113
6 226
6 339
6 452
6 678
6 904
6 1017
6 1356
6 2034
6 2712
6 4068
11 61
11 103
14 16
14 17
14 34
14 68
14 136
14 173
14 272
14 346
14 692
14 1384
14 2768
14 2941
15 ...

input:

6
5000 2527
1 5000
2 4
2 5
2 10
2 20
2 101
2 202
2 404
2 505
2 1010
2 2020
3 13
3 39
3 169
3 507
6 8
6 9
6 12
6 18
6 24
6 36
6 72
6 113
6 226
6 339
6 452
6 678
6 904
6 1017
6 1356
6 2034
6 2712
6 4068
11 61
11 103
14 16
14 17
14 34
14 68
14 136
14 173
14 272
14 346
14 692
14 1384
14 2768
14 2941
15 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
705262511549880222

Test #37:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1864kb,1800kb

input:

5
510318082834167951

output:

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

input:

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

output:

6
5000 2540
1 2
1 5
1 10
1 25
1 50
1 751
1 1502
1 3755
3 6
3 12
3 67
3 134
3 201
3 268
3 402
3 804
3 5000
7 8
7 14
7 28
7 56
9 18
11 20
13 22
13 29
13 37
13 58
13 74
13 319
13 407
13 638
13 814
13 1073
13 2146
15 16
15 24
15 32
15 48
15 64
15 96
15 128
15 192
15 384
17 71
17 142
21 30
21 35
21 42
21...

input:

6
5000 2540
1 2
1 5
1 10
1 25
1 50
1 751
1 1502
1 3755
3 6
3 12
3 67
3 134
3 201
3 268
3 402
3 804
3 5000
7 8
7 14
7 28
7 56
9 18
11 20
13 22
13 29
13 37
13 58
13 74
13 319
13 407
13 638
13 814
13 1073
13 2146
15 16
15 24
15 32
15 48
15 64
15 96
15 128
15 192
15 384
17 71
17 142
21 30
21 35
21 42
21...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
510318082834167951

Test #38:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1864kb,1804kb

input:

5
914858813253258744

output:

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

input:

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

output:

6
5000 2542
1 5000
2 11
2 22
2 977
2 1954
3 7
3 21
3 49
3 147
4 5
4 10
4 17
4 20
4 34
4 68
4 85
4 170
4 340
6 9
6 18
6 27
6 54
6 1103
6 2206
6 3309
8 16
8 23
8 41
8 46
8 61
8 82
8 92
8 122
8 164
8 184
8 227
8 244
8 328
8 368
8 449
8 454
8 488
8 521
8 656
8 898
8 908
8 943
8 976
8 1042
8 1403
8 1796
...

input:

6
5000 2542
1 5000
2 11
2 22
2 977
2 1954
3 7
3 21
3 49
3 147
4 5
4 10
4 17
4 20
4 34
4 68
4 85
4 170
4 340
6 9
6 18
6 27
6 54
6 1103
6 2206
6 3309
8 16
8 23
8 41
8 46
8 61
8 82
8 92
8 122
8 164
8 184
8 227
8 244
8 328
8 368
8 449
8 454
8 488
8 521
8 656
8 898
8 908
8 943
8 976
8 1042
8 1403
8 1796
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
914858813253258744

Test #39:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1804kb

input:

5
659635316746638238

output:

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

input:

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

output:

6
5000 2528
1 3
1 9
1 23
1 69
1 207
1 349
1 1009
1 1047
1 3027
1 3141
2 173
2 346
2 692
2 5000
4 6
5 1373
5 2383
6 8
6 11
6 13
6 14
6 22
6 26
6 28
6 44
6 52
6 56
6 77
6 88
6 91
6 104
6 143
6 154
6 182
6 286
6 308
6 364
6 572
6 616
6 619
6 728
6 1001
6 1144
6 1238
6 2002
6 2476
6 4004
6 4333
6 4952
1...

input:

6
5000 2528
1 3
1 9
1 23
1 69
1 207
1 349
1 1009
1 1047
1 3027
1 3141
2 173
2 346
2 692
2 5000
4 6
5 1373
5 2383
6 8
6 11
6 13
6 14
6 22
6 26
6 28
6 44
6 52
6 56
6 77
6 88
6 91
6 104
6 143
6 154
6 182
6 286
6 308
6 364
6 572
6 616
6 619
6 728
6 1001
6 1144
6 1238
6 2002
6 2476
6 4004
6 4333
6 4952
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659635316746638238

Test #40:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1864kb,1804kb

input:

7
858490260563149759

output:

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

input:

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

output:

8
5000 2500
4 4863
5 718
6 71
6 497
6 781
6 4189
10 47
10 423
10 963
10 1317
10 3951
12 2713
14 17
17 22
21 86
21 1634
21 3287
24 89
24 445
24 1321
26 1013
28 81
28 1089
28 3267
30 67
33 398
34 75
34 525
35 1318
35 2636
37 362
37 1086
37 3258
40 453
40 2869
43 277
43 554
43 1108
43 1381
43 1662
43 2...

input:

8
5000 2500
4 4863
5 718
6 71
6 497
6 781
6 4189
10 47
10 423
10 963
10 1317
10 3951
12 2713
14 17
17 22
21 86
21 1634
21 3287
24 89
24 445
24 1321
26 1013
28 81
28 1089
28 3267
30 67
33 398
34 75
34 525
35 1318
35 2636
37 362
37 1086
37 3258
40 453
40 2869
43 277
43 554
43 1108
43 1381
43 1662
43 2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
858490260563149759

Test #41:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1804kb

input:

7
860058643727731209

output:

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

input:

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

output:

8
5000 2500
2 2887
4 19
7 1814
7 2237
7 4474
8 811
11 439
11 878
13 28
13 2258
13 4516
14 659
14 3295
15 18
16 389
20 53
20 371
22 4271
23 38
23 409
23 646
23 1433
23 2866
26 2801
31 562
33 72
36 1947
37 1321
37 1502
37 2642
37 3004
40 89
40 461
41 112
41 224
41 379
41 758
41 1516
41 3032
42 513
43 ...

input:

8
5000 2500
2 2887
4 19
7 1814
7 2237
7 4474
8 811
11 439
11 878
13 28
13 2258
13 4516
14 659
14 3295
15 18
16 389
20 53
20 371
22 4271
23 38
23 409
23 646
23 1433
23 2866
26 2801
31 562
33 72
36 1947
37 1321
37 1502
37 2642
37 3004
40 89
40 461
41 112
41 224
41 379
41 758
41 1516
41 3032
42 513
43 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
860058643727731209

Test #42:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1800kb

input:

7
718861404514377808

output:

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

input:

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

output:

8
5000 2500
1 787
2 11
2 1111
2 2222
5 139
5 973
7 367
7 1101
9 1543
10 18
14 79
14 107
14 158
20 43
20 86
20 146
20 3139
24 88
26 721
26 1442
27 71
29 3383
30 2066
31 163
32 2672
32 2999
33 35
33 175
34 39
34 78
37 81
37 503
37 4527
38 470
39 53
41 113
41 419
49 2073
49 3093
51 2417
53 205
53 3169
...

input:

8
5000 2500
1 787
2 11
2 1111
2 2222
5 139
5 973
7 367
7 1101
9 1543
10 18
14 79
14 107
14 158
20 43
20 86
20 146
20 3139
24 88
26 721
26 1442
27 71
29 3383
30 2066
31 163
32 2672
32 2999
33 35
33 175
34 39
34 78
37 81
37 503
37 4527
38 470
39 53
41 113
41 419
49 2073
49 3093
51 2417
53 205
53 3169
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
718861404514377808

Test #43:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1804kb

input:

7
659192688464047828

output:

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

input:

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

output:

8
5000 2500
3 3425
5 443
5 2309
8 1733
8 3466
10 997
10 1994
10 2991
11 449
14 1433
14 2866
16 18
16 27
16 54
17 19
19 2693
23 677
23 1871
23 3385
24 1759
24 3518
24 4639
25 117
25 507
25 2197
26 614
29 37
32 521
32 2084
35 107
35 653
37 281
37 843
41 49
41 3557
42 1777
42 3554
43 1745
43 2837
43 31...

input:

8
5000 2500
3 3425
5 443
5 2309
8 1733
8 3466
10 997
10 1994
10 2991
11 449
14 1433
14 2866
16 18
16 27
16 54
17 19
19 2693
23 677
23 1871
23 3385
24 1759
24 3518
24 4639
25 117
25 507
25 2197
26 614
29 37
32 521
32 2084
35 107
35 653
37 281
37 843
41 49
41 3557
42 1777
42 3554
43 1745
43 2837
43 31...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659192688464047828

Test #44:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1868kb,1808kb

input:

7
685730986714800201

output:

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

input:

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

output:

8
5000 2500
2 281
3 18
4 79
5 151
5 604
5 3742
8 131
10 11
13 38
16 4489
19 26
19 197
19 394
23 2906
23 2963
25 3769
27 1297
27 2594
28 2317
30 261
32 143
36 489
36 815
36 2445
37 124
42 2283
43 121
43 3181
46 3071
47 718
48 921
48 2763
49 137
49 548
49 3836
50 107
53 596
54 61
54 183
54 1727
55 94
...

input:

8
5000 2500
2 281
3 18
4 79
5 151
5 604
5 3742
8 131
10 11
13 38
16 4489
19 26
19 197
19 394
23 2906
23 2963
25 3769
27 1297
27 2594
28 2317
30 261
32 143
36 489
36 815
36 2445
37 124
42 2283
43 121
43 3181
46 3071
47 718
48 921
48 2763
49 137
49 548
49 3836
50 107
53 596
54 61
54 183
54 1727
55 94
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
685730986714800201