QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#424182#8726. Magic Showsbno333100 ✓0ms1780kbC++141.6kb2024-05-29 01:10:182024-05-29 01:10:18

Judging History

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

  • [2024-05-29 01:10:18]
  • 评测
  • 测评结果:100
  • 用时:0ms
  • 内存:1780kb
  • [2024-05-29 01:10:18]
  • 提交

Alice

#include<bits/stdc++.h>
#include "Alice.h"
using namespace std;
#define int __int128
vector<pair<signed,signed> > v;
std::vector<std::pair<signed, signed> > Alice(){
	int x;
	x=setN(300);
	for(int i=2;i<=300;i++){
		v.push_back({x%(i-1)+1,i});
	}
	return v;
}

Bob

#include<bits/stdc++.h>
#include "Bob.h"
using namespace std;
#define int __int128
#define pii pair<int,int>
#define f first
#define s second
int lcm(int x,int y){
	return x*y/__gcd(x,y);
}
void exgcd(int a,int b,int &x,int &y){//bx+(a%b)y=(b,a%b),bx+(a-a/b*b)y,bx+ay-b*a/b*y,ay+b*(x-a/b*y)
	if(b==0){
		x=1,y=0;
		return;
	}
	exgcd(b,a%b,x,y);
	int yy;
	yy=y;
	y=x-a/b*y,x=yy;
}
void ed(int a,int b,int c,int &x,int &y){
	exgcd(a,b,x,y);
	int z;
	z=__gcd(a,b);
	//cout<<(long long)x<<" "<<(long long)y<<endl;
	if(x*c%z||y*c%z){
		x=1e16,y=1e16;
	}else{
		x*=c,y*=c;
		x/=z;
		y/=z;
	}
}
pii excrt(pii a,pii b){//a.s*x+a.f=b.s*y+b.f,a.s*x-b.s*y=b.f-a.f,
	int x,y;
	ed(a.s,-b.s,b.f-a.f,x,y);
	if(x==1e16&&y==1e16){
		return {0,0};
	}
	int a1,a2;
	a1=a.s*x+a.f;
	a2=lcm(a.s,b.s);
	if(a1<0){
		a1+=-a1/a2*a2;
		a1+=10*a2;
	}
	a1%=a2;
	return {a1,a2};
}
int f[309];
long long Bob(std::vector<std::pair<signed, signed> > V){
	memset(f,-1,sizeof(f));
	for(int i=0;i<V.size();i++){
		if(V[i].second>1){
			f[V[i].second-1]=V[i].first-1;
		}
	}
	int a,b;
	a=0,b=1;
	for(int i=2;i<=300;i++){
		if(f[i]>-1){
			pair<int,int> p;
			p=excrt({a,b},{f[i],i});
			a=p.first;
			b=p.second;
			if(b>1e18){
				return (long long)a;
			}
		}
	}
	return (long long)a;
}

详细

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

1
4005

output:

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

input:

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

output:

2
300 221
1 2
1 4
1 10
1 46
1 90
1 268
2 5
2 14
2 15
2 23
2 27
2 29
2 45
2 53
2 78
2 144
2 287
4 47
4 59
4 70
4 88
4 139
4 175
6 9
6 11
6 17
6 26
6 33
6 41
6 51
6 81
6 101
6 126
6 161
6 201
6 251
7 32
7 44
7 94
7 130
10 13
10 19
10 28
10 38
10 55
10 75
10 109
10 112
10 149
11 18
11 86
13 122
16 20
1...

input:

2
300 221
1 2
1 4
1 10
1 46
1 90
1 268
2 5
2 14
2 15
2 23
2 27
2 29
2 45
2 53
2 78
2 144
2 287
4 47
4 59
4 70
4 88
4 139
4 175
6 9
6 11
6 17
6 26
6 33
6 41
6 51
6 81
6 101
6 126
6 161
6 201
6 251
7 32
7 44
7 94
7 130
10 13
10 19
10 28
10 38
10 55
10 75
10 109
10 112
10 149
11 18
11 86
13 122
16 20
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1780kb,1736kb

input:

1
459

output:

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

input:

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

output:

2
300 221
1 2
1 4
1 10
1 18
1 28
1 52
1 154
2 230
4 5
4 9
4 13
4 20
4 25
4 39
4 115
4 229
5 14
5 36
5 66
6 228
7 152
8 114
8 227
10 11
10 19
10 26
10 46
10 51
10 76
10 91
10 151
10 226
12 15
12 17
12 29
12 33
12 57
12 65
12 113
12 225
13 150
14 224
15 90
16 38
16 75
16 112
16 149
18 27
19 22
19 64
1...

input:

2
300 221
1 2
1 4
1 10
1 18
1 28
1 52
1 154
2 230
4 5
4 9
4 13
4 20
4 25
4 39
4 115
4 229
5 14
5 36
5 66
6 228
7 152
8 114
8 227
10 11
10 19
10 26
10 46
10 51
10 76
10 91
10 151
10 226
12 15
12 17
12 29
12 33
12 57
12 65
12 113
12 225
13 150
14 224
15 90
16 38
16 75
16 112
16 149
18 27
19 22
19 64
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1780kb,1736kb

input:

1
2495

output:

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

input:

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

output:

2
300 221
1 2
2 44
2 59
2 87
3 4
3 10
3 278
4 5
4 15
4 29
4 90
4 179
5 54
6 11
6 84
6 167
6 250
7 20
7 132
8 9
10 23
10 114
10 227
11 36
11 72
12 13
12 19
12 28
12 47
12 55
12 70
12 93
12 109
12 139
13 14
13 192
14 18
14 147
16 17
16 32
16 41
16 63
16 81
16 125
16 156
17 38
17 68
18 22
18 43
18 119
...

