QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#423070#8726. Magic Showljga_100 ✓0ms1776kbC++141.0kb2024-05-27 21:00:092024-05-27 21:00:11

Judging History

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

  • [2024-05-27 21:00:11]
  • 评测
  • 测评结果:100
  • 用时:0ms
  • 内存:1776kb
  • [2024-05-27 21:00:09]
  • 提交

Alice

#include <bits/stdc++.h>
#include "Alice.h"
using namespace std; 
typedef long long ll;

vector<pair<int,int> > Alice(){
	int n=200;
	ll x=setN(n);
	vector<pair<int,int> >v;
	for(int i=1;i<n;i++)
		v.push_back({i+1,x%i+1});
	return v;
}

Bob

#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
typedef long long ll;
typedef __int128 lll;

pair<ll,pair<ll,ll> > exgcd(ll a,ll b){// a*x0+b*y0=gcd(a,b) {gcd(a,b),{x0,y0}}
	if(b==0)
		return {a,{1,0}};
	auto t=exgcd(b,a%b);
	ll d=t.first,x=t.second.first,y=t.second.second;
	return {d,{y,x-a/b*y}};
}

ll excrt(vector<pair<int,int> > f){
	lll a1,a2,m1=0,m2,d,x0,k0,k;
	for(auto t:f){
		if(m1==0){
			a1=t.first;m1=t.second;
			continue;
		}
		a2=t.first;m2=t.second;
		auto tmp=exgcd(m1,m2);
		d=tmp.first;x0=tmp.second.first;
		k0=(lll)x0*(a2-a1)/d;
		k=(k0%(m2/d)+m2/d)%(m2/d);
		a1+=k*m1;
		m1=min((lll)m1*m2/d,(lll)1e18+1);
	}
	return a1;
}

