QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#601249#8726. Magic Showxwh_Marvelous35 1ms1936kbC++141.3kb2024-09-29 21:50:302024-09-29 21:50:31

Judging History

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

  • [2024-09-29 21:50:31]
  • 评测
  • 测评结果:35
  • 用时:1ms
  • 内存:1936kb
  • [2024-09-29 21:50:30]
  • 提交

Alice

#include<bits/stdc++.h>
#include"Alice.h"
using namespace std;
//#define int long long
//#define mod 1000000007
#define N 5005
//#define pii pair<int,int>
//#define fi first
//#define se second
//#define rep(i,j,k) for(int i=j;i<=k;i++)
vector<std::pair<int, int>>op;
int a[N],b[N];
vector<int>ls[2];
int n=5000;
mt19937 rd(114514);
void gen(){
	for(int i=3;i<=5000;i++)a[i]=rd()%64;
	b[1]=0,b[2]=1;
	for(int i=3;i<=5000;i++)b[i]=rd()%2;
}
std::vector<std::pair<int, int>> Alice(){
	long long x=setN(5000);
	gen();
	op.push_back({1,2});
	ls[0].push_back(1),ls[1].push_back(2);
	for(int i=3;i<=n;i++){
		op.push_back({ls[(x>>a[i])&1][rd()%ls[(x>>a[i])&1].size()],i});
		ls[b[i]].push_back(i);
	}
	return op;
}

Bob

#include<bits/stdc++.h>
#include"Bob.h"
using namespace std;
// #define int long long
//#define mod 1000000007
#define N 5005
//#define pii pair<int,int>
#define fi first
#define se second
//#define rep(i,j,k) for(int i=j;i<=k;i++)
vector<std::pair<int, int>>op;
int a[N],b[N];
int n=5000;
mt19937 rd(114514);
void gen(){
	for(int i=3;i<=5000;i++)a[i]=rd()%64;
	b[1]=0,b[2]=1;
	for(int i=3;i<=5000;i++)b[i]=rd()%2;
}
long long Bob(std::vector<std::pair<int, int>> V){
	gen();
	long long ans=0;
	for(auto op:V){
		int u=op.fi,v=op.se;
		if(u>v)swap(u,v);
		ans|=(b[u]<<a[v]);
	}
	return ans;
}

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

1
4005

output:

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

input:

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

output:

2
5000 2690
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
3 119
3 146
3 2044
3 4412
3 4566
6 7
6 11
6 19
6 563
6 1365
6 2273
6 2880
6 3187
8 1708
9 24
9 93
11 16
11 25
11 35
11 42
11 74
11 520
12 2603
13 43
14 37
14 71
14 296
14 2706
14 4948
15 4080
16 20
16 21
16 26
16 45
16 72
16 546
16 59...

input:

2
5000 2690
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
3 119
3 146
3 2044
3 4412
3 4566
6 7
6 11
6 19
6 563
6 1365
6 2273
6 2880
6 3187
8 1708
9 24
9 93
11 16
11 25
11 35
11 42
11 74
11 520
12 2603
13 43
14 37
14 71
14 296
14 2706
14 4948
15 4080
16 20
16 21
16 26
16 45
16 72
16 546
16 59...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

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

input:

1
459

output:

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

input:

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

output:

2
5000 2690
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
1 3808
2 3524
3 146
6 7
6 11
6 19
6 563
6 1365
6 2273
6 2880
6 3187
7 50
8 135
8 1708
9 24
9 93
9 1306
11 16
11 25
11 35
11 42
11 74
11 520
11 1711
12 2603
14 37
14 71
14 296
14 2706
14 4948
16 20
16 21
16 26
16 45
16 72
16 596
16 892...

input:

2
5000 2690
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
1 3808
2 3524
3 146
6 7
6 11
6 19
6 563
6 1365
6 2273
6 2880
6 3187
7 50
8 135
8 1708
9 24
9 93
9 1306
11 16
11 25
11 35
11 42
11 74
11 520
11 1711
12 2603
14 37
14 71
14 296
14 2706
14 4948
16 20
16 21
16 26
16 45
16 72
16 596
16 892...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

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

input:

1
2495

output:

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

input:

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

output:

2
5000 2690
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
3 119
3 146
3 2044
3 4566
6 7
6 11
6 19
6 563
6 1365
6 2880
6 3187
7 50
8 135
8 1708
9 24
9 93
9 1306
11 16
11 25
11 35
11 42
11 74
11 520
12 2603
13 43
14 37
14 71
14 296
14 2706
14 4948
15 4080
16 20
16 21
16 26
16 45
16 72
16 546
1...