input:

2
300 221
1 2
2 44
2 59
2 87
3 4
3 10
3 278
4 5
4 15
4 29
4 90
4 179
5 54
6 11
6 84
6 167
6 250
7 20
7 132
8 9
10 23
10 114
10 227
11 36
11 72
12 13
12 19
12 28
12 47
12 55
12 70
12 93
12 109
12 139
13 14
13 192
14 18
14 147
16 17
16 32
16 41
16 63
16 81
16 125
16 156
17 38
17 68
18 22
18 43
18 119
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

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

input:

3
1560

output:

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

input:

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

output:

4
300 150
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
1 261
16 104
17 194
19 258
32 140
33 192
36 62
40 118
40 170
42 50
42 218
46 102
48 90
51 152
53 59
53 117
54 138
55 252
56 216
57 95
57 189
58 168
60 80
63 108
6...

input:

4
300 150
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
1 261
16 104
17 194
19 258
32 140
33 192
36 62
40 118
40 170
42 50
42 218
46 102
48 90
51 152
53 59
53 117
54 138
55 252
56 216
57 95
57 189
58 168
60 80
63 108
6...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1780kb,1736kb

input:

3
3594

output:

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

input:

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

output:

4
300 150
1 7
3 5
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
7 277
7 300
8 18
8 212
10 16
10 240
13 200
15 21
15 180
18 50
18 74
26 44
26 84
27 224
33 138
33 275
39 128
39 255
40 46
40 80
40 238
42 188
42 210
44 54
44 68
45 51
45 72
45 143
46 92
46 170
46 274
49 198
...

input:

4
300 150
1 7
3 5
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
7 277
7 300
8 18
8 212
10 16
10 240
13 200
15 21
15 180
18 50
18 74
26 44
26 84
27 224
33 138
33 275
39 128
39 255
40 46
40 80
40 238
42 188
42 210
44 54
44 68
45 51
45 72
45 143
46 92
46 170
46 274
49 198
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

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

input:

3
1750

output:

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

input:

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

output:

4
300 150
12 38
12 48
13 23
14 194
21 174
23 25
23 28
23 33
23 37
23 49
23 55
23 65
23 73
23 97
23 109
23 145
23 193
23 217
23 289
24 158
26 70
32 192
34 102
36 246
39 108
39 215
40 60
43 62
43 123
43 245
46 56
46 156
48 132
49 75
53 284
55 107
55 213
56 114
59 189
59 283
60 90
61 66
61 170
63 212
6...

input:

4
300 150
12 38
12 48
13 23
14 194
21 174
23 25
23 28
23 33
23 37
23 49
23 55
23 65
23 73
23 97
23 109
23 145
23 193
23 217
23 289
24 158
26 70
32 192
34 102
36 246
39 108
39 215
40 60
43 62
43 123
43 245
46 56
46 156
48 132
49 75
53 284
55 107
55 213
56 114
59 189
59 283
60 90
61 66
61 170
63 212
6...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

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

input:

5
4878

output:

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

input:

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

output:

6
300 165
1 2
3 5
3 24
3 47
3 54
3 93
3 107
3 213
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
7 204
7 233
12 32
12 158
17 18
17 23
17 27
17 35
17 144
17 188
17 222
17 287
19 21
19 28
19 31
19 37
19 46
19 55
19 61
19 8...

input:

6
300 165
1 2
3 5
3 24
3 47
3 54
3 93
3 107
3 213
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
7 204
7 233
12 32
12 158
17 18
17 23
17 27
17 35
17 144
17 188
17 222
17 287
19 21
19 28
19 31
19 37
19 46
19 55
19 61
19 8...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

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

input:

5
1223

output:

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

input:

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

output:

6
300 158
2 3
2 14
2 27
2 48
2 95
4 5
4 6
4 11
4 21
4 62
4 123
4 245
8 9
8 17
8 20
8 33
8 39
8 65
8 77
8 153
12 13
12 102
12 203
15 32
15 40
15 94
16 152
18 19
18 68
18 135
18 202
24 25
24 26
24 31
24 41
24 49
24 51
24 61
24 76
24 81
24 101
24 121
24 151
24 201
24 241
28 47
28 53
28 93
28 300
29 240...

input:

6
300 158
2 3
2 14
2 27
2 48
2 95
4 5
4 6
4 11
4 21
4 62
4 123
4 245
8 9
8 17
8 20
8 33
8 39
8 65
8 77
8 153
12 13
12 102
12 203
15 32
15 40
15 94
16 152
18 19
18 68
18 135
18 202
24 25
24 26
24 31
24 41
24 49
24 51
24 61
24 76
24 81
24 101
24 121
24 151
24 201
24 241
28 47
28 53
28 93
28 300
29 240...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1780kb,1736kb

input:

5
648

output:

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

input:

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

output:

6
300 151
1 2
3 18
3 20
3 35
3 39
4 6
4 16
4 44
4 130
4 216
5 8
5 15
5 24
5 29
5 47
5 93
5 162
7 108
7 215
9 11
9 17
9 21
9 33
9 41
9 65
9 81
9 129
9 161
10 72
10 214
12 14
12 50
12 92
13 54
13 107
13 160
13 213
19 22
19 31
19 36
19 43
19 46
19 64
19 71
19 91
19 106
19 127
19 211
25 27
25 40
25 49
2...

