QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#601291#8726. Magic Showxwh_Marvelous35 1ms1956kbC++141.6kb2024-09-29 22:07:372024-09-29 22:07:37

Judging History

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

  • [2024-09-29 22:07:37]
  • 评测
  • 测评结果:35
  • 用时:1ms
  • 内存:1956kb
  • [2024-09-29 22:07:37]
  • 提交

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(156168);
int p[N];
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;
	for(int i=1;i<=5000;i++)p[i]=i;
	for(int i=5000;i>1;i--)swap(p[i],p[rd()%i+1]);
}
std::vector<std::pair<int, int>> Alice(){
	long long x=setN(5000);
	gen();
	op.push_back({p[1],p[2]});
	ls[0].push_back(1),ls[1].push_back(2);
	for(int i=3;i<=n;i++){
		op.push_back({p[ls[(x>>a[i])&1][rd()%ls[(x>>a[i])&1].size()]],p[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(156168);
int p[N],q[N];
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;
	for(int i=1;i<=5000;i++)p[i]=i;
	for(int i=5000;i>1;i--)swap(p[i],p[rd()%i+1]);
	for(int i=1;i<=5000;i++)q[p[i]]=i;
}
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;
		u=q[u],v=q[v];
		if(u>v)swap(u,v);
		if(u==1&&v==2)continue;
		ans|=(b[u]<<a[v]);
	}
	return ans;
}

详细

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

2
5000 3009
1 3665
2 4342
3 4338
5 3768
5 4500
6 3653
7 1370
7 2023
7 2280
8 3629
10 3151
11 187
11 658
11 1252
11 1679
11 2292
11 2980
11 3582
12 727
18 3510
19 2509
20 2015
21 196
21 2898
22 3830
25 3990
26 2980
27 99
27 1531
28 2744
29 640
29 3111
29 3693
29 3944
30 1751
31 1021
34 3433
36 347
38...

input:

2
5000 3009
1 3665
2 4342
3 4338
5 3768
5 4500
6 3653
7 1370
7 2023
7 2280
8 3629
10 3151
11 187
11 658
11 1252
11 1679
11 2292
11 2980
11 3582
12 727
18 3510
19 2509
20 2015
21 196
21 2898
22 3830
25 3990
26 2980
27 99
27 1531
28 2744
29 640
29 3111
29 3693
29 3944
30 1751
31 1021
34 3433
36 347
38...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1952kb,1900kb

input:

1
459

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

output:

2
5000 3009
1 3665
2 1900
3 4338
5 3768
5 4500
6 3653
7 1370
7 2023
7 2280
8 922
8 3629
10 3151
11 187
11 658
11 1252
11 1348
11 1679
11 2292
11 2980
11 3582
12 727
18 3510
19 1692
19 2509
20 2015
21 196
22 3830
25 3990
26 2980
27 99
27 1531
28 2744
29 640
29 3111
29 3693
29 3944
31 1021
34 3433
36 ...

input:

2
5000 3009
1 3665
2 1900
3 4338
5 3768
5 4500
6 3653
7 1370
7 2023
7 2280
8 922
8 3629
10 3151
11 187
11 658
11 1252
11 1348
11 1679
11 2292
11 2980
11 3582
12 727
18 3510
19 1692
19 2509
20 2015
21 196
22 3830
25 3990
26 2980
27 99
27 1531
28 2744
29 640
29 3111
29 3693
29 3944
31 1021
34 3433
36 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

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

input:

1
2495

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

2
5000 3009
1 3665
2 4342
3 4338
5 3768
5 4500
6 3653
7 1370
7 2023
7 2280
8 922
8 3629
10 3151
11 187
11 658
11 1252
11 1679
11 2292
11 2980
11 3582
12 727
18 3510
19 2509
20 2015
21 196
21 2898
22 3830
25 3990
26 2980
27 99
27 1531
28 2744
29 640
29 3111
29 3693
29 3944
30 1751
31 1021
34 3433
36 ...

input:

2
5000 3009
1 3665
2 4342
3 4338
5 3768
5 4500
6 3653
7 1370
7 2023
7 2280
8 922
8 3629
10 3151
11 187
11 658
11 1252
11 1679
11 2292
11 2980
11 3582
12 727
18 3510
19 2509
20 2015
21 196
21 2898
22 3830
25 3990
26 2980
27 99
27 1531
28 2744
29 640
29 3111
29 3693
29 3944
30 1751
31 1021
34 3433
36 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

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

input:

3
1560

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

4
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
5 4500
6 3653
7 2023
7 2280
8 922
8 3629
10 1351
10 3151
13 4113
14 2383
15 3603
16 2180
17 1449
19 1692
19 2509
19 3438
20 2015
22 4987
24 3935
25 2621
25 3174
25 3990
25 4788
28 1567
28 2744
29 640
29 3111
29 3944
30 4797
32 3121
33 1139
3...

input:

4
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
5 4500
6 3653
7 2023
7 2280
8 922
8 3629
10 1351
10 3151
13 4113
14 2383
15 3603
16 2180
17 1449
19 1692
19 2509
19 3438
20 2015
22 4987
24 3935
25 2621
25 3174
25 3990
25 4788
28 1567
28 2744
29 640
29 3111
29 3944
30 4797
32 3121
33 1139
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

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

input:

3
3594

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

4
5000 2500
1 3665
2 834
3 4338
5 1007
5 2086
5 3768
6 3653
7 2023
7 2280
8 922
8 3629
10 1351
10 3151
13 4113
14 2383
15 3603
16 2180
17 1449
19 1692
19 2509
19 3438
20 2015
21 2898
22 4987
24 3935
25 2621
25 3174
25 3990
25 4788
28 1567
28 2744
29 640
29 3111
29 3944
30 4797
31 614
32 3121
33 1139...

input:

4
5000 2500
1 3665
2 834
3 4338
5 1007
5 2086
5 3768
6 3653
7 2023
7 2280
8 922
8 3629
10 1351
10 3151
13 4113
14 2383
15 3603
16 2180
17 1449
19 1692
19 2509
19 3438
20 2015
21 2898
22 4987
24 3935
25 2621
25 3174
25 3990
25 4788
28 1567
28 2744
29 640
29 3111
29 3944
30 4797
31 614
32 3121
33 1139...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

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

input:

3
1750

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

output:

4
5000 2500
1 3665
2 834
2 4342
3 4338
6 3653
8 3629
10 1351
10 3151
14 2383
15 3603
16 2180
17 1449
19 1692
19 2509
20 2015
22 4987
24 3935
27 99
28 1567
28 2744
30 4797
31 1021
32 3121
33 1139
34 3433
34 4702
35 2102
36 347
36 649
37 320
37 3426
38 2286
40 1667
40 3003
40 3219
41 3623
42 135
43 45...

input:

4
5000 2500
1 3665
2 834
2 4342
3 4338
6 3653
8 3629
10 1351
10 3151
14 2383
15 3603
16 2180
17 1449
19 1692
19 2509
20 2015
22 4987
24 3935
27 99
28 1567
28 2744
30 4797
31 1021
32 3121
33 1139
34 3433
34 4702
35 2102
36 347
36 649
37 320
37 3426
38 2286
40 1667
40 3003
40 3219
41 3623
42 135
43 45...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

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

input:

5
4878

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

6
5000 2520
1 3665
2 4342
3 4338
4 221
5 4500
7 283
7 2023
7 2280
8 3629
9 1157
10 3151
11 2292
12 727
13 4113
14 2383
15 3603
17 1449
19 1692
19 3438
20 2015
22 3830
25 4788
26 2980
28 1567
29 640
30 4797
31 614
32 2731
34 3433
36 1510
37 3426
38 2286
40 1667
40 3003
42 135
44 981
45 4237
50 1299
5...

input:

6
5000 2520
1 3665
2 4342
3 4338
4 221
5 4500
7 283
7 2023
7 2280
8 3629
9 1157
10 3151
11 2292
12 727
13 4113
14 2383
15 3603
17 1449
19 1692
19 3438
20 2015
22 3830
25 4788
26 2980
28 1567
29 640
30 4797
31 614
32 2731
34 3433
36 1510
37 3426
38 2286
40 1667
40 3003
42 135
44 981
45 4237
50 1299
5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1952kb,1884kb

input:

5
1223

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

output:

6
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 1370
9 1347
10 1351
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 2750
16 2180
17 1449
18 3510
19 2509
21 196
22 4987
24 1464
25 2621
25 3174
25 3990
25 4871
27 1531
28 2744
29 640
30 2571
31 1021
...

input:

6
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 1370
9 1347
10 1351
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 2750
16 2180
17 1449
18 3510
19 2509
21 196
22 4987
24 1464
25 2621
25 3174
25 3990
25 4871
27 1531
28 2744
29 640
30 2571
31 1021
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

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

input:

5
648

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

6
5000 2506
2 1900
3 4338
5 1007
5 2086
5 3768
7 1370
8 922
9 1347
10 2340
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 4113
16 2180
17 1449
18 3510
19 2509
21 196
23 2773
24 3935
25 2621
25 3174
25 3990
27 1531
28 2744
29 3111
29 3693
29 3944
31 1021
32 3121
33 1...

input:

6
5000 2506
2 1900
3 4338
5 1007
5 2086
5 3768
7 1370
8 922
9 1347
10 2340
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 4113
16 2180
17 1449
18 3510
19 2509
21 196
23 2773
24 3935
25 2621
25 3174
25 3990
27 1531
28 2744
29 3111
29 3693
29 3944
31 1021
32 3121
33 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1952kb,1884kb

input:

7
4475

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

output:

8
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 922
9 1157
12 727
13 4113
14 2383
15 3603
16 2180
17 1449
19 3438
20 2015
21 196
24 1464
25 2621
25 3174
28 1567
28 2744
29 3944
30 1751
31 614
32 2731
32 3121
33 1139
34 3433
34 4702
35 2102
36 649
36 3065
37 3426
38 2286
40...

input:

8
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 922
9 1157
12 727
13 4113
14 2383
15 3603
16 2180
17 1449
19 3438
20 2015
21 196
24 1464
25 2621
25 3174
28 1567
28 2744
29 3944
30 1751
31 614
32 2731
32 3121
33 1139
34 3433
34 4702
35 2102
36 649
36 3065
37 3426
38 2286
40...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

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

input:

7
4240

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

8
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 3629
9 1157
12 727
14 2383
15 3603
16 2180
17 1449
20 2015
21 196
24 3935
25 2621
25 3174
25 4871
27 99
28 2744
29 3944
30 4797
31 1021
32 2731
33 1139
34 3433
35 2102
36 649
37 3426
38 2286
40 1667
40 3003
41 547
42 2844
43 ...

input:

8
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 3629
9 1157
12 727
14 2383
15 3603
16 2180
17 1449
20 2015
21 196
24 3935
25 2621
25 3174
25 4871
27 99
28 2744
29 3944
30 4797
31 1021
32 2731
33 1139
34 3433
35 2102
36 649
37 3426
38 2286
40 1667
40 3003
41 547
42 2844
43 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

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

input:

7
1291

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

8
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 922
12 727
13 4113
14 2383
15 3603
16 2180
17 1449
19 3438
20 2015
21 196
22 4987
24 1464
25 2621
25 3174
28 2744
29 3944
30 2571
31 614
32 3121
33 1139
34 3433
35 2102
36 649
36 3065
37 3426
38 2286
39 3397
40 1667
40 3003
4...

input:

8
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 922
12 727
13 4113
14 2383
15 3603
16 2180
17 1449
19 3438
20 2015
21 196
22 4987
24 1464
25 2621
25 3174
28 2744
29 3944
30 2571
31 614
32 3121
33 1139
34 3433
35 2102
36 649
36 3065
37 3426
38 2286
39 3397
40 1667
40 3003
4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

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

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
3892 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
3892 3906
4475 4676
...

output:

2
5000 4463
1 3665
2 4342
3 4338
4 221
5 2086
5 3768
5 4500
6 3653
7 283
7 2023
8 922
8 3629
10 2340
10 3151
11 187
11 658
11 1252
11 2614
11 2980
11 3582
11 3830
11 4953
13 4113
14 2383
15 3603
16 1519
17 1449
18 3510
19 2509
19 3438
20 1895
20 2015
21 196
21 2898
22 3830
23 2773
24 3935
25 3174
25...

input:

2
5000 4463
1 3665
2 4342
3 4338
4 221
5 2086
5 3768
5 4500
6 3653
7 283
7 2023
8 922
8 3629
10 2340
10 3151
11 187
11 658
11 1252
11 2614
11 2980
11 3582
11 3830
11 4953
13 4113
14 2383
15 3603
16 1519
17 1449
18 3510
19 2509
19 3438
20 1895
20 2015
21 196
21 2898
22 3830
23 2773
24 3935
25 3174
25...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

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

input:

1
11926600

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

output:

2
5000 4463
1 972
2 834
2 1900
3 4338
4 221
5 2086
5 3768
5 4500
6 3653
7 283
7 2023
8 922
8 3629
9 1157
10 1351
10 3151
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 959
13 4113
14 2383
15 3603
16 2180
17 1449
18 3510
19 1692
19 2509
19 3438
20 1895
20 2015
21 196...

input:

2
5000 4463
1 972
2 834
2 1900
3 4338
4 221
5 2086
5 3768
5 4500
6 3653
7 283
7 2023
8 922
8 3629
9 1157
10 1351
10 3151
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 959
13 4113
14 2383
15 3603
16 2180
17 1449
18 3510
19 1692
19 2509
19 3438
20 1895
20 2015
21 196...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

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

input:

1
16602378

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

2
5000 4463
1 972
2 834
2 1900
3 4338
4 221
5 2086
5 3768
5 4500
6 3653
7 283
7 2023
8 922
8 3629
9 1157
10 1351
10 3151
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 959
13 4113
14 2383
15 3603
16 2180
17 1449
18 3510
19 1692
19 2509
19 3438
20 2015
21 196
21 1121...

input:

2
5000 4463
1 972
2 834
2 1900
3 4338
4 221
5 2086
5 3768
5 4500
6 3653
7 283
7 2023
8 922
8 3629
9 1157
10 1351
10 3151
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 959
13 4113
14 2383
15 3603
16 2180
17 1449
18 3510
19 1692
19 2509
19 3438
20 2015
21 196
21 1121...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

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

input:

3
13129243

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

4
5000 2500
1 3665
2 834
3 4338
6 3653
8 922
8 3629
9 1157
10 1351
10 3151
13 4113
14 2383
15 3603
16 2180
17 1449
19 1692
19 2509
19 3438
20 2015
22 4987
24 1464
25 3174
25 3990
28 1567
28 2744
30 355
30 2571
32 2731
32 3121
33 1139
34 3433
34 4702
35 2102
37 320
37 3426
38 2286
39 2644
40 1667
40 ...

input:

4
5000 2500
1 3665
2 834
3 4338
6 3653
8 922
8 3629
9 1157
10 1351
10 3151
13 4113
14 2383
15 3603
16 2180
17 1449
19 1692
19 2509
19 3438
20 2015
22 4987
24 1464
25 3174
25 3990
28 1567
28 2744
30 355
30 2571
32 2731
32 3121
33 1139
34 3433
34 4702
35 2102
37 320
37 3426
38 2286
39 2644
40 1667
40 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

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

input:

3
7892141

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

4
5000 2500
1 972
2 834
2 4342
3 4338
6 3653
8 922
8 3629
10 3151
13 4113
14 2383
15 3603
16 2180
17 1449
19 2509
20 2015
21 2898
22 4987
24 1464
25 3174
25 4788
27 99
28 1567
28 2744
30 355
30 1751
30 2571
31 614
31 1021
32 3121
33 1139
34 3433
34 4702
35 2102
36 347
36 649
37 320
37 3426
38 3495
3...

input:

4
5000 2500
1 972
2 834
2 4342
3 4338
6 3653
8 922
8 3629
10 3151
13 4113
14 2383
15 3603
16 2180
17 1449
19 2509
20 2015
21 2898
22 4987
24 1464
25 3174
25 4788
27 99
28 1567
28 2744
30 355
30 1751
30 2571
31 614
31 1021
32 3121
33 1139
34 3433
34 4702
35 2102
36 347
36 649
37 320
37 3426
38 3495
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

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

input:

3
21314775

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

output:

4
5000 2500
1 3665
2 4342
3 4338
6 3653
8 3629
9 1157
10 1351
10 3151
13 959
14 2383
15 3603
16 1519
17 1449
19 1692
19 2509
21 1121
21 2898
22 4987
24 1464
27 99
28 1567
28 2744
29 640
29 3111
31 614
31 1021
32 2731
32 3121
33 1139
34 3433
34 4702
35 2102
36 347
36 649
37 320
37 3426
38 3495
40 166...

input:

4
5000 2500
1 3665
2 4342
3 4338
6 3653
8 3629
9 1157
10 1351
10 3151
13 959
14 2383
15 3603
16 1519
17 1449
19 1692
19 2509
21 1121
21 2898
22 4987
24 1464
27 99
28 1567
28 2744
29 640
29 3111
31 614
31 1021
32 2731
32 3121
33 1139
34 3433
34 4702
35 2102
36 347
36 649
37 320
37 3426
38 3495
40 166...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

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

input:

5
5559540

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

output:

6
5000 2511
1 3665
2 834
4 221
5 1007
5 2086
5 3768
7 1370
8 3629
9 1347
10 1351
11 187
11 658
11 1252
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 2750
16 2180
19 2509
20 1895
21 196
22 4987
23 2773
24 3935
25 3539
27 99
28 2744
29 640
30 355
30 1751
31 614
32 2731
34 4702
35 2102
36 347
36 6...

input:

6
5000 2511
1 3665
2 834
4 221
5 1007
5 2086
5 3768
7 1370
8 3629
9 1347
10 1351
11 187
11 658
11 1252
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 2750
16 2180
19 2509
20 1895
21 196
22 4987
23 2773
24 3935
25 3539
27 99
28 2744
29 640
30 355
30 1751
31 614
32 2731
34 4702
35 2102
36 347
36 6...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

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

input:

5
9424319

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
3892 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
3892 3906
4475 4676...

output:

6
5000 2545
1 3665
2 834
3 4338
5 1007
5 2086
5 3768
6 3653
7 283
7 2023
7 2280
8 922
10 3151
11 187
11 658
11 1252
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 959
16 2180
17 1449
18 3510
19 2509
20 2015
21 196
22 4987
23 2773
24 1464
25 3539
27 99
28 1567
29 3111
29 3693
30 2571
31 1021
33 1...

input:

6
5000 2545
1 3665
2 834
3 4338
5 1007
5 2086
5 3768
6 3653
7 283
7 2023
7 2280
8 922
10 3151
11 187
11 658
11 1252
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 959
16 2180
17 1449
18 3510
19 2509
20 2015
21 196
22 4987
23 2773
24 1464
25 3539
27 99
28 1567
29 3111
29 3693
30 2571
31 1021
33 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

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

input:

5
10955780

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
3892 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
3892 3906
4475 4676...

output:

6
5000 2508
1 972
2 834
3 4338
4 221
5 1007
5 2086
5 3768
7 283
7 2023
7 2280
10 1351
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 2750
16 2180
17 1449
18 3510
19 2509
20 2015
21 196
22 4987
25 3539
27 1531
28 2744
29 640
32 3121
34 4702
35 2102
36 347
36 649
36 3...

input:

6
5000 2508
1 972
2 834
3 4338
4 221
5 1007
5 2086
5 3768
7 283
7 2023
7 2280
10 1351
11 187
11 658
11 1252
11 1348
11 1679
11 2614
11 2980
11 3582
11 3830
11 4953
13 2750
16 2180
17 1449
18 3510
19 2509
20 2015
21 196
22 4987
25 3539
27 1531
28 2744
29 640
32 3121
34 4702
35 2102
36 347
36 649
36 3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

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

input:

7
19938721

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676...

output:

8
5000 2500
1 972
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 3629
9 1157
10 3151
14 2383
15 3603
16 1519
17 1449
19 2509
20 2015
22 4987
24 1464
25 2621
25 3174
25 4871
27 99
28 1567
28 2744
29 3944
30 2571
31 614
31 1021
32 2731
32 3121
33 1139
34 3433
34 4702
35 2102
36 649
37 320
37 3426
3...

input:

8
5000 2500
1 972
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 3629
9 1157
10 3151
14 2383
15 3603
16 1519
17 1449
19 2509
20 2015
22 4987
24 1464
25 2621
25 3174
25 4871
27 99
28 1567
28 2744
29 3944
30 2571
31 614
31 1021
32 2731
32 3121
33 1139
34 3433
34 4702
35 2102
36 649
37 320
37 3426
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

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

input:

7
5129508

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
3892 3906
4475 4676...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
1814 788
3799 4475
3799 339
4475 2852
788 3892
3892 3906
4475 4676...

output:

8
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 3629
14 2383
15 3603
16 2180
17 1449
19 3438
20 2015
22 4987
24 3935
25 4871
28 1567
28 2744
29 3111
30 355
30 1751
31 614
32 3121
33 1139
34 3433
35 2102
36 649
36 3065
37 320
37 3426
38 2286
40 1667
40 3003
41 547
42 2844
4...

input:

8
5000 2500
1 3665
2 834
3 4338
4 221
5 1007
5 2086
5 3768
6 3653
7 2023
8 3629
14 2383
15 3603
16 2180
17 1449
19 3438
20 2015
22 4987
24 3935
25 4871
28 1567
28 2744
29 3111
30 355
30 1751
31 614
32 3121
33 1139
34 3433
35 2102
36 649
36 3065
37 320
37 3426
38 2286
40 1667
40 3003
41 547
42 2844
4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

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

input:

7
15332941

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
4017 1528
4017 4716
4017 669
4017 3799
3799 1814
1814 2617
4017 4972
1814 1400
3799 4078
4078 660
669 788
3799 4475
3799 339
4475 2852
788 3892
4475 3906
4475 4676
...

output:

8
5000 2500
1 972
2 834
3 4338
5 1007
5 2086
5 3768
6 3653
7 2023
7 2280
8 922
9 1157
10 1351
12 727
13 959
13 4113
14 2383
15 3603
16 2180
17 1449
19 1692
19 3438
20 1895
20 2015
22 4987
24 1464
25 3174
28 1567
28 2744
29 3111
29 3944
30 355
30 2571
31 614
32 2731
32 3121
33 1139
34 3433
34 4702
35...

input:

8
5000 2500
1 972
2 834
3 4338
5 1007
5 2086
5 3768
6 3653
7 2023
7 2280
8 922
9 1157
10 1351
12 727
13 959
13 4113
14 2383
15 3603
16 2180
17 1449
19 1692
19 3438
20 1895
20 2015
22 4987
24 1464
25 3174
28 1567
28 2744
29 3111
29 3944
30 355
30 2571
31 614
32 2731
32 3121
33 1139
34 3433
34 4702
35...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1952kb,1916kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
1528 4716
1528 669
669 3799
669 1814
669 2617
2617 4972
4972 1400
4716 4078
4078 660
1814 788
669 4475
3799 339
4475 2852
339 3892
3892 3906
3892 4676
401...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
4017 1528
1528 4716
1528 669
669 3799
669 1814
669 2617
2617 4972
4972 1400
4716 4078
4078 660
1814 788
669 4475
3799 339
4475 2852
339 3892
3892 3906
3892 4676
401...

output:

2
5000 4463
1 972
2 1900
3 4338
4 221
5 2086
5 4500
6 4750
8 922
8 3629
9 1157
10 1351
10 3151
11 187
11 658
11 1348
11 2614
11 2980
11 3582
11 3830
12 1383
12 1792
12 1970
13 959
13 4113
13 4192
13 4625
14 4349
15 1325
16 1519
17 1449
18 3510
19 1692
19 3373
20 2015
21 1121
21 1675
22 1890
22 2535
...

input:

2
5000 4463
1 972
2 1900
3 4338
4 221
5 2086
5 4500
6 4750
8 922
8 3629
9 1157
10 1351
10 3151
11 187
11 658
11 1348
11 2614
11 2980
11 3582
11 3830
12 1383
12 1792
12 1970
13 959
13 4113
13 4192
13 4625
14 4349
15 1325
16 1519
17 1449
18 3510
19 1692
19 3373
20 2015
21 1121
21 1675
22 1890
22 2535
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1476376555