input:

2
5000 2690
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
3 119
3 146
3 2044
3 4566
6 7
6 11
6 19
6 563
6 1365
6 2880
6 3187
7 50
8 135
8 1708
9 24
9 93
9 1306
11 16
11 25
11 35
11 42
11 74
11 520
12 2603
13 43
14 37
14 71
14 296
14 2706
14 4948
15 4080
16 20
16 21
16 26
16 45
16 72
16 546
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

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

input:

3
1560

output:

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

input:

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

output:

4
5000 2500
1 2
1 3
1 4
1 5
1 6
1 8
1 9
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
3 4412
18 192
19 2743
22 51
22 130
22 154
31 2823
32 616
33 2294
39 350
44 1112
46 1027
51 1592
56 1862
61 3602
62 86
65 155
68 1626
79 3545
85 2862
106 113
108 499
113 1324
120 4135
120 ...

input:

4
5000 2500
1 2
1 3
1 4
1 5
1 6
1 8
1 9
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
3 4412
18 192
19 2743
22 51
22 130
22 154
31 2823
32 616
33 2294
39 350
44 1112
46 1027
51 1592
56 1862
61 3602
62 86
65 155
68 1626
79 3545
85 2862
106 113
108 499
113 1324
120 4135
120 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

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

input:

3
3594

output:

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

input:

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

output:

4
5000 2500
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
2 2807
3 2044
3 4412
7 8
15 4080
18 192
19 2743
22 51
22 130
22 154
29 31
29 1101
29 2627
31 2823
39 350
44 162
44 1112
45 2974
51 1034
51 1592
56 1862
59 3922
61 3602
62 86
62 590
65 155
68 ...

input:

4
5000 2500
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
2 2807
3 2044
3 4412
7 8
15 4080
18 192
19 2743
22 51
22 130
22 154
29 31
29 1101
29 2627
31 2823
39 350
44 162
44 1112
45 2974
51 1034
51 1592
56 1862
59 3922
61 3602
62 86
62 590
65 155
68 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

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

input:

3
1750

output:

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

input:

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

output:

4
5000 2500
1 2
1 3
1 4
1 5
1 6
1 8
1 9
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
2 56
2 3524
3 4412
3 4566
8 1115
10 988
12 2603
18 192
18 771
19 1173
19 2743
21 4969
22 51
22 130
22 154
29 31
29 1101
31 2823
32 616
33 2294
39 350
39 954
44 162
44 1112
46 1027
51 1034...

input:

4
5000 2500
1 2
1 3
1 4
1 5
1 6
1 8
1 9
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
2 56
2 3524
3 4412
3 4566
8 1115
10 988
12 2603
18 192
18 771
19 1173
19 2743
21 4969
22 51
22 130
22 154
29 31
29 1101
31 2823
32 616
33 2294
39 350
39 954
44 162
44 1112
46 1027
51 1034...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

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

input:

5
4878

output:

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

input:

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

output:

6
5000 2503
1 2
1 3
1 4
1 6
1 8
1 9
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
7 50
10 602
11 16
11 25
11 35
11 42
11 74
11 492
11 520
11 615
11 1711
11 3274
12 23
14 15
14 28
14 37
14 71
14 76
14 83
14 115
14 139
14 229
14 296
14 1325
14 1698
14 2706
14 4948
17 18
17 7...

input:

6
5000 2503
1 2
1 3
1 4
1 6
1 8
1 9
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
7 50
10 602
11 16
11 25
11 35
11 42
11 74
11 492
11 520
11 615
11 1711
11 3274
12 23
14 15
14 28
14 37
14 71
14 76
14 83
14 115
14 139
14 229
14 296
14 1325
14 1698
14 2706
14 4948
17 18
17 7...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

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

input:

5
1223

output:

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

input:

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

output:

6
5000 2506
1 5
2 56
2 672
2 3524
3 4566
4 421
6 7
6 11
6 17
6 19
6 82
6 232
6 563
6 908
6 1128
6 1365
6 2273
6 2880
6 3187
8 274
8 1115
9 10
9 12
9 14
9 22
9 24
9 36
9 93
9 104
9 127
9 136
9 431
9 449
9 1306
13 43
16 20
16 21
16 26
16 29
16 45
16 58
16 72
16 181
16 596
16 726
16 892
16 2786
16 3701...

input:

6
5000 2506
1 5
2 56
2 672
2 3524
3 4566
4 421
6 7
6 11
6 17
6 19
6 82
6 232
6 563
6 908
6 1128
6 1365
6 2273
6 2880
6 3187
8 274
8 1115
9 10
9 12
9 14
9 22
9 24
9 36
9 93
9 104
9 127
9 136
9 431
9 449
9 1306
13 43
16 20
16 21
16 26
16 29
16 45
16 58
16 72
16 181
16 596
16 726
16 892
16 2786
16 3701...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

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

input:

5
648

output:

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

input:

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

output:

6
5000 2503
1 2
3 4412
6 7
6 11
6 17
6 19
6 82
6 232
6 563
6 908
6 1128
6 1365
6 2099
6 2273
6 2880
6 3187
8 135
9 10
9 12
9 14
9 22
9 24
9 36
9 93
9 104
9 127
9 136
9 431
9 449
16 20
16 21
16 26
16 29
16 31
16 45
16 58
16 72
16 181
16 546
16 596
16 726
16 892
16 2536
16 2786
16 3701
16 4824
18 192
...

input:

6
5000 2503
1 2
3 4412
6 7
6 11
6 17
6 19
6 82
6 232
6 563
6 908
6 1128
6 1365
6 2099
6 2273
6 2880
6 3187
8 135
9 10
9 12
9 14
9 22
9 24
9 36
9 93
9 104
9 127
9 136
9 431
9 449
16 20
16 21
16 26
16 29
16 31
16 45
16 58
16 72
16 181
16 546
16 596
16 726
16 892
16 2536
16 2786
16 3701
16 4824
18 192
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

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

input:

7
4475

output:

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

input:

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

output:

8
5000 2500
2 3524
8 1708
19 183
19 2295
22 130
22 154
24 249
24 771
24 3408
29 31
32 46
32 616
33 2294
39 954
43 606
43 1447
44 162
44 1911
45 3167
54 2580
57 3192
59 3922
60 2099
61 3602
62 590
63 1003
63 1687
63 1894
79 3545
83 231
87 2460
88 1290
95 186
95 3993
99 3284
99 4098
101 1454
101 3122
...

input:

8
5000 2500
2 3524
8 1708
19 183
19 2295
22 130
22 154
24 249
24 771
24 3408
29 31
32 46
32 616
33 2294
39 954
43 606
43 1447
44 162
44 1911
45 3167
54 2580
57 3192
59 3922
60 2099
61 3602
62 590
63 1003
63 1687
63 1894
79 3545
83 231
87 2460
88 1290
95 186
95 3993
99 3284
99 4098
101 1454
101 3122
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

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

input:

7
4240

output:

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

input:

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

output:

8
5000 2500
10 988
12 2603
18 771
22 130
22 154
24 158
24 249
24 3408
32 616
33 2294
43 359
43 606
43 1447
43 2042
51 4172
57 353
58 948
62 245
63 1003
63 1687
63 1894
72 2124
83 231
87 4029
91 281
94 143
94 2293
95 186
95 3993
97 207
97 1348
99 211
99 3284
99 4098
101 1454
101 1987
101 3122
109 193...

input:

8
5000 2500
10 988
12 2603
18 771
22 130
22 154
24 158
24 249
24 3408
32 616
33 2294
43 359
43 606
43 1447
43 2042
51 4172
57 353
58 948
62 245
63 1003
63 1687
63 1894
72 2124
83 231
87 4029
91 281
94 143
94 2293
95 186
95 3993
97 207
97 1348
99 211
99 3284
99 4098
101 1454
101 1987
101 3122
109 193...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

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

input:

7
1291

output:

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

input:

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

output:

8
5000 2500
8 1708
22 130
22 154
24 249
24 771
24 3408
25 441
25 1998
25 2931
27 126
27 2697
28 785
31 2823
32 46
39 302
43 606
43 1447
44 162
44 1112
44 1911
57 3192
59 3922
60 2099
62 590
63 248
63 321
63 1003
63 1687
63 1894
71 1187
79 3545
83 231
88 1290
89 363
89 443
89 4170
95 186
95 3993
99 3...

input:

8
5000 2500
8 1708
22 130
22 154
24 249
24 771
24 3408
25 441
25 1998
25 2931
27 126
27 2697
28 785
31 2823
32 46
39 302
43 606
43 1447
44 162
44 1112
44 1911
57 3192
59 3922
60 2099
62 590
63 248
63 321
63 1003
63 1687
63 1894
71 1187
79 3545
83 231
88 1290
89 363
89 443
89 4170
95 186
95 3993
99 3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

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