input:

6
300 151
1 2
3 18
3 20
3 35
3 39
4 6
4 16
4 44
4 130
4 216
5 8
5 15
5 24
5 29
5 47
5 93
5 162
7 108
7 215
9 11
9 17
9 21
9 33
9 41
9 65
9 81
9 129
9 161
10 72
10 214
12 14
12 50
12 92
13 54
13 107
13 160
13 213
19 22
19 31
19 36
19 43
19 46
19 64
19 71
19 91
19 106
19 127
19 211
25 27
25 40
25 49
2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

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

input:

7
4475

output:

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

input:

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

output:

8
300 150
1 180
4 9
4 27
4 53
4 173
5 18
5 264
6 299
7 42
11 20
14 195
16 224
17 50
21 34
21 46
21 100
21 166
21 298
22 35
22 263
23 62
26 179
28 33
28 279
30 40
30 79
30 115
30 118
30 235
30 248
31 128
32 203
37 194
39 88
39 154
39 262
44 278
45 212
47 104
48 55
48 109
48 165
48 247
49 234
51 178
5...

input:

8
300 150
1 180
4 9
4 27
4 53
4 173
5 18
5 264
6 299
7 42
11 20
14 195
16 224
17 50
21 34
21 46
21 100
21 166
21 298
22 35
22 263
23 62
26 179
28 33
28 279
30 40
30 79
30 115
30 118
30 235
30 248
31 128
32 203
37 194
39 88
39 154
39 262
44 278
45 212
47 104
48 55
48 109
48 165
48 247
49 234
51 178
5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

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

input:

7
4240

output:

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

input:

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

output:

8
300 150
2 10
2 28
2 158
3 14
3 164
4 224
7 30
7 74
7 147
8 84
8 250
9 24
9 47
9 185
13 15
13 152
20 22
20 64
20 68
20 202
23 38
23 75
23 112
23 115
25 35
25 63
25 249
26 282
27 44
27 50
27 87
32 184
33 264
39 192
42 222
42 248
47 234
49 132
49 263
50 128
52 72
55 92
55 162
55 183
55 300
56 136
56 ...

input:

8
300 150
2 10
2 28
2 158
3 14
3 164
4 224
7 30
7 74
7 147
8 84
8 250
9 24
9 47
9 185
13 15
13 152
20 22
20 64
20 68
20 202
23 38
23 75
23 112
23 115
25 35
25 63
25 249
26 282
27 44
27 50
27 87
32 184
33 264
39 192
42 222
42 248
47 234
49 132
49 263
50 128
52 72
55 92
55 162
55 183
55 300
56 136
56 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1780kb,1736kb

input:

7
1291

output:

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

input:

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

output:

8
300 150
7 258
8 13
8 215
11 184
16 30
16 45
18 99
18 183
20 54
20 213
22 255
23 48
23 142
26 212
27 254
28 159
34 35
34 75
36 158
38 58
38 115
38 210
41 140
42 51
42 126
42 251
46 90
46 179
47 84
47 250
49 114
51 74
53 178
56 207
57 66
57 96
57 248
59 138
60 78
60 89
60 155
67 246
70 95
71 112
72 ...

input:

8
300 150
7 258
8 13
8 215
11 184
16 30
16 45
18 99
18 183
20 54
20 213
22 255
23 48
23 142
26 212
27 254
28 159
34 35
34 75
36 158
38 58
38 115
38 210
41 140
42 51
42 126
42 251
46 90
46 179
47 84
47 250
49 114
51 74
53 178
56 207
57 66
57 96
57 248
59 138
60 78
60 89
60 155
67 246
70 95
71 112
72 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

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

input:

1
17476204

output:

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

input:

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

output:

2
300 221
1 2
1 5
1 18
1 69
2 4
2 108
5 9
5 10
5 11
5 13
5 15
5 19
5 20
5 22
5 25
5 26
5 29
5 36
5 39
5 41
5 43
5 46
5 51
5 57
5 64
5 73
5 76
5 85
5 91
5 96
5 101
5 106
5 115
5 121
5 127
5 147
5 151
5 169
5 176
5 191
5 201
5 220
5 226
5 229
5 267
5 286
5 293
6 14
10 56
10 62
13 17
13 33
13 140
16 44...

input:

2
300 221
1 2
1 5
1 18
1 69
2 4
2 108
5 9
5 10
5 11
5 13
5 15
5 19
5 20
5 22
5 25
5 26
5 29
5 36
5 39
5 41
5 43
5 46
5 51
5 57
5 64
5 73
5 76
5 85
5 91
5 96
5 101
5 106
5 115
5 121
5 127
5 147
5 151
5 169
5 176
5 191
5 201
5 220
5 226
5 229
5 267
5 286
5 293
6 14
10 56
10 62
13 17
13 33
13 140
16 44...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

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

input:

1
11926600

output:

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

input:

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

output:

2
300 221
1 2
1 5
1 9
1 11
1 15
1 26
1 29
1 36
1 41
1 51
1 57
1 99
1 101
1 176
1 201
1 246
2 4
2 32
2 94
2 258
3 59
3 62
3 123
5 13
5 23
5 45
5 67
5 133
7 147
8 10
8 22
8 64
9 17
9 33
9 65
11 14
11 27
11 40
11 54
11 66
11 131
13 18
13 69
16 20
16 56
16 96
16 102
16 114
16 210
17 19
17 25
17 73
17 15...

input:

2
300 221
1 2
1 5
1 9
1 11
1 15
1 26
1 29
1 36
1 41
1 51
1 57
1 99
1 101
1 176
1 201
1 246
2 4
2 32
2 94
2 258
3 59
3 62
3 123
5 13
5 23
5 45
5 67
5 133
7 147
8 10
8 22
8 64
9 17
9 33
9 65
11 14
11 27
11 40
11 54
11 66
11 131
13 18
13 69
16 20
16 56
16 96
16 102
16 114
16 210
17 19
17 25
17 73
17 15...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

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

input:

1
16602378

output:

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

input:

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

output:

2
300 221
1 2
1 4
1 14
1 27
1 40
3 5
3 9
3 15
3 29
3 57
3 83
3 99
3 165
3 288
4 26
4 76
4 126
5 240
7 10
7 13
7 19
7 198
8 20
8 200
9 11
9 18
9 62
9 86
9 123
10 22
11 17
11 33
11 65
11 257
13 23
13 47
13 67
13 70
13 139
13 254
14 66
15 104
15 119
15 207
15 237
19 25
19 32
19 41
19 63
19 94
19 121
19...

input:

2
300 221
1 2
1 4
1 14
1 27
1 40
3 5
3 9
3 15
3 29
3 57
3 83
3 99
3 165
3 288
4 26
4 76
4 126
5 240
7 10
7 13
7 19
7 198
8 20
8 200
9 11
9 18
9 62
9 86
9 123
10 22
11 17
11 33
11 65
11 257
13 23
13 47
13 67
13 70
13 139
13 254
14 66
15 104
15 119
15 207
15 237
19 25
19 32
19 41
19 63
19 94
19 121
19...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

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

input:

3
13129243

output:

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

input:

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

output:

4
300 150
3 98
7 12
9 36
11 44
12 17
20 25
20 200
21 264
23 108
25 284
33 60
33 194
37 50
38 168
39 116
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
44 201
44 211
44 226
44 241
44 253
46 242
47 18...

input:

4
300 150
3 98
7 12
9 36
11 44
12 17
20 25
20 200
21 264
23 108
25 284
33 60
33 194
37 50
38 168
39 116
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
44 201
44 211
44 226
44 241
44 253
46 242
47 18...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

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

input:

3
7892141

output:

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

input:

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

output:

4
300 150
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
6 253
6 295
8 44
8 87
8 164
12 16
12 31
15 28
16 23
22 41
22 192
28 35
28 98
28 195
30 49
32 180
33 228
37 116
37 300
39 74
39 220
43 48
45 52
46 65
...

input:

4
300 150
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
6 253
6 295
8 44
8 87
8 164
12 16
12 31
15 28
16 23
22 41
22 192
28 35
28 98
28 195
30 49
32 180
33 228
37 116
37 300
39 74
39 220
43 48
45 52
46 65
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

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

input:

3
21314775

output:

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

input:

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

output:

4
300 150
2 3
2 14
2 27
4 28
7 22
14 15
17 74
20 87
20 173
23 60
23 80
23 270
25 58
26 51
26 126
26 251
28 29
28 40
28 43
28 53
28 79
28 85
28 92
28 132
28 150
28 157
28 183
28 263
28 274
28 299
34 62
34 123
34 184
35 182
38 75
38 114
38 227
39 102
39 240
41 48
41 236
42 138
42 275
49 64
49 194
54 1...

input:

4
300 150
2 3
2 14
2 27
4 28
7 22
14 15
17 74
20 87
20 173
23 60
23 80
23 270
25 58
26 51
26 126
26 251
28 29
28 40
28 43
28 53
28 79
28 85
28 92
28 132
28 150
28 157
28 183
28 263
28 274
28 299
34 62
34 123
34 184
35 182
38 75
38 114
38 227
39 102
39 240
41 48
41 236
42 138
42 275
49 64
49 194
54 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

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

input:

5
5559540

output:

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

input:

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

output:

6
300 155
1 2
4 24
4 70
4 198
5 9
5 17
5 48
5 95
5 189
6 284
7 10
7 19
7 74
7 147
7 220
8 20
8 134
13 14
13 25
13 27
13 40
13 53
13 79
13 104
13 105
13 157
13 174
13 207
15 68
15 135
16 26
16 46
16 76
16 226
21 33
21 41
21 81
21 161
23 42
23 83
23 152
28 44
28 72
28 130
28 214
29 57
30 60
31 34
31 3...

input:

6
300 155
1 2
4 24
4 70
4 198
5 9
5 17
5 48
5 95
5 189
6 284
7 10
7 19
7 74
7 147
7 220
8 20
8 134
13 14
13 25
13 27
13 40
13 53
13 79
13 104
13 105
13 157
13 174
13 207
15 68
15 135
16 26
16 46
16 76
16 226
21 33
21 41
21 81
21 161
23 42
23 83
23 152
28 44
28 72
28 130
28 214
29 57
30 60
31 34
31 3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

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

input:

5
9424319

output:

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

input:

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

output:

6
300 160
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
15 238
15 242
20 21
20 26
20 51
20 74
20 101
20 147
20 293
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
...

input:

6
300 160
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
15 238
15 242
20 21
20 26
20 51
20 74
20 101
20 147
20 293
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
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

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

input:

5
10955780

output:

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

input:

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

output:

6
300 151
1 2
1 3
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
1 210
1 221
4 8
5 9
7 24
7 38
7 42
7 47
7 75
7 83
7 158
9 13
9 19
9 32
9 37
9 63
9 94
9 125
9 187
9 280
14 74
14 224
16 30
16 146
18 22
18 28
18 40
18 50
18 64
18 92
18 118
18 148
18 170
18 190
18 274
25 29
26 44
26 ...