ll Bob(vector<pair<int,int> > v){
	for(int id=0;id<(int)v.size();id++)
		v[id].first--,v[id].second--;
	return excrt(v);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

1
4005

output:

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

input:

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

output:

2
200 140
1 2
1 6
1 16
1 46
1 90
2 3
2 5
2 12
2 14
2 15
2 29
2 45
2 53
2 78
2 92
2 144
2 155
2 183
4 7
4 47
4 88
4 139
4 175
6 9
6 17
6 21
6 33
6 51
6 81
6 126
6 161
7 32
7 44
7 94
7 130
10 28
10 37
10 38
10 55
10 75
10 109
10 112
11 18
11 48
11 86
13 34
13 122
16 20
16 36
16 39
16 43
16 58
16 96
16...

input:

2
200 140
1 2
1 6
1 16
1 46
1 90
2 3
2 5
2 12
2 14
2 15
2 29
2 45
2 53
2 78
2 92
2 144
2 155
2 183
4 7
4 47
4 88
4 139
4 175
6 9
6 17
6 21
6 33
6 51
6 81
6 126
6 161
7 32
7 44
7 94
7 130
10 28
10 37
10 38
10 55
10 75
10 109
10 112
11 18
11 48
11 86
13 34
13 122
16 20
16 36
16 39
16 43
16 58
16 96
16...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

1
459

output:

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

input:

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

output:

2
200 140
1 2
1 18
1 28
1 154
2 3
4 5
4 7
4 9
4 20
4 25
4 39
4 58
4 77
4 115
4 153
5 6
5 14
5 36
5 66
5 92
7 152
9 12
9 42
10 16
10 46
10 51
10 76
10 151
12 15
12 17
12 29
12 33
12 57
12 113
13 150
15 90
16 38
16 75
16 112
18 35
19 64
19 148
20 21
20 45
20 56
20 111
22 74
22 147
24 110
25 88
25 146
...

input:

2
200 140
1 2
1 18
1 28
1 154
2 3
4 5
4 7
4 9
4 20
4 25
4 39
4 58
4 77
4 115
4 153
5 6
5 14
5 36
5 66
5 92
7 152
9 12
9 42
10 16
10 46
10 51
10 76
10 151
12 15
12 17
12 29
12 33
12 57
12 113
13 150
15 90
16 38
16 75
16 112
18 35
19 64
19 148
20 21
20 45
20 56
20 111
22 74
22 147
24 110
25 88
25 146
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1768kb

input:

1
2495

output:

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

input:

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

output:

2
200 140
1 2
1 6
2 3
2 44
2 87
4 5
4 15
4 29
4 90
4 179
5 48
5 54
6 7
6 16
6 167
7 20
7 132
8 9
10 12
11 36
12 28
12 37
12 47
12 55
12 93
12 109
12 139
13 14
14 18
14 35
14 74
14 147
16 17
16 21
16 32
16 63
16 81
17 38
18 43
18 60
18 178
21 34
21 46
21 56
21 76
24 25
24 104
26 39
26 66
26 96
26 131...

input:

2
200 140
1 2
1 6
2 3
2 44
2 87
4 5
4 15
4 29
4 90
4 179
5 48
5 54
6 7
6 16
6 167
7 20
7 132
8 9
10 12
11 36
12 28
12 37
12 47
12 55
12 93
12 109
12 139
13 14
14 18
14 35
14 74
14 147
16 17
16 21
16 32
16 63
16 81
17 38
18 43
18 60
18 178
21 34
21 46
21 56
21 76
24 25
24 104
26 39
26 66
26 96
26 131...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1772kb

input:

3
1560

output:

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

input:

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

output:

4
200 100
1 2
1 3
1 4
1 5
1 6
1 7
1 9
1 11
1 13
1 14
1 16
1 21
1 25
1 27
1 31
1 40
1 41
1 53
1 61
1 66
1 79
1 105
1 121
1 131
1 157
1 196
4 174
16 104
17 194
20 24
20 68
24 30
24 54
27 60
27 119
28 74
32 140
33 192
35 110
36 62
37 128
40 118
40 170
42 50
46 102
48 90
51 152
53 59
53 117
54 138
57 95...

input:

4
200 100
1 2
1 3
1 4
1 5
1 6
1 7
1 9
1 11
1 13
1 14
1 16
1 21
1 25
1 27
1 31
1 40
1 41
1 53
1 61
1 66
1 79
1 105
1 121
1 131
1 157
1 196
4 174
16 104
17 194
20 24
20 68
24 30
24 54
27 60
27 119
28 74
32 140
33 192
35 110
36 62
37 128
40 118
40 170
42 50
46 102
48 90
51 152
53 59
53 117
54 138
57 95...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

3
3594

output:

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

input:

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

output:

4
200 100
1 7
3 5
3 9
5 6
6 38
6 98
7 13
7 14
7 24
7 27
7 40
7 47
7 53
7 70
7 79
7 93
7 139
7 157
8 18
9 12
9 164
10 16
13 19
13 200
15 21
15 180
18 50
18 74
19 150
26 44
26 84
30 32
30 116
30 156
33 138
35 41
35 90
35 179
39 128
40 46
40 80
42 188
44 54
44 68
45 51
45 72
45 143
46 92
46 170
49 198
...

input:

4
200 100
1 7
3 5
3 9
5 6
6 38
6 98
7 13
7 14
7 24
7 27
7 40
7 47
7 53
7 70
7 79
7 93
7 139
7 157
8 18
9 12
9 164
10 16
13 19
13 200
15 21
15 180
18 50
18 74
19 150
26 44
26 84
30 32
30 116
30 156
33 138
35 41
35 90
35 179
39 128
40 46
40 80
42 188
44 54
44 68
45 51
45 72
45 143
46 92
46 170
49 198
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1772kb

input:

3
1750

output:

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

input:

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

output:

4
200 100
8 22
8 84
12 38
12 48
13 23
14 194
21 174
22 92
22 134
23 25
23 28
23 33
23 37
23 49
23 55
23 65
23 73
23 97
23 109
23 145
23 193
24 158
32 192
34 102
36 50
40 60
43 62
43 123
46 56
46 156
47 72
47 143
48 132
49 75
50 82
55 107
56 114
57 78
57 122
57 155
59 95
59 142
59 189
60 90
61 66
61 ...

input:

4
200 100
8 22
8 84
12 38
12 48
13 23
14 194
21 174
22 92
22 134
23 25
23 28
23 33
23 37
23 49
23 55
23 65
23 73
23 97
23 109
23 145
23 193
24 158
32 192
34 102
36 50
40 60
43 62
43 123
46 56
46 156
47 72
47 143
48 132
49 75
50 82
55 107
56 114
57 78
57 122
57 155
59 95
59 142
59 189
60 90
61 66
61 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

5
4878

output:

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

input:

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

output:

6
200 119
1 2
3 5
3 24
3 47
3 54
3 93
3 107
4 6
4 14
4 16
4 26
4 40
4 66
4 76
4 126
4 196
7 8
7 9
7 13
7 15
7 22
7 25
7 29
7 30
7 43
7 57
7 59
7 85
7 88
7 117
7 169
7 175
12 32
12 158
17 18
17 23
17 27
17 35
17 144
17 188
19 21
19 28
19 31
19 37
19 46
19 55
19 61
19 82
19 91
19 109
19 136
19 163
19 ...

input:

6
200 119
1 2
3 5
3 24
3 47
3 54
3 93
3 107
4 6
4 14
4 16
4 26
4 40
4 66
4 76
4 126
4 196
7 8
7 9
7 13
7 15
7 22
7 25
7 29
7 30
7 43
7 57
7 59
7 85
7 88
7 117
7 169
7 175
12 32
12 158
17 18
17 23
17 27
17 35
17 144
17 188
19 21
19 28
19 31
19 37
19 46
19 55
19 61
19 82
19 91
19 109
19 136
19 163
19 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

5
1223

output:

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

input:

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

output:

6
200 100
1 2
3 4
3 12
3 34
3 38
3 112
5 24
5 54
6 7
6 8
6 15
6 22
6 30
6 43
6 59
6 88
6 175
9 10
9 16
9 28
9 46
9 82
9 136
13 174
14 23
14 56
14 111
14 122
17 18
17 72
20 29
20 44
20 87
20 173
25 110
27 58
27 64
27 134
27 172
32 150
35 42
36 37
36 45
36 55
36 67
36 100
36 109
36 133
36 199
39 80
40...

input:

6
200 100
1 2
3 4
3 12
3 34
3 38
3 112
5 24
5 54
6 7
6 8
6 15
6 22
6 30
6 43
6 59
6 88
6 175
9 10
9 16
9 28
9 46
9 82
9 136
13 174
14 23
14 56
14 111
14 122
17 18
17 72
20 29
20 44
20 87
20 173
25 110
27 58
27 64
27 134
27 172
32 150
35 42
36 37
36 45
36 55
36 67
36 100
36 109
36 133
36 199
39 80
40...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

5
648

output:

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

input:

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

output:

6
200 101
1 3
1 4
1 5
1 7
1 9
1 10
1 13
1 19
1 25
1 28
1 37
1 55
1 73
1 82
1 109
1 163
11 12
11 23
11 30
11 59
14 128
17 80
17 159
20 38
21 158
22 34
22 58
24 26
24 126
29 32
29 63
29 125
29 156
31 104
33 45
33 57
33 78
33 89
33 155
39 62
39 123
40 88
41 77
41 153
43 102
44 56
44 122
46 68
47 87
49 ...

input:

6
200 101
1 3
1 4
1 5
1 7
1 9
1 10
1 13
1 19
1 25
1 28
1 37
1 55
1 73
1 82
1 109
1 163
11 12
11 23
11 30
11 59
14 128
17 80
17 159
20 38
21 158
22 34
22 58
24 26
24 126
29 32
29 63
29 125
29 156
31 104
33 45
33 57
33 78
33 89
33 155
39 62
39 123
40 88
41 77
41 153
43 102
44 56
44 122
46 68
47 87
49 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

7
4475

output:

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

input:

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

output:

8
200 100
1 180
3 8
3 64
3 72
5 18
7 42
10 15
10 59
10 78
10 155
11 20
17 50
21 34
21 46
21 100
21 166
22 35
23 62
24 29
24 85
24 107
26 179
28 33
28 140
30 40
30 79
30 115
30 118
30 172
31 128
32 45
36 38
36 41
36 61
36 112
36 121
36 149
37 194
39 88
39 154
43 144
47 104
51 178
52 57
52 159
54 67
5...

input:

8
200 100
1 180
3 8
3 64
3 72
5 18
7 42
10 15
10 59
10 78
10 155
11 20
17 50
21 34
21 46
21 100
21 166
22 35
23 62
24 29
24 85
24 107
26 179
28 33
28 140
30 40
30 79
30 115
30 118
30 172
31 128
32 45
36 38
36 41
36 61
36 112
36 121
36 149
37 194
39 88
39 154
43 144
47 104
51 178
52 57
52 159
54 67
5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

7
4240

output:

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

input:

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

output:

8
200 100
2 10
2 28
2 158
3 14
3 164
7 30
7 74
8 84
9 24
9 47
9 185
13 15
13 152
16 26
16 170
17 33
17 34
17 45
17 67
17 129
17 177
17 193
18 42
20 22
20 64
20 68
27 44
32 62
32 184
39 192
41 43
41 51
41 57
41 85
41 106
41 121
41 151
41 169
41 176
49 132
50 128
52 72
54 80
55 92
55 162
55 183
56 94
...

input:

8
200 100
2 10
2 28
2 158
3 14
3 164
7 30
7 74
8 84
9 24
9 47
9 185
13 15
13 152
16 26
16 170
17 33
17 34
17 45
17 67
17 129
17 177
17 193
18 42
20 22
20 64
20 68
27 44
32 62
32 184
39 192
41 43
41 51
41 57
41 85
41 106
41 121
41 151
41 169
41 176
49 132
50 128
52 72
54 80
55 92
55 162
55 183
56 94
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1776kb

input:

7
1291

output:

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

input:

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

output:

8
200 100
8 13
8 108
11 184
14 143
16 30
16 45
16 117
17 26
18 99
18 183
22 128
23 48
23 142
27 56
28 80
28 159
31 98
34 35
34 75
36 158
39 180
41 140
42 51
42 126
46 90
46 179
47 84
49 114
50 55
50 139
51 74
52 63
52 125
52 156
53 178
57 66
57 96
59 138
60 78
60 89
60 155
60 177
62 83
62 124
67 176...

input:

8
200 100
8 13
8 108
11 184
14 143
16 30
16 45
16 117
17 26
18 99
18 183
22 128
23 48
23 142
27 56
28 80
28 159
31 98
34 35
34 75
36 158
39 180
41 140
42 51
42 126
46 90
46 179
47 84
49 114
50 55
50 139
51 74
52 63
52 125
52 156
53 178
57 66
57 96
59 138
60 78
60 89
60 155
60 177
62 83
62 124
67 176...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

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

input:

1
17476204

output:

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

input:

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

output:

2
200 140
1 2
1 3
1 5
1 18
1 35
1 69
5 6
5 7
5 9
5 15
5 16
5 20
5 21
5 25
5 29
5 36
5 37
5 39
5 43
5 46
5 51
5 57
5 58
5 61
5 64
5 74
5 76
5 77
5 85
5 96
5 115
5 134
5 141
5 147
5 151
5 153
5 169
5 172
5 176
5 191
6 14
6 98
7 48
7 95
10 12
10 56
10 62
13 17
13 33
13 140
16 44
17 32
17 63
17 94
17 11...

input:

2
200 140
1 2
1 3
1 5
1 18
1 35
1 69
5 6
5 7
5 9
5 15
5 16
5 20
5 21
5 25
5 29
5 36
5 37
5 39
5 43
5 46
5 51
5 57
5 58
5 61
5 64
5 74
5 76
5 77
5 85
5 96
5 115
5 134
5 141
5 147
5 151
5 153
5 169
5 172
5 176
5 191
6 14
6 98
7 48
7 95
10 12
10 56
10 62
13 17
13 33
13 140
16 44
17 32
17 63
17 94
17 11...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1772kb

input:

1
11926600

output:

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

input:

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

output:

2
200 140
1 2
1 3
1 5
1 6
1 9
1 15
1 21
1 29
1 36
1 51
1 57
1 99
1 141
1 176
1 197
2 32
2 94
3 62
3 123
5 7
5 12
5 34
5 45
5 67
7 74
7 147
8 64
9 17
9 33
10 180
11 14
11 16
11 40
11 54
11 66
11 107
11 131
11 160
11 196
13 18
13 35
13 69
16 20
16 56
16 96
16 102
17 25
17 37
17 152
21 38
21 75
21 143
...

input:

2
200 140
1 2
1 3
1 5
1 6
1 9
1 15
1 21
1 29
1 36
1 51
1 57
1 99
1 141
1 176
1 197
2 32
2 94
3 62
3 123
5 7
5 12
5 34
5 45
5 67
7 74
7 147
8 64
9 17
9 33
10 180
11 14
11 16
11 40
11 54
11 66
11 107
11 131
11 160
11 196
13 18
13 35
13 69
16 20
16 56
16 96
16 102
17 25
17 37
17 152
21 38
21 75
21 143
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1768kb

input:

1
16602378

output:

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

input:

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

output:

2
200 140
1 2
1 3
1 7
1 14
1 40
2 12
3 5
3 9
3 15
3 29
3 42
3 57
3 99
3 165
3 197
4 6
4 16
4 76
4 126
5 48
5 95
7 37
7 198
8 20
8 200
9 18
9 35
9 62
9 86
9 123
9 171
11 17
11 33
11 129
13 34
13 47
13 67
13 139
14 66
15 60
15 104
19 21
19 25
19 32
19 61
19 63
19 94
19 187
23 54
23 107
23 143
24 36
24...

input:

2
200 140
1 2
1 3
1 7
1 14
1 40
2 12
3 5
3 9
3 15
3 29
3 42
3 57
3 99
3 165
3 197
4 6
4 16
4 76
4 126
5 48
5 95
7 37
7 198
8 20
8 200
9 18
9 35
9 62
9 86
9 123
9 171
11 17
11 33
11 129
13 34
13 47
13 67
13 139
14 66
15 60
15 104
19 21
19 25
19 32
19 61
19 63
19 94
19 187
23 54
23 107
23 143
24 36
24...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

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

input:

3
13129243

output:

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

input:

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

output:

4
200 100
3 98
7 12
9 36
11 44
12 17
18 23
18 122
19 26
19 42
20 25
20 200
23 108
33 60
33 194
37 50
38 168
39 116
40 45
40 104
44 46
44 49
44 51
44 57
44 61
44 64
44 71
44 73
44 76
44 81
44 85
44 91
44 101
44 106
44 113
44 121
44 127
44 141
44 145
44 151
44 169
44 176
44 181
47 182
48 74
50 79
51 7...

input:

4
200 100
3 98
7 12
9 36
11 44
12 17
18 23
18 122
19 26
19 42
20 25
20 200
23 108
33 60
33 194
37 50
38 168
39 116
40 45
40 104
44 46
44 49
44 51
44 57
44 61
44 64
44 71
44 73
44 76
44 81
44 85
44 91
44 101
44 106
44 113
44 121
44 127
44 141
44 145
44 151
44 169
44 176
44 181
47 182
48 74
50 79
51 7...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1772kb

input:

3
7892141

output:

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

input:

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

output:

4
200 100
1 200
2 6
3 4
4 84
4 167
5 12
6 7
6 8
6 9
6 10
6 13
6 15
6 19
6 22
6 25
6 29
6 37
6 43
6 50
6 57
6 64
6 73
6 85
6 99
6 127
6 148
6 169
6 197
12 16
12 31
15 28
16 23
22 41
22 192
28 35
28 98
28 195
30 49
32 180
37 116
39 74
43 48
45 52
46 65
46 129
47 132
50 53
51 130
52 83
55 134
55 174
56...

input:

4
200 100
1 200
2 6
3 4
4 84
4 167
5 12
6 7
6 8
6 9
6 10
6 13
6 15
6 19
6 22
6 25
6 29
6 37
6 43
6 50
6 57
6 64
6 73
6 85
6 99
6 127
6 148
6 169
6 197
12 16
12 31
15 28
16 23
22 41
22 192
28 35
28 98
28 195
30 49
32 180
37 116
39 74
43 48
45 52
46 65
46 129
47 132
50 53
51 130
52 83
55 134
55 174
56...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

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

input:

3
21314775

output:

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

input:

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

output:

4
200 100
2 3
2 14
2 27
4 28
7 22
9 24
10 12
10 23
10 34
10 67
13 32
13 94
14 15
17 74
20 87
20 173
23 60
23 80
24 33
24 42
24 65
25 58
26 51
26 126
28 29
28 40
28 43
28 53
28 79
28 85
28 92
28 132
28 150
28 157
28 183
31 46
31 54
31 82
31 136
31 160
32 45
32 47
32 89
32 93
32 185
34 62
34 123
34 18...

input:

4
200 100
2 3
2 14
2 27
4 28
7 22
9 24
10 12
10 23
10 34
10 67
13 32
13 94
14 15
17 74
20 87
20 173
23 60
23 80
24 33
24 42
24 65
25 58
26 51
26 126
28 29
28 40
28 43
28 53
28 79
28 85
28 92
28 132
28 150
28 157
28 183
31 46
31 54
31 82
31 136
31 160
32 45
32 47
32 89
32 93
32 185
34 62
34 123
34 18...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1776kb

input:

5
5559540

output:

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

input:

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

output:

6
200 102
1 3
1 4
1 5
1 6
1 7
1 8
1 11
1 13
1 15
1 16
1 21
1 22
1 29
1 31
1 32
1 36
1 43
1 50
1 61
1 62
1 63
1 71
1 85
1 94
1 99
1 106
1 123
1 125
1 141
1 148
1 156
1 184
1 187
1 197
9 12
9 23
9 30
9 45
9 59
9 117
14 18
14 158
25 28
25 37
25 55
25 82
25 109
25 163
26 66
27 39
27 47
35 84
35 108
35 1...

input:

6
200 102
1 3
1 4
1 5
1 6
1 7
1 8
1 11
1 13
1 15
1 16
1 21
1 22
1 29
1 31
1 32
1 36
1 43
1 50
1 61
1 62
1 63
1 71
1 85
1 94
1 99
1 106
1 123
1 125
1 141
1 148
1 156
1 184
1 187
1 197
9 12
9 23
9 30
9 45
9 59
9 117
14 18
14 158
25 28
25 37
25 55
25 82
25 109
25 163
26 66
27 39
27 47
35 84
35 108
35 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

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

input:

5
9424319

output:

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

input:

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

output:

6
200 107
1 2
2 84
2 167
3 4
4 12
4 23
4 45
5 6
6 7
6 19
8 9
10 11
13 18
13 38
14 60
14 119
15 16
15 34
15 46
15 56
15 80
15 100
15 166
20 21
20 26
20 51
20 74
20 101
20 147
22 27
24 25
24 28
24 29
24 37
24 43
24 47
24 55
24 57
24 64
24 70
24 73
24 85
24 93
24 109
24 127
24 139
24 162
24 169
24 185
...

input:

6
200 107
1 2
2 84
2 167
3 4
4 12
4 23
4 45
5 6
6 7
6 19
8 9
10 11
13 18
13 38
14 60
14 119
15 16
15 34
15 46
15 56
15 80
15 100
15 166
20 21
20 26
20 51
20 74
20 101
20 147
22 27
24 25
24 28
24 29
24 37
24 43
24 47
24 55
24 57
24 64
24 70
24 73
24 85
24 93
24 109
24 127
24 139
24 162
24 169
24 185
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

5
10955780

output:

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

input:

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

output:

6
200 106
1 3
1 5
1 6
1 11
1 12
1 20
1 21
1 23
1 39
1 45
1 56
1 77
1 96
1 111
1 191
4 8
7 24
7 38
7 42
7 47
7 75
7 83
7 158
9 10
9 13
9 19
9 32
9 37
9 63
9 94
9 125
9 187
14 74
16 30
16 146
18 22
18 28
18 40
18 50
18 64
18 92
18 118
18 148
18 170
18 190
25 29
26 44
31 51
31 66
31 126
31 131
34 48
35...

input:

6
200 106
1 3
1 5
1 6
1 11
1 12
1 20
1 21
1 23
1 39
1 45
1 56
1 77
1 96
1 111
1 191
4 8
7 24
7 38
7 42
7 47
7 75
7 83
7 158
9 10
9 13
9 19
9 32
9 37
9 63
9 94
9 125
9 187
14 74
16 30
16 146
18 22
18 28
18 40
18 50
18 64
18 92
18 118
18 148
18 170
18 190
25 29
26 44
31 51
31 66
31 126
31 131
34 48
35...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

7
19938721

output:

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

input:

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

output:

8
200 100
4 30
4 59
5 10
5 28
5 72
5 82
6 15
6 29
6 48
6 110
6 189
8 39
8 115
9 44
11 40
13 74
16 54
16 107
20 43
21 108
26 60
26 119
27 96
27 134
32 55
32 136
34 35
34 45
34 57
34 65
34 69
34 99
34 113
34 120
34 137
34 177
34 188
34 197
36 158
37 66
41 64
41 192
46 77
47 84
52 87
52 90
52 179
56 67...

input:

8
200 100
4 30
4 59
5 10
5 28
5 72
5 82
6 15
6 29
6 48
6 110
6 189
8 39
8 115
9 44
11 40
13 74
16 54
16 107
20 43
21 108
26 60
26 119
27 96
27 134
32 55
32 136
34 35
34 45
34 57
34 65
34 69
34 99
34 113
34 120
34 137
34 177
34 188
34 197
36 158
37 66
41 64
41 192
46 77
47 84
52 87
52 90
52 179
56 67...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

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

input:

7
5129508

output:

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

input:

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

output:

8
200 100
3 47
4 6
5 33
7 8
10 54
10 160
11 12
13 25
13 192
18 30
18 74
19 62
19 123
23 48
23 95
23 198
31 35
31 52
31 103
31 154
33 45
34 76
36 108
37 97
37 129
37 193
39 80
39 87
39 152
39 159
40 124
41 77
42 50
43 72
43 143
49 60
49 61
49 64
49 71
49 93
49 116
49 119
49 127
49 136
49 139
49 162
4...

input:

8
200 100
3 47
4 6
5 33
7 8
10 54
10 160
11 12
13 25
13 192
18 30
18 74
19 62
19 123
23 48
23 95
23 198
31 35
31 52
31 103
31 154
33 45
34 76
36 108
37 97
37 129
37 193
39 80
39 87
39 152
39 159
40 124
41 77
42 50
43 72
43 143
49 60
49 61
49 64
49 71
49 93
49 116
49 119
49 127
49 136
49 139
49 162
4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

7
15332941

output:

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

input:

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

output:

8
200 100
2 3
2 5
2 7
2 10
2 11
2 16
2 19
2 29
2 36
2 44
2 46
2 61
2 71
2 87
2 91
2 106
2 127
2 141
2 173
2 181
8 83
8 124
8 158
15 24
17 26
17 76
21 164
22 179
30 113
30 120
30 137
31 102
32 63
32 156
32 187
35 192
37 96
37 134
39 138
42 54
42 111
47 52
47 82
47 136
47 154
53 144
56 108
56 115
56 1...

input:

8
200 100
2 3
2 5
2 7
2 10
2 11
2 16
2 19
2 29
2 36
2 44
2 46
2 61
2 71
2 87
2 91
2 106
2 127
2 141
2 173
2 181
8 83
8 124
8 158
15 24
17 26
17 76
21 164
22 179
30 113
30 120
30 137
31 102
32 63
32 156
32 187
35 192
37 96
37 134
39 138
42 54
42 111
47 52
47 82
47 136
47 154
53 144
56 108
56 115
56 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 65
Accepted

Test #25:

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

input:

1
355365355024496523

output:

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

input:

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

output:

2
200 140
1 2
2 3
4 5
4 6
4 7
4 9
4 12
4 16
4 21
4 25
4 34
4 37
4 45
4 46
4 56
4 61
4 67
4 111
4 199
6 14
6 54
6 107
7 32
7 94
8 15
8 29
10 38
10 47
10 75
10 112
10 139
10 167
12 17
12 33
12 129
13 28
15 18
15 78
15 120
15 122
15 188
18 180
19 20
19 40
19 42
19 44
19 58
19 66
19 96
19 130
19 196
21 ...

input:

2
200 140
1 2
2 3
4 5
4 6
4 7
4 9
4 12
4 16
4 21
4 25
4 34
4 37
4 45
4 46
4 56
4 61
4 67
4 111
4 199
6 14
6 54
6 107
7 32
7 94
8 15
8 29
10 38
10 47
10 75
10 112
10 139
10 167
12 17
12 33
12 129
13 28
15 18
15 78
15 120
15 122
15 188
18 180
19 20
19 40
19 42
19 44
19 58
19 66
19 96
19 130
19 196
21 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
355365355024496523

Test #26:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1764kb

input:

1
727827999106414164

output:

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

input:

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

output:

2
200 140
1 2
1 3
1 5
1 7
1 15
1 29
1 43
1 85
1 110
1 132
3 12
3 122
4 62
4 184
5 6
5 9
5 17
5 21
5 81
10 16
11 14
11 194
12 18
12 198
13 25
14 20
15 36
15 51
15 176
18 90
19 38
19 75
19 112
20 146
21 33
23 47
24 32
25 28
25 34
25 37
25 45
25 46
25 55
25 56
25 61
25 67
25 109
25 111
25 136
25 199
28...

input:

2
200 140
1 2
1 3
1 5
1 7
1 15
1 29
1 43
1 85
1 110
1 132
3 12
3 122
4 62
4 184
5 6
5 9
5 17
5 21
5 81
10 16
11 14
11 194
12 18
12 198
13 25
14 20
15 36
15 51
15 176
18 90
19 38
19 75
19 112
20 146
21 33
23 47
24 32
25 28
25 34
25 37
25 45
25 46
25 55
25 56
25 61
25 67
25 109
25 111
25 136
25 199
28...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
727827999106414164

Test #27:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1768kb

input:

1
656410143989222955

output:

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

input:

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

output:

2
200 140
1 2
1 6
1 16
1 28
1 46
1 82
1 136
2 3
2 18
2 35
3 12
4 5
4 7
4 9
4 15
4 25
4 29
4 43
4 57
4 85
4 169
5 74
6 51
7 54
7 160
8 14
8 53
9 38
9 42
10 47
10 139
11 36
12 17
12 33
15 198
16 20
16 21
16 39
16 58
16 61
16 77
16 96
16 115
16 191
18 99
18 150
19 154
21 66
21 146
23 60
24 62
24 104
24...

input:

2
200 140
1 2
1 6
1 16
1 28
1 46
1 82
1 136
2 3
2 18
2 35
3 12
4 5
4 7
4 9
4 15
4 25
4 29
4 43
4 57
4 85
4 169
5 74
6 51
7 54
7 160
8 14
8 53
9 38
9 42
10 47
10 139
11 36
12 17
12 33
15 198
16 20
16 21
16 39
16 58
16 61
16 77
16 96
16 115
16 191
18 99
18 150
19 154
21 66
21 146
23 60
24 62
24 104
24...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
656410143989222955

Test #28:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1768kb

input:

1
410366615149657534

output:

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

input:

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

output:

2
200 140
1 2
1 3
1 74
1 147
3 5
3 47
3 54
3 93
3 107
3 143
5 6
5 7
5 14
5 15
5 16
5 28
5 36
5 40
5 43
5 46
5 55
5 64
5 66
5 92
5 118
5 131
5 136
5 183
5 196
6 12
7 9
9 20
9 32
9 39
9 63
15 17
15 21
15 81
16 18
17 34
17 67
19 29
19 42
19 165
19 167
20 180
21 44
21 87
23 25
23 37
23 182
24 62
26 162
...

input:

2
200 140
1 2
1 3
1 74
1 147
3 5
3 47
3 54
3 93
3 107
3 143
5 6
5 7
5 14
5 15
5 16
5 28
5 36
5 40
5 43
5 46
5 55
5 64
5 66
5 92
5 118
5 131
5 136
5 183
5 196
6 12
7 9
9 20
9 32
9 39
9 63
15 17
15 21
15 81
16 18
17 34
17 67
19 29
19 42
19 165
19 167
20 180
21 44
21 87
23 25
23 37
23 182
24 62
26 162
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
410366615149657534

Test #29:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1772kb

input:

1
298090682780948428

output:

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

input:

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

output:

2
200 140
1 2
1 3
1 5
1 15
1 29
1 32
1 63
1 99
1 158
1 197
4 6
5 7
5 9
5 25
5 37
5 47
5 93
5 139
5 185
6 128
8 14
8 38
8 40
8 92
8 112
9 12
9 21
9 45
9 56
9 60
9 111
9 122
12 20
13 17
13 33
14 16
14 28
14 46
14 136
15 18
15 35
15 120
20 34
21 44
21 53
21 87
21 173
23 88
23 175
29 36
29 43
29 51
29 5...

input:

2
200 140
1 2
1 3
1 5
1 15
1 29
1 32
1 63
1 99
1 158
1 197
4 6
5 7
5 9
5 25
5 37
5 47
5 93
5 139
5 185
6 128
8 14
8 38
8 40
8 92
8 112
9 12
9 21
9 45
9 56
9 60
9 111
9 122
12 20
13 17
13 33
14 16
14 28
14 46
14 136
15 18
15 35
15 120
20 34
21 44
21 53
21 87
21 173
23 88
23 175
29 36
29 43
29 51
29 5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
298090682780948428

Test #30:

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

input:

3
969441916331132577

output:

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

input:

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

output:

4
200 100
5 8
7 62
7 184
8 11
10 19
12 15
16 68
16 135
19 22
19 28
19 50
19 64
19 82
19 148
19 190
23 86
24 47
29 104
31 32
31 94
32 39
33 36
33 110
41 44
43 72
44 84
44 167
45 54
46 55
46 109
47 162
51 60
52 164
57 80
57 108
58 61
58 121
60 132
61 92
62 63
62 125
67 88
67 90
68 99
68 123
73 136
78 ...

input:

4
200 100
5 8
7 62
7 184
8 11
10 19
12 15
16 68
16 135
19 22
19 28
19 50
19 64
19 82
19 148
19 190
23 86
24 47
29 104
31 32
31 94
32 39
33 36
33 110
41 44
43 72
44 84
44 167
45 54
46 55
46 109
47 162
51 60
52 164
57 80
57 108
58 61
58 121
60 132
61 92
62 63
62 125
67 88
67 90
68 99
68 123
73 136
78 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
969441916331132577

Test #31:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1768kb

input:

3
929489812741933634

output:

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

input:

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

output:

4
200 100
1 3
2 98
3 4
3 5
3 7
3 8
3 9
3 10
3 13
3 15
3 17
3 19
3 22
3 25
3 28
3 29
3 33
3 37
3 43
3 49
3 55
3 57
3 64
3 65
3 73
3 85
3 97
3 109
3 113
3 127
3 145
3 169
3 190
3 193
14 54
16 180
23 53
24 58
24 134
26 150
29 200
38 78
38 122
41 158
43 77
43 153
49 144
51 68
51 135
52 60
52 120
52 132
...

input:

4
200 100
1 3
2 98
3 4
3 5
3 7
3 8
3 9
3 10
3 13
3 15
3 17
3 19
3 22
3 25
3 28
3 29
3 33
3 37
3 43
3 49
3 55
3 57
3 64
3 65
3 73
3 85
3 97
3 109
3 113
3 127
3 145
3 169
3 190
3 193
14 54
16 180
23 53
24 58
24 134
26 150
29 200
38 78
38 122
41 158
43 77
43 153
49 144
51 68
51 135
52 60
52 120
52 132
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
929489812741933634

Test #32:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1776kb

input:

3
144032041325838295

output:

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

input:

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

output:

4
200 100
1 6
1 8
1 36
3 42
6 140
7 14
8 9
8 13
8 15
8 17
8 22
8 25
8 29
8 43
8 49
8 57
8 85
8 113
8 169
10 18
10 35
13 90
13 164
15 78
16 21
16 41
21 54
21 110
25 62
27 48
29 64
29 82
29 190
34 47
34 59
35 98
36 141
41 84
43 134
47 72
47 130
48 75
48 89
48 149
50 68
50 135
53 94
53 138
54 80
54 159...

input:

4
200 100
1 6
1 8
1 36
3 42
6 140
7 14
8 9
8 13
8 15
8 17
8 22
8 25
8 29
8 43
8 49
8 57
8 85
8 113
8 169
10 18
10 35
13 90
13 164
15 78
16 21
16 41
21 54
21 110
25 62
27 48
29 64
29 82
29 190
34 47
34 59
35 98
36 141
41 84
43 134
47 72
47 130
48 75
48 89
48 149
50 68
50 135
53 94
53 138
54 80
54 159...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
144032041325838295

Test #33:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1776kb

input:

3
832110946250826180

output:

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

input:

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

output:

4
200 100
1 13
2 8
3 18
3 35
6 26
6 182
13 19
13 25
13 28
13 32
13 37
13 44
13 54
13 55
13 63
13 73
13 82
13 87
13 94
13 107
13 109
13 125
13 130
13 160
13 163
13 173
13 187
17 27
17 53
18 24
18 98
21 81
23 30
23 59
29 62
29 123
30 92
35 60
35 119
38 68
38 150
40 138
43 79
43 170
44 80
48 84
51 71
5...

input:

4
200 100
1 13
2 8
3 18
3 35
6 26
6 182
13 19
13 25
13 28
13 32
13 37
13 44
13 54
13 55
13 63
13 73
13 82
13 87
13 94
13 107
13 109
13 125
13 130
13 160
13 163
13 173
13 187
17 27
17 53
18 24
18 98
21 81
23 30
23 59
29 62
29 123
30 92
35 60
35 119
38 68
38 150
40 138
43 79
43 170
44 80
48 84
51 71
5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
832110946250826180

Test #34:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1768kb

input:

3
85728715707691821

output:

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

input:

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

output:

4
200 100
1 4
4 19
5 32
6 9
8 24
8 47
8 74
10 22
11 44
11 140
17 36
18 23
18 45
22 25
22 26
22 28
22 31
22 37
22 41
22 46
22 51
22 55
22 61
22 73
22 76
22 82
22 91
22 101
22 109
22 121
22 136
22 151
22 163
22 181
24 30
24 59
24 138
26 39
26 77
26 158
28 98
28 195
34 123
34 184
36 63
36 150
37 72
44 ...

input:

4
200 100
1 4
4 19
5 32
6 9
8 24
8 47
8 74
10 22
11 44
11 140
17 36
18 23
18 45
22 25
22 26
22 28
22 31
22 37
22 41
22 46
22 51
22 55
22 61
22 73
22 76
22 82
22 91
22 101
22 109
22 121
22 136
22 151
22 163
22 181
24 30
24 59
24 138
26 39
26 77
26 158
28 98
28 195
34 123
34 184
36 63
36 150
37 72
44 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
85728715707691821

Test #35:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1776kb

input:

5
777434612360931036

output:

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

input:

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

output:

6
200 109
1 3
2 6
2 8
2 30
2 36
2 62
2 146
4 20
4 24
4 58
4 70
5 9
7 11
7 12
7 16
7 23
7 31
7 34
7 56
7 67
7 111
7 122
7 166
13 17
13 25
13 48
13 49
13 95
13 142
13 189
14 18
19 27
19 28
19 32
19 40
19 55
19 63
19 79
19 94
19 118
19 187
21 98
21 195
29 33
29 45
29 65
29 89
29 164
29 177
37 41
37 43
...

input:

6
200 109
1 3
2 6
2 8
2 30
2 36
2 62
2 146
4 20
4 24
4 58
4 70
5 9
7 11
7 12
7 16
7 23
7 31
7 34
7 56
7 67
7 111
7 122
7 166
13 17
13 25
13 48
13 49
13 95
13 142
13 189
14 18
19 27
19 28
19 32
19 40
19 55
19 63
19 79
19 94
19 118
19 187
21 98
21 195
29 33
29 45
29 65
29 89
29 164
29 177
37 41
37 43
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
777434612360931036

Test #36:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1776kb

input:

5
705262511549880222

output:

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

input:

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

output:

6
200 112
1 2
3 5
3 6
3 11
3 21
3 102
4 14
4 40
4 170
7 9
7 10
7 13
7 19
7 25
7 37
7 73
7 114
12 62
12 104
15 17
15 18
15 35
15 69
15 137
15 174
16 20
16 22
16 34
16 58
16 64
16 78
16 100
16 134
16 172
23 26
23 29
23 36
23 41
23 50
23 51
23 57
23 71
23 99
23 101
23 141
23 176
23 197
24 182
27 45
30 ...

input:

6
200 112
1 2
3 5
3 6
3 11
3 21
3 102
4 14
4 40
4 170
7 9
7 10
7 13
7 19
7 25
7 37
7 73
7 114
12 62
12 104
15 17
15 18
15 35
15 69
15 137
15 174
16 20
16 22
16 34
16 58
16 64
16 78
16 100
16 134
16 172
23 26
23 29
23 36
23 41
23 50
23 51
23 57
23 71
23 99
23 101
23 141
23 176
23 197
24 182
27 45
30 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
705262511549880222

Test #37:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1768kb

input:

5
510318082834167951

output:

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

input:

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

output:

6
200 108
1 4
2 3
2 6
2 11
2 26
2 51
4 7
4 13
4 68
4 135
8 9
8 15
8 29
8 57
10 19
12 21
14 23
14 30
14 38
14 59
14 75
16 17
16 25
16 33
16 49
16 65
16 97
16 129
16 193
18 72
18 143
22 31
22 36
22 43
22 71
22 106
24 60
24 119
24 198
28 37
28 55
28 109
28 138
32 41
32 53
32 66
32 81
32 84
32 105
32 13...

input:

6
200 108
1 4
2 3
2 6
2 11
2 26
2 51
4 7
4 13
4 68
4 135
8 9
8 15
8 29
8 57
10 19
12 21
14 23
14 30
14 38
14 59
14 75
16 17
16 25
16 33
16 49
16 65
16 97
16 129
16 193
18 72
18 143
22 31
22 36
22 43
22 71
22 106
24 60
24 119
24 198
28 37
28 55
28 109
28 138
32 41
32 53
32 66
32 81
32 84
32 105
32 13...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
510318082834167951

Test #38:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1776kb

input:

5
914858813253258744

output:

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

input:

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

output:

6
200 116
1 2
3 12
3 23
4 8
4 22
4 50
4 148
5 6
5 11
5 18
5 21
5 35
5 69
5 86
5 171
7 10
7 19
7 28
7 55
9 17
9 24
9 42
9 47
9 62
9 83
9 93
9 123
9 165
9 185
14 144
15 20
15 39
15 96
15 98
15 150
15 191
15 195
25 29
25 31
25 33
25 34
25 36
25 37
25 41
25 43
25 45
25 46
25 49
25 56
25 57
25 61
25 64
2...

input:

6
200 116
1 2
3 12
3 23
4 8
4 22
4 50
4 148
5 6
5 11
5 18
5 21
5 35
5 69
5 86
5 171
7 10
7 19
7 28
7 55
9 17
9 24
9 42
9 47
9 62
9 83
9 93
9 123
9 165
9 185
14 144
15 20
15 39
15 96
15 98
15 150
15 191
15 195
25 29
25 31
25 33
25 34
25 36
25 37
25 41
25 43
25 45
25 46
25 49
25 56
25 57
25 61
25 64
2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
914858813253258744

Test #39:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1776kb

input:

5
659635316746638238

output:

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

input:

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

output:

6
200 100
1 3
2 4
4 20
4 96
4 108
5 7
5 18
5 35
5 52
5 103
9 11
14 16
14 22
14 26
14 36
14 38
14 76
14 102
14 106
14 112
14 168
14 176
14 186
15 17
19 21
23 25
23 39
23 48
23 58
23 60
23 77
23 95
23 98
23 115
23 119
23 142
23 153
23 178
23 189
23 195
24 32
24 156
29 30
29 31
29 34
29 46
29 56
29 59
...

input:

6
200 100
1 3
2 4
4 20
4 96
4 108
5 7
5 18
5 35
5 52
5 103
9 11
14 16
14 22
14 26
14 36
14 38
14 76
14 102
14 106
14 112
14 168
14 176
14 186
15 17
19 21
23 25
23 39
23 48
23 58
23 60
23 77
23 95
23 98
23 115
23 119
23 142
23 153
23 178
23 189
23 195
24 32
24 156
29 30
29 31
29 34
29 46
29 56
29 59
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659635316746638238

Test #40:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1768kb

input:

7
858490260563149759

output:

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

input:

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

output:

8
200 100
4 5
5 6
5 16
10 126
12 63
12 125
14 43
14 50
14 148
14 159
15 18
15 86
16 17
17 24
17 54
17 160
18 23
22 39
22 44
22 87
22 174
25 90
27 180
28 42
28 165
29 34
29 82
29 100
29 122
31 68
32 33
32 69
32 97
32 103
32 137
34 200
35 36
35 76
35 106
35 176
41 58
41 152
46 75
47 164
49 120
53 198
...

input:

8
200 100
4 5
5 6
5 16
10 126
12 63
12 125
14 43
14 50
14 148
14 159
15 18
15 86
16 17
17 24
17 54
17 160
18 23
22 39
22 44
22 87
22 174
25 90
27 180
28 42
28 165
29 34
29 82
29 100
29 122
31 68
32 33
32 69
32 97
32 103
32 137
34 200
35 36
35 76
35 106
35 176
41 58
41 152
46 75
47 164
49 120
53 198
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
858490260563149759

Test #41:

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

input:

7
860058643727731209

output:

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

input:

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

output:

8
200 100
2 87
2 173
3 158
10 31
10 33
10 38
10 51
10 65
10 76
10 81
10 97
10 101
10 112
10 121
10 129
10 149
10 151
10 161
10 186
10 193
13 32
14 29
15 56
15 122
16 19
21 54
24 39
25 46
28 72
28 123
28 143
28 184
34 73
37 178
41 90
42 57
42 113
43 172
44 63
45 174
48 144
49 148
52 139
55 128
58 69
...

input:

8
200 100
2 87
2 173
3 158
10 31
10 33
10 38
10 51
10 65
10 76
10 81
10 97
10 101
10 112
10 121
10 129
10 149
10 151
10 161
10 186
10 193
13 32
14 29
15 56
15 122
16 19
21 54
24 39
25 46
28 72
28 123
28 143
28 184
34 73
37 178
41 90
42 57
42 113
43 172
44 63
45 174
48 144
49 148
52 139
55 128
58 69
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
860058643727731209

Test #42:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1776kb

input:

7
718861404514377808

output:

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

input:

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

output:

8
200 100
3 12
3 102
5 198
6 8
6 140
7 90
7 179
11 19
14 16
14 24
14 56
14 70
14 116
14 166
14 182
15 80
15 108
15 159
20 22
21 44
21 87
21 147
23 88
23 175
23 194
25 45
28 72
30 200
32 164
33 168
34 36
34 176
35 79
38 82
40 54
41 43
41 63
41 125
41 169
41 187
42 114
48 50
48 92
49 161
51 98
51 195
...

input:

8
200 100
3 12
3 102
5 198
6 8
6 140
7 90
7 179
11 19
14 16
14 24
14 56
14 70
14 116
14 166
14 182
15 80
15 108
15 159
20 22
21 44
21 87
21 147
23 88
23 175
23 194
25 45
28 72
30 200
32 164
33 168
34 36
34 176
35 79
38 82
40 54
41 43
41 63
41 125
41 169
41 187
42 114
48 50
48 92
49 161
51 98
51 195
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
718861404514377808

Test #43:

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

input:

7
659192688464047828

output:

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

input:

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

output:

8
200 100
1 2
1 182
2 4
3 12
3 23
4 6
4 138
6 72
7 15
7 120
8 10
9 11
14 162
17 19
17 28
17 55
18 20
25 45
26 40
26 118
26 170
30 38
35 64
35 68
35 127
35 135
36 108
39 66
42 50
44 136
46 48
49 141
49 174
53 73
53 97
53 145
56 90
56 134
58 188
59 60
59 84
59 167
59 178
61 104
65 79
65 128
65 157
67 ...

input:

8
200 100
1 2
1 182
2 4
3 12
3 23
4 6
4 138
6 72
7 15
7 120
8 10
9 11
14 162
17 19
17 28
17 55
18 20
25 45
26 40
26 118
26 170
30 38
35 64
35 68
35 127
35 135
36 108
39 66
42 50
44 136
46 48
49 141
49 174
53 73
53 97
53 145
56 90
56 134
58 188
59 60
59 84
59 167
59 178
61 104
65 79
65 128
65 157
67 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659192688464047828

Test #44:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1764kb,1768kb

input:

7
685730986714800201

output:

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

input:

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

output:

8
200 100
4 19
6 152
8 15
8 18
8 35
8 99
8 120
9 48
9 132
11 12
14 39
17 68
20 27
20 198
22 23
22 29
22 31
22 43
22 45
22 60
22 61
22 64
22 67
22 78
22 91
22 100
22 111
22 119
22 133
22 141
22 155
22 166
22 178
22 181
22 199
30 168
33 144
36 104
36 162
37 164
38 63
38 125
40 163
42 69
42 81
42 86
42...

input:

8
200 100
4 19
6 152
8 15
8 18
8 35
8 99
8 120
9 48
9 132
11 12
14 39
17 68
20 27
20 198
22 23
22 29
22 31
22 43
22 45
22 60
22 61
22 64
22 67
22 78
22 91
22 100
22 111
22 119
22 133
22 141
22 155
22 166
22 178
22 181
22 199
30 168
33 144
36 104
36 162
37 164
38 63
38 125
40 163
42 69
42 81
42 86
42...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
685730986714800201