input:

1
17476204

output:

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

input:

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

output:

2
5000 2690
1 2
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
2 3
2 3524
3 119
3 2044
3 4412
3 4566
6 7
6 11
6 19
6 563
6 1365
6 2099
6 2273
6 2880
8 135
9 24
9 93
9 812
10 809
11 25
11 35
11 42
11 74
11 520
13 16
13 43
13 1919
14 71
14 296
14 2706
14 4948
15 4080
16 20
16 21
16 26
16 45
16 72
16 59...

input:

2
5000 2690
1 2
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
2 3
2 3524
3 119
3 2044
3 4412
3 4566
6 7
6 11
6 19
6 563
6 1365
6 2099
6 2273
6 2880
8 135
9 24
9 93
9 812
10 809
11 25
11 35
11 42
11 74
11 520
13 16
13 43
13 1919
14 71
14 296
14 2706
14 4948
15 4080
16 20
16 21
16 26
16 45
16 72
16 59...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

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

input:

1
11926600

output:

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

input:

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

output:

2
5000 2690
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
1 3808
2 3524
3 119
3 2044
3 4257
5 11
6 7
6 19
6 563
6 1365
6 2099
6 2273
6 2880
8 135
8 860
8 4083
9 93
9 812
9 1306
10 602
11 25
11 35
11 42
11 74
11 520
11 1711
12 24
12 61
13 16
13 1919
14 71
14 2706
15 4080
16 20
16 21
16 26
16 ...

input:

2
5000 2690
1 2
1 3
1 4
1 5
1 6
1 9
1 13
1 178
1 513
1 521
1 1430
1 3808
2 3524
3 119
3 2044
3 4257
5 11
6 7
6 19
6 563
6 1365
6 2099
6 2273
6 2880
8 135
8 860
8 4083
9 93
9 812
9 1306
10 602
11 25
11 35
11 42
11 74
11 520
11 1711
12 24
12 61
13 16
13 1919
14 71
14 2706
15 4080
16 20
16 21
16 26
16 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

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

input:

1
16602378

output:

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

input:

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

output:

2
5000 2690
1 2
1 4
1 5
1 6
1 13
1 178
1 513
1 521
1 1430
1 3808
2 3
3 146
3 4257
4 9
5 11
6 7
6 19
6 563
6 1365
6 2099
6 2273
6 2880
6 3187
7 50
8 135
8 259
8 860
8 1708
8 4083
9 93
9 812
9 1306
10 602
10 809
11 16
11 25
11 35
11 42
11 74
11 520
11 1711
12 24
12 61
14 37
14 71
14 2706
16 20
16 21
1...

input:

2
5000 2690
1 2
1 4
1 5
1 6
1 13
1 178
1 513
1 521
1 1430
1 3808
2 3
3 146
3 4257
4 9
5 11
6 7
6 19
6 563
6 1365
6 2099
6 2273
6 2880
6 3187
7 50
8 135
8 259
8 860
8 1708
8 4083
9 93
9 812
9 1306
10 602
10 809
11 16
11 25
11 35
11 42
11 74
11 520
11 1711
12 24
12 61
14 37
14 71
14 2706
16 20
16 21
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

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

input:

3
13129243

output:

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

input:

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

output:

4
5000 2500
1 2
1 4
1 5
1 6
1 8
1 13
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
3 4257
3 4412
5 3990
10 602
10 809
18 192
19 183
19 2743
21 413
31 2823
33 2294
46 1027
48 319
51 1034
51 1592
54 1110
55 1841
56 1862
58 364
59 3922
60 2099
61 1986
61 3602
62 86
62 590
65 155
65 115...

input:

4
5000 2500
1 2
1 4
1 5
1 6
1 8
1 13
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
3 4257
3 4412
5 3990
10 602
10 809
18 192
19 183
19 2743
21 413
31 2823
33 2294
46 1027
48 319
51 1034
51 1592
54 1110
55 1841
56 1862
58 364
59 3922
60 2099
61 1986
61 3602
62 86
62 590
65 155
65 115...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

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

input:

3
7892141

output:

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

input:

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

output:

4
5000 2500
5 3990
13 16
15 4080
16 20
16 21
16 26
16 29
16 31
16 45
16 58
16 72
16 181
16 546
16 596
16 726
16 892
16 2786
16 3701
16 4824
18 771
21 413
21 4969
29 287
29 2627
31 2823
32 46
32 3566
33 1533
44 1112
44 1194
48 241
48 319
51 4172
54 1110
56 707
68 894
68 1626
77 640
83 1082
91 4237
92...