input:

6
300 151
1 2
1 3
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
1 210
1 221
4 8
5 9
7 24
7 38
7 42
7 47
7 75
7 83
7 158
9 13
9 19
9 32
9 37
9 63
9 94
9 125
9 187
9 280
14 74
14 224
16 30
16 146
18 22
18 28
18 40
18 50
18 64
18 92
18 118
18 148
18 170
18 190
18 274
25 29
26 44
26 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

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

input:

7
19938721

output:

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

input:

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

output:

8
300 150
4 30
4 59
5 10
5 28
5 82
5 214
8 39
8 115
9 44
11 40
13 74
14 19
14 38
14 75
14 112
14 223
16 54
16 107
17 256
18 63
18 123
18 245
18 249
20 43
21 108
26 60
26 119
26 237
27 96
27 134
32 55
32 136
32 271
35 252
36 158
41 64
41 192
45 254
46 77
47 84
47 250
52 87
52 90
52 179
52 216
53 124
...

input:

8
300 150
4 30
4 59
5 10
5 28
5 82
5 214
8 39
8 115
9 44
11 40
13 74
14 19
14 38
14 75
14 112
14 223
16 54
16 107
17 256
18 63
18 123
18 245
18 249
20 43
21 108
26 60
26 119
26 237
27 96
27 134
32 55
32 136
32 271
35 252
36 158
41 64
41 192
45 254
46 77
47 84
47 250
52 87
52 90
52 179
52 216
53 124
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

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

input:

7
5129508

output:

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

input:

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

output:

8
300 150
3 20
3 24
4 16
5 17
5 158
7 15
10 54
10 160
11 12
18 30
18 74
23 95
23 198
23 278
33 45
34 66
34 196
35 150
35 299
36 108
37 97
37 129
39 80
39 87
39 152
39 159
39 216
40 42
40 124
42 50
46 258
48 290
49 61
49 64
49 71
49 93
49 116
49 119
49 127
49 136
49 139
49 162
49 178
49 181
49 208
49...

input:

8
300 150
3 20
3 24
4 16
5 17
5 158
7 15
10 54
10 160
11 12
18 30
18 74
23 95
23 198
23 278
33 45
34 66
34 196
35 150
35 299
36 108
37 97
37 129
39 80
39 87
39 152
39 159
39 216
40 42
40 124
42 50
46 258
48 290
49 61
49 64
49 71
49 93
49 116
49 119
49 127
49 136
49 139
49 162
49 178
49 181
49 208
49...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

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

input:

7
15332941

output:

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

input:

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

output:

8
300 150
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
2 216
2 253
2 259
2 284
4 168
8 83
8 124
8 158
8 247
9 12
9 50
14 25
14 49
14 157
14 193
14 209
15 24
17 26
17 76
21 164
31 102
33 272
37 96
37 134
38 48
38 73
38 93
38 139
38 185
38 189
3...

input:

8
300 150
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
2 216
2 253
2 259
2 284
4 168
8 83
8 124
8 158
8 247
9 12
9 50
14 25
14 49
14 157
14 193
14 209
15 24
17 26
17 76
21 164
31 102
33 272
37 96
37 134
38 48
38 73
38 93
38 139
38 185
38 189
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 65
Accepted

Test #25:

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

input:

1
355365355024496523

output:

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

input:

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

output:

2
300 221
1 2
1 4
1 22
3 258
4 5
4 9
4 10
4 11
4 13
4 19
4 23
4 25
4 41
4 45
4 46
4 56
4 67
4 73
4 89
4 91
4 100
4 121
4 133
4 199
4 221
4 265
4 284
6 14
6 27
6 54
7 32
7 94
8 15
8 29
10 38
10 47
10 70
10 75
10 84
10 112
10 139
10 167
10 250
12 17
12 33
12 65
13 28
15 18
15 78
15 120
15 122
15 188
1...

input:

2
300 221
1 2
1 4
1 22
3 258
4 5
4 9
4 10
4 11
4 13
4 19
4 23
4 25
4 41
4 45
4 46
4 56
4 67
4 73
4 89
4 91
4 100
4 121
4 133
4 199
4 221
4 265
4 284
6 14
6 27
6 54
7 32
7 94
8 15
8 29
10 38
10 47
10 70
10 75
10 84
10 112
10 139
10 167
10 250
12 17
12 33
12 65
13 28
15 18
15 78
15 120
15 122
15 188
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
355365355024496523

Test #26:

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

input:

1
727827999106414164

output:

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

input:

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

output:

2
300 221
1 2
1 4
1 5
1 13
1 15
1 22
1 29
1 43
1 85
1 110
1 132
1 219
1 263
3 23
3 122
3 243
4 62
4 184
5 9
5 11
5 17
5 41
5 81
6 138
7 10
7 19
11 14
11 27
11 194
12 18
12 198
12 290
13 25
14 20
14 210
15 26
15 36
15 51
15 114
15 176
15 227
16 240
18 90
19 38
19 68
19 75
19 112
19 135
19 202
20 146
...

input:

2
300 221
1 2
1 4
1 5
1 13
1 15
1 22
1 29
1 43
1 85
1 110
1 132
1 219
1 263
3 23
3 122
3 243
4 62
4 184
5 9
5 11
5 17
5 41
5 81
6 138
7 10
7 19
11 14
11 27
11 194
12 18
12 198
12 290
13 25
14 20
14 210
15 26
15 36
15 51
15 114
15 176
15 227
16 240
18 90
19 38
19 68
19 75
19 112
19 135
19 202
20 146
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
727827999106414164

Test #27:

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

input:

1
656410143989222955

output:

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

input:

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

output:

2
300 221
1 2
1 4
1 10
1 28
1 46
1 82
1 84
1 136
1 250
2 18
4 5
4 9
4 13
4 15
4 22
4 25
4 29
4 43
4 57
4 85
4 169
6 11
6 26
6 51
7 54
8 14
8 27
8 53
9 38
10 19
10 47
10 70
10 139
11 36
12 17
12 33
14 23
15 198
16 20
16 39
16 96
16 115
16 191
16 229
16 286
17 258
18 99
18 108
18 150
18 215
19 52
19 1...

input:

2
300 221
1 2
1 4
1 10
1 28
1 46
1 82
1 84
1 136
1 250
2 18
4 5
4 9
4 13
4 15
4 22
4 25
4 29
4 43
4 57
4 85
4 169
6 11
6 26
6 51
7 54
8 14
8 27
8 53
9 38
10 19
10 47
10 70
10 139
11 36
12 17
12 33
14 23
15 198
16 20
16 39
16 96
16 115
16 191
16 229
16 286
17 258
18 99
18 108
18 150
18 215
19 52
19 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
656410143989222955

Test #28:

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

input:

1
410366615149657534

output:

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

input:

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

output:

2
300 221
1 2
1 147
2 4
3 5
3 47
3 54
3 72
3 93
3 143
3 213
3 285
5 10
5 11
5 14
5 15
5 19
5 22
5 27
5 28
5 36
5 40
5 43
5 46
5 55
5 64
5 66
5 91
5 106
5 118
5 127
5 131
5 136
5 190
5 235
5 271
5 274
7 9
9 20
9 32
9 39
9 63
10 26
10 284
11 13
14 68
14 202
15 17
15 41
15 81
16 18
17 23
17 67
19 29
19...

input:

2
300 221
1 2
1 147
2 4
3 5
3 47
3 54
3 72
3 93
3 143
3 213
3 285
5 10
5 11
5 14
5 15
5 19
5 22
5 27
5 28
5 36
5 40
5 43
5 46
5 55
5 64
5 66
5 91
5 106
5 118
5 127
5 131
5 136
5 190
5 235
5 271
5 274
7 9
9 20
9 32
9 39
9 63
10 26
10 284
11 13
14 68
14 202
15 17
15 41
15 81
16 18
17 23
17 67
19 29
19...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
410366615149657534

Test #29:

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

input:

1
298090682780948428

output:

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

input:

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

output:

2
300 221
1 2
1 5
1 15
1 29
1 32
1 63
1 99
1 125
1 158
1 218
2 4
4 26
5 9
5 10
5 13
5 19
5 25
5 47
5 70
5 73
5 93
5 139
5 185
6 128
8 14
8 22
8 38
8 40
8 112
8 170
8 274
9 11
9 23
9 45
9 56
9 119
9 122
9 221
9 237
9 243
11 284
12 20
13 17
13 33
13 65
14 28
14 46
14 136
15 18
15 120
15 239
18 84
21 2...

input:

2
300 221
1 2
1 5
1 15
1 29
1 32
1 63
1 99
1 125
1 158
1 218
2 4
4 26
5 9
5 10
5 13
5 19
5 25
5 47
5 70
5 73
5 93
5 139
5 185
6 128
8 14
8 22
8 38
8 40
8 112
8 170
8 274
9 11
9 23
9 45
9 56
9 119
9 122
9 221
9 237
9 243
11 284
12 20
13 17
13 33
13 65
14 28
14 46
14 136
15 18
15 120
15 239
18 84
21 2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
298090682780948428

Test #30:

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

input:

3
969441916331132577

output:

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

input:

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

output:

4
300 150
1 70
5 8
7 62
8 11
8 228
9 14
9 30
9 42
12 15
16 135
16 202
18 21
18 41
18 81
23 86
24 47
29 104
31 32
31 94
32 39
33 36
33 110
37 112
41 44
43 72
43 214
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
60 263
61 92
61 274
62 63
62 125
67 88
67 90
67 268...

input:

4
300 150
1 70
5 8
7 62
8 11
8 228
9 14
9 30
9 42
12 15
16 135
16 202
18 21
18 41
18 81
23 86
24 47
29 104
31 32
31 94
32 39
33 36
33 110
37 112
41 44
43 72
43 214
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
60 263
61 92
61 274
62 63
62 125
67 88
67 90
67 268...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
969441916331132577

Test #31:

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

input:

3
929489812741933634

output:

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

input:

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

output:

4
300 150
1 2
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
3 217
3 225
3 253
3 289
7 32
7 63
7 125
14 54
16 180
23 53
24 58
24 134
25 186
26 150
29 200
41 158
43 77
43 153
49...

input:

4
300 150
1 2
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
3 217
3 225
3 253
3 289
7 32
7 63
7 125
14 54
16 180
23 53
24 58
24 134
25 186
26 150
29 200
41 158
43 77
43 153
49...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
929489812741933634

Test #32:

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

input:

3
144032041325838295

output:

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

input:

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

output:

4
300 150
1 6
1 36
3 42
6 140
6 279
7 14
10 18
10 35
13 90
13 164
15 78
16 41
25 62
26 56
27 48
29 82
29 244
34 47
34 59
35 98
35 292
36 141
41 84
41 250
43 134
47 72
47 130
47 214
48 75
48 89
48 149
48 297
50 68
50 135
50 202
52 234
53 94
53 138
54 159
56 61
56 73
56 81
56 91
56 97
56 109
56 121
56...