input:

4
5000 2500
5 3990
13 16
15 4080
16 20
16 21
16 26
16 29
16 31
16 45
16 58
16 72
16 181
16 546
16 596
16 726
16 892
16 2786
16 3701
16 4824
18 771
21 413
21 4969
29 287
29 2627
31 2823
32 46
32 3566
33 1533
44 1112
44 1194
48 241
48 319
51 4172
54 1110
56 707
68 894
68 1626
77 640
83 1082
91 4237
92...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

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

input:

3
21314775

output:

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

input:

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

output:

4
5000 2500
1 2
1 3
1 4
1 5
1 6
1 13
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
5 3990
12 2603
18 771
19 183
19 1173
21 141
21 4969
31 2823
33 2294
44 162
44 1112
45 2974
46 1027
51 1034
51 4172
54 1110
54 2580
55 1841
57 353
57 1277
58 948
59 3922
60 2099
61 214
62 245
62 590
65...

input:

4
5000 2500
1 2
1 3
1 4
1 5
1 6
1 13
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
5 3990
12 2603
18 771
19 183
19 1173
21 141
21 4969
31 2823
33 2294
44 162
44 1112
45 2974
46 1027
51 1034
51 4172
54 1110
54 2580
55 1841
57 353
57 1277
58 948
59 3922
60 2099
61 214
62 245
62 590
65...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

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

input:

5
5559540

output:

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

input:

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

output:

6
5000 2508
1 6
2 56
2 672
2 3524
3 75
3 4566
4 9
4 421
5 29
5 3990
6 7
6 19
6 82
6 232
6 563
6 1128
6 1365
6 2099
6 2880
6 3187
8 259
8 274
8 860
8 1115
10 28
10 602
10 988
11 16
12 24
12 2603
13 43
14 15
14 71
14 76
14 83
14 115
14 139
14 229
14 1325
14 1698
14 2706
16 21
16 26
16 31
16 45
16 58
1...

input:

6
5000 2508
1 6
2 56
2 672
2 3524
3 75
3 4566
4 9
4 421
5 29
5 3990
6 7
6 19
6 82
6 232
6 563
6 1128
6 1365
6 2099
6 2880
6 3187
8 259
8 274
8 860
8 1115
10 28
10 602
10 988
11 16
12 24
12 2603
13 43
14 15
14 71
14 76
14 83
14 115
14 139
14 229
14 1325
14 1698
14 2706
16 21
16 26
16 31
16 45
16 58
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

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

input:

5
9424319

output:

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

input:

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

output:

6
5000 2500
1 6
2 3
2 56
2 672
2 1079
2 2807
4 421
4 1013
5 29
6 7
6 19
6 82
6 232
6 563
6 1128
6 1365
6 2880
6 3187
8 135
8 274
8 860
8 1708
9 10
9 12
9 14
9 36
9 93
9 104
9 127
9 136
9 431
9 449
9 1306
11 16
13 43
15 17
15 4080
16 20
16 21
16 45
16 58
16 72
16 181
16 546
16 596
16 726
16 2786
16 4...

input:

6
5000 2500
1 6
2 3
2 56
2 672
2 1079
2 2807
4 421
4 1013
5 29
6 7
6 19
6 82
6 232
6 563
6 1128
6 1365
6 2880
6 3187
8 135
8 274
8 860
8 1708
9 10
9 12
9 14
9 36
9 93
9 104
9 127
9 136
9 431
9 449
9 1306
11 16
13 43
15 17
15 4080
16 20
16 21
16 45
16 58
16 72
16 181
16 546
16 596
16 726
16 2786
16 4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

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

input:

5
10955780

output:

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

input:

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

output:

6
5000 2500
1 2
1 3
1 4
1 5
1 6
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
7 8
9 10
11 23
11 25
11 35
11 42
11 74
11 492
11 520
11 615
11 1711
11 3274
12 61
14 15
14 28
14 37
14 71
14 76
14 83
14 115
14 139
14 229
14 296
14 1325
14 1698
14 2706
14 4948
16 20
16 21
16 26...

input:

6
5000 2500
1 2
1 3
1 4
1 5
1 6
1 13
1 46
1 178
1 318
1 374
1 513
1 521
1 769
1 979
1 1041
1 1430
1 3808
7 8
9 10
11 23
11 25
11 35
11 42
11 74
11 492
11 520
11 615
11 1711
11 3274
12 61
14 15
14 28
14 37
14 71
14 76
14 83
14 115
14 139
14 229
14 296
14 1325
14 1698
14 2706
14 4948
16 20
16 21
16 26...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

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