input:

4
300 150
1 6
1 36
3 42
6 140
6 279
7 14
10 18
10 35
13 90
13 164
15 78
16 41
25 62
26 56
27 48
29 82
29 244
34 47
34 59
35 98
35 292
36 141
41 84
41 250
43 134
47 72
47 130
47 214
48 75
48 89
48 149
48 297
50 68
50 135
50 202
52 234
53 94
53 138
54 159
56 61
56 73
56 81
56 91
56 97
56 109
56 121
56...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
144032041325838295

Test #33:

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

input:

3
832110946250826180

output:

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

input:

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

output:

4
300 150
1 13
2 8
6 26
6 182
7 108
7 215
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
13 213
13 217
13 249
13 259
13 280
14 278
15 282
17 27
17 53
18 98
18 270
23 30
23 59
23 204
27 228
27 242
29 62
29 123
29 2...

input:

4
300 150
1 13
2 8
6 26
6 182
7 108
7 215
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
13 213
13 217
13 249
13 259
13 280
14 278
15 282
17 27
17 53
18 98
18 270
23 30
23 59
23 204
27 228
27 242
29 62
29 123
29 2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
832110946250826180

Test #34:

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

input:

3
85728715707691821

output:

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

input:

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

output:

4
300 150
1 4
4 19
5 32
6 9
9 228
10 22
11 44
11 140
17 36
18 23
18 45
18 270
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
22 201
22 217
22 226
22 271
26 39
26 77
26 158
28 98
28 195
28 292
34 123
34 245
36 63
36...

input:

4
300 150
1 4
4 19
5 32
6 9
9 228
10 22
11 44
11 140
17 36
18 23
18 45
18 270
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
22 201
22 217
22 226
22 271
26 39
26 77
26 158
28 98
28 195
28 292
34 123
34 245
36 63
36...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
85728715707691821

Test #35:

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

input:

5
777434612360931036

output:

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

input:

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

output:

6
300 153
1 3
2 6
2 8
2 30
2 36
2 62
2 146
2 204
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
7 243
10 258
13 17
13 25
13 48
13 49
13 95
13 142
13 189
13 283
14 18
19 27
19 28
19 32
19 40
19 55
19 63
19 79
19 94
19 118
19 187
19 235
19 280
21 98
21 195
29 33
29 4...

input:

6
300 153
1 3
2 6
2 8
2 30
2 36
2 62
2 146
2 204
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
7 243
10 258
13 17
13 25
13 48
13 49
13 95
13 142
13 189
13 283
14 18
19 27
19 28
19 32
19 40
19 55
19 63
19 79
19 94
19 118
19 187
19 235
19 280
21 98
21 195
29 33
29 4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
777434612360931036

Test #36:

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

input:

5
705262511549880222

output:

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

input:

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

output:

6
300 160
1 2
3 5
3 6
3 11
3 21
3 102
3 203
4 14
4 40
4 170
7 9
7 10
7 13
7 19
7 25
7 37
7 73
7 114
7 227
12 62
12 104
15 17
15 18
15 35
15 69
15 137
15 174
15 273
16 20
16 22
16 34
16 58
16 64
16 78
16 100
16 134
16 172
16 210
16 232
23 26
23 29
23 36
23 41
23 50
23 51
23 57
23 71
23 99
23 101
23 1...

input:

6
300 160
1 2
3 5
3 6
3 11
3 21
3 102
3 203
4 14
4 40
4 170
7 9
7 10
7 13
7 19
7 25
7 37
7 73
7 114
7 227
12 62
12 104
15 17
15 18
15 35
15 69
15 137
15 174
15 273
16 20
16 22
16 34
16 58
16 64
16 78
16 100
16 134
16 172
16 210
16 232
23 26
23 29
23 36
23 41
23 50
23 51
23 57
23 71
23 99
23 101
23 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
705262511549880222

Test #37:

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

input:

5
510318082834167951

output:

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

input:

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

output:

6
300 159
1 4
2 3
2 6
2 11
2 26
2 51
4 7
4 13
4 68
4 135
4 202
4 269
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
22 211
24 60
24 119
24 198
24 237
28 37
28 55
28 109
28 138
28 275
32 41
32 ...

input:

6
300 159
1 4
2 3
2 6
2 11
2 26
2 51
4 7
4 13
4 68
4 135
4 202
4 269
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
22 211
24 60
24 119
24 198
24 237
28 37
28 55
28 109
28 138
28 275
32 41
32 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
510318082834167951

Test #38:

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

input:

5
914858813253258744

output:

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

input:

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

output:

6
300 167
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
9 228
9 245
14 144
15 20
15 39
15 96
15 98
15 150
15 191
15 195
15 299
25 29
25 31
25 33
25 34
25 36
25 37
25 41
25 43
25 45
25 46
25 49
25 56
...

input:

6
300 167
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
9 228
9 245
14 144
15 20
15 39
15 96
15 98
15 150
15 191
15 195
15 299
25 29
25 31
25 33
25 34
25 36
25 37
25 41
25 43
25 45
25 46
25 49
25 56
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
914858813253258744

Test #39:

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

input:

5
659635316746638238

output:

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

input:

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

output:

6
300 151
1 3
2 4
4 20
4 96
4 108
4 224
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
14 260
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
23 229
23 237
23 283
23 292
24 32
24...

input:

6
300 151
1 3
2 4
4 20
4 96
4 108
4 224
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
14 260
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
23 229
23 237
23 283
23 292
24 32
24...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659635316746638238

Test #40:

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

input:

7
858490260563149759

output:

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

input:

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

output:

8
300 150
4 5
5 6
5 16
7 72
11 48
14 43
14 50
14 159
14 238
14 295
15 18
15 86
17 24
17 54
18 23
22 39
22 87
25 90
29 298
31 68
32 33
32 69
32 103
32 137
32 205
32 273
34 200
35 36
35 76
35 106
41 58
44 278
46 75
47 164
49 204
53 198
60 77
60 96
60 101
60 191
61 114
61 192
62 67
63 162
64 129
66 119...

input:

8
300 150
4 5
5 6
5 16
7 72
11 48
14 43
14 50
14 159
14 238
14 295
15 18
15 86
17 24
17 54
18 23
22 39
22 87
25 90
29 298
31 68
32 33
32 69
32 103
32 137
32 205
32 273
34 200
35 36
35 76
35 106
41 58
44 278
46 75
47 164
49 204
53 198
60 77
60 96
60 101
60 191
61 114
61 192
62 67
63 162
64 129
66 119...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
858490260563149759

Test #41:

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

input:

7
860058643727731209

output:

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

input:

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

output:

8
300 150
3 158
9 14
10 31
10 33
10 38
10 51
10 65
10 76
10 97
10 101
10 112
10 121
10 149
10 161
10 186
10 193
10 201
10 223
10 241
10 257
10 297
13 32
14 29
15 56
15 122
21 54
24 39
34 73
35 66
35 176
35 204
41 90
41 290
43 172
45 174
45 216
46 234
47 48
48 144
48 287
49 148
50 215
52 139
52 208
5...

input:

8
300 150
3 158
9 14
10 31
10 33
10 38
10 51
10 65
10 76
10 97
10 101
10 112
10 121
10 149
10 161
10 186
10 193
10 201
10 223
10 241
10 257
10 297
13 32
14 29
15 56
15 122
21 54
24 39
34 73
35 66
35 176
35 204
41 90
41 290
43 172
45 174
45 216
46 234
47 48
48 144
48 287
49 148
50 215
52 139
52 208
5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
860058643727731209

Test #42:

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

input:

7
718861404514377808

output:

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

input:

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

output:

8
300 150
2 4
3 12
3 102
3 203
4 6
5 198
6 8
6 140
7 90
7 179
10 32
11 19
14 24
14 116
14 166
15 80
15 108
15 159
15 215
17 193
21 44
21 87
21 147
25 45
25 89
27 104
27 207
28 72
30 200
32 164
33 168
34 36
34 176
35 40
35 79
38 82
39 236
48 50
48 92
48 248
49 161
51 98
51 195
54 206
55 60
55 132
55 ...

input:

8
300 150
2 4
3 12
3 102
3 203
4 6
5 198
6 8
6 140
7 90
7 179
10 32
11 19
14 24
14 116
14 166
15 80
15 108
15 159
15 215
17 193
21 44
21 87
21 147
25 45
25 89
27 104
27 207
28 72
30 200
32 164
33 168
34 36
34 176
35 40
35 79
38 82
39 236
48 50
48 92
48 248
49 161
51 98
51 195
54 206
55 60
55 132
55 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
718861404514377808

Test #43:

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

input:

7
659192688464047828

output:

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

input:

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

output:

8
300 150
3 12
3 23
4 138
6 72
7 15
7 120
7 239
8 10
8 292
9 11
17 19
17 28
17 55
18 20
25 45
26 118
35 64
35 68
35 127
35 135
35 202
36 108
37 185
38 282
39 66
39 228
42 50
44 46
44 136
46 48
47 62
47 123
47 184
49 174
53 73
53 97
53 289
56 134
56 268
58 74
58 188
61 207
63 279
65 128
65 157
65 255...

input:

8
300 150
3 12
3 23
4 138
6 72
7 15
7 120
7 239
8 10
8 292
9 11
17 19
17 28
17 55
18 20
25 45
26 118
35 64
35 68
35 127
35 135
35 202
36 108
37 185
38 282
39 66
39 228
42 50
44 46
44 136
46 48
47 62
47 123
47 184
49 174
53 73
53 97
53 289
56 134
56 268
58 74
58 188
61 207
63 279
65 128
65 157
65 255...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659192688464047828

Test #44:

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

input:

7
685730986714800201

output:

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

input:

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

output:

8
300 150
3 282
4 19
6 152
8 15
8 18
8 35
8 99
8 120
8 239
9 48
9 132
11 12
14 39
17 68
20 27
20 198
22 23
22 29
22 43
22 45
22 60
22 61
22 91
22 111
22 119
22 133
22 141
22 155
22 181
22 199
22 211
22 221
22 237
22 253
22 296
30 168
30 252
30 270
31 262
33 144
33 248
34 219
36 104
38 63
38 125
42 6...

input:

8
300 150
3 282
4 19
6 152
8 15
8 18
8 35
8 99
8 120
8 239
9 48
9 132
11 12
14 39
17 68
20 27
20 198
22 23
22 29
22 43
22 45
22 60
22 61
22 91
22 111
22 119
22 133
22 141
22 155
22 181
22 199
22 211
22 221
22 237
22 253
22 296
30 168
30 252
30 270
31 262
33 144
33 248
34 219
36 104
38 63
38 125
42 6...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
685730986714800201