input:

7
19938721

output:

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

input:

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

output:

8
5000 2500
2 2807
3 2044
8 1708
8 4083
13 1919
18 771
19 183
19 2295
21 141
22 154
24 249
24 3408
29 2627
31 2823
32 46
33 1533
43 1447
43 2042
44 1911
45 2974
45 3167
48 319
51 4172
56 707
57 1277
57 3192
58 948
58 1276
62 245
63 1003
65 77
65 2249
69 4302
79 81
83 1082
87 213
87 4029
91 281
95 39...

input:

8
5000 2500
2 2807
3 2044
8 1708
8 4083
13 1919
18 771
19 183
19 2295
21 141
22 154
24 249
24 3408
29 2627
31 2823
32 46
33 1533
43 1447
43 2042
44 1911
45 2974
45 3167
48 319
51 4172
56 707
57 1277
57 3192
58 948
58 1276
62 245
63 1003
65 77
65 2249
69 4302
79 81
83 1082
87 213
87 4029
91 281
95 39...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

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

input:

7
5129508

output:

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

input:

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

output:

8
5000 2500
3 4566
5 3990
8 860
8 1708
19 2295
21 413
21 4969
22 51
22 130
24 249
24 771
24 3408
28 33
28 561
28 785
29 287
31 2823
32 3566
43 359
43 1447
43 2042
44 1112
45 3167
57 3192
58 364
59 206
61 1986
61 2310
63 248
63 1003
63 1687
63 1894
83 231
83 302
87 877
90 1760
91 4237
92 2258
92 4319...

input:

8
5000 2500
3 4566
5 3990
8 860
8 1708
19 2295
21 413
21 4969
22 51
22 130
24 249
24 771
24 3408
28 33
28 561
28 785
29 287
31 2823
32 3566
43 359
43 1447
43 2042
44 1112
45 3167
57 3192
58 364
59 206
61 1986
61 2310
63 248
63 1003
63 1687
63 1894
83 231
83 302
87 877
90 1760
91 4237
92 2258
92 4319...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

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

input:

7
15332941

output:

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

input:

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

output:

8
5000 2500
3 803
3 4257
3 4566
5 3990
18 192
21 413
21 4969
22 51
22 130
29 287
31 2823
32 46
32 1783
32 3566
43 1447
43 2042
44 1112
44 1194
44 1941
48 3887
54 1110
54 2580
56 1862
57 346
57 395
57 1277
58 364
60 1612
61 1986
63 1687
63 1894
65 155
65 1151
65 2249
68 894
77 640
79 3545
85 2862
85 ...

input:

8
5000 2500
3 803
3 4257
3 4566
5 3990
18 192
21 413
21 4969
22 51
22 130
29 287
31 2823
32 46
32 1783
32 3566
43 1447
43 2042
44 1112
44 1194
44 1941
48 3887
54 1110
54 2580
56 1862
57 346
57 395
57 1277
58 364
60 1612
61 1986
63 1687
63 1894
65 155
65 1151
65 2249
68 894
77 640
79 3545
85 2862
85 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1936kb,1848kb

input:

1
355365355024496523

output:

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

input:

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

output:

2
5000 2690
1 2
1 3
1 4
1 5
1 9
1 3808
2 13
3 59
3 146
3 291
3 3078
3 4257
3 4412
4 47
4 67
5 6
5 7
5 11
6 19
6 563
6 1365
6 2273
7 50
7 71
7 116
7 574
8 18
8 135
8 600
8 1708
8 4083
9 24
9 93
10 51
10 178
10 602
11 25
11 35
11 42
11 74
11 520
11 1711
12 27
12 61
12 176
12 2603
13 16
13 20
13 72
13 ...

input:

2
5000 2690
1 2
1 3
1 4
1 5
1 9
1 3808
2 13
3 59
3 146
3 291
3 3078
3 4257
3 4412
4 47
4 67
5 6
5 7
5 11
6 19
6 563
6 1365
6 2273
7 50
7 71
7 116
7 574
8 18
8 135
8 600
8 1708
8 4083
9 24
9 93
10 51
10 178
10 602
11 25
11 35
11 42
11 74
11 520
11 1711
12 27
12 61
12 176
12 2603
13 16
13 20
13 72
13 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1476376555