QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#529341#6399. Classic: Classical Problemsolar_express#AC ✓197ms10112kbC++141.5kb2024-08-24 12:17:112024-08-24 12:17:11

Judging History

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

  • [2024-08-24 12:17:11]
  • 评测
  • 测评结果:AC
  • 用时:197ms
  • 内存:10112kb
  • [2024-08-24 12:17:11]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,p;
int o[220000];
int pd[220000];
int inv[220000];
int out[220000],otop;
int zan[2200],ztop=0;
int ans;
int power(int a,int b){
	int RE=1;
	while(b>0){
		if(b&1)RE=RE*a%p;
		b>>=1;a=(a*a)%p;
	}
	return RE;
}
void init(){
	ans=0;
	otop=0;
	ztop=0;
	for(int i=0;i<=p;i++){
		pd[i]=0;
	}
	for(int i=1;i<p;i++){
		inv[i]=power(i,p-2);
	}
}
void print(){
	printf("%lld %lld\n",otop,ans);
	for(int i=1;i<=otop;i++){
		printf("%lld ",out[i]);
	}printf("\n");
}
void sol(){
	scanf("%lld%lld",&n,&p);
	init();
	for(int i=1;i<=n;i++){
		scanf("%lld",&o[i]);
		pd[o[i]]=1;
	}
	if(!pd[0]){
		puts("1 1");
		puts("0");
		return ;
	}
	if(n==1&&pd[0]){
		printf("%lld 1\n",p);
		for(int i=0;i<p;i++){
			printf("%lld ",i);
		}
		puts("");
		return ;
	}
	if(p-n<=1000){
		for(int i=0;i<p;i++){
			if(!pd[i])zan[++ztop]=i;
		}
		for(int i=1;i<p;i++){
			int mex=p;
			for(int j=1;j<=ztop;j++){
				mex=min(mex,zan[j]*i%p);
			}
			if(mex>ans){
				ans=mex;
				otop=0;
				out[++otop]=i;
			}
			else if(mex==ans){
				out[++otop]=i;
			}
		}
		print();
		return ;
	}
	else{
		for(int i=1;i<p;i++){
			int mex=1;
			for(int j=1;j<p;j++){
				int x=1ll*j*inv[i]%p;
				if(!pd[x]){
					mex=j;
					break;
				}
			}
			if(mex>ans){
				ans=mex;
				otop=0;
				out[++otop]=i;
			}
			else if(mex==ans){
				out[++otop]=i;
			}
		}
		print();
		return ;
	}
}
signed main(){
	int T;
	cin>>T;
	while(T--){
		sol();
	}
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 8060kb

input:

3
2 3
0 2
3 5
2 3 4
3 5
0 2 3

output:

1 2
2 
1 1
0
2 2
2 3 

result:

ok 6 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 10064kb

input:

3
1 2
0
1 2
1
2 2
1 0

output:

2 1
0 1 
1 1
0
1 2
1 

result:

ok 6 lines

Test #3:

score: 0
Accepted
time: 0ms
memory: 8000kb

input:

7
1 3
0
1 3
1
2 3
1 0
1 3
2
2 3
2 0
2 3
1 2
3 3
0 1 2

output:

3 1
0 1 2 
1 1
0
1 2
1 
1 1
0
1 2
2 
1 1
0
2 3
1 2 

result:

ok 14 lines

Test #4:

score: 0
Accepted
time: 1ms
memory: 7916kb

input:

31
1 5
0
1 5
1
2 5
1 0
1 5
2
2 5
0 2
2 5
2 1
3 5
1 0 2
1 5
3
2 5
0 3
2 5
1 3
3 5
0 1 3
2 5
3 2
3 5
0 2 3
3 5
2 1 3
4 5
2 0 1 3
1 5
4
2 5
4 0
2 5
1 4
3 5
1 4 0
2 5
2 4
3 5
2 4 0
3 5
4 2 1
4 5
1 0 4 2
2 5
4 3
3 5
0 4 3
3 5
3 1 4
4 5
1 4 3 0
3 5
4 3 2
4 5
2 4 0 3
4 5
2 1 4 3
5 5
1 3 0 2 4

output:

5 1
0 1 2 3 4 
1 1
0
1 2
1 
1 1
0
1 2
3 
1 1
0
1 3
1 
1 1
0
1 2
2 
1 1
0
1 3
2 
1 1
0
2 2
2 3 
1 1
0
1 4
1 
1 1
0
1 2
4 
1 1
0
2 2
1 4 
1 1
0
1 3
3 
1 1
0
1 4
3 
1 1
0
1 3
4 
1 1
0
1 4
2 
1 1
0
1 4
4 
1 1
0
4 5
1 2 3 4 

result:

ok 62 lines

Test #5:

score: 0
Accepted
time: 1ms
memory: 7956kb

input:

127
1 7
0
1 7
1
2 7
1 0
1 7
2
2 7
2 0
2 7
2 1
3 7
2 1 0
1 7
3
2 7
3 0
2 7
3 1
3 7
3 1 0
2 7
2 3
3 7
2 0 3
3 7
2 1 3
4 7
2 0 3 1
1 7
4
2 7
0 4
2 7
1 4
3 7
0 1 4
2 7
4 2
3 7
0 4 2
3 7
1 2 4
4 7
2 4 1 0
2 7
4 3
3 7
3 0 4
3 7
3 1 4
4 7
1 0 4 3
3 7
3 2 4
4 7
3 0 2 4
4 7
4 1 3 2
5 7
4 3 0 1 2
1 7
5
2 7
0 ...

output:

7 1
0 1 2 3 4 5 6 
1 1
0
1 2
1 
1 1
0
1 2
4 
1 1
0
1 3
1 
1 1
0
1 2
5 
1 1
0
2 2
1 5 
1 1
0
2 2
4 5 
1 1
0
1 4
1 
1 1
0
1 2
2 
1 1
0
1 3
2 
1 1
0
1 3
4 
1 1
0
3 3
1 2 4 
1 1
0
2 2
2 5 
1 1
0
1 3
2 
1 1
0
1 3
4 
1 1
0
1 5
1 
1 1
0
1 2
3 
1 1
0
2 2
1 3 
1 1
0
2 2
3 4 
1 1
0
1 3
1 
1 1
0
1 3
3 
1 1
0
1...

result:

ok 254 lines

Test #6:

score: 0
Accepted
time: 2ms
memory: 8004kb

input:

2047
1 11
0
1 11
1
2 11
0 1
1 11
2
2 11
0 2
2 11
2 1
3 11
1 0 2
1 11
3
2 11
3 0
2 11
3 1
3 11
0 3 1
2 11
2 3
3 11
0 2 3
3 11
2 1 3
4 11
1 0 3 2
1 11
4
2 11
0 4
2 11
4 1
3 11
1 4 0
2 11
2 4
3 11
2 0 4
3 11
2 1 4
4 11
0 2 1 4
2 11
3 4
3 11
3 4 0
3 11
3 1 4
4 11
4 1 3 0
3 11
4 3 2
4 11
3 4 0 2
4 11
3 1...

output:

11 1
0 1 2 3 4 5 6 7 8 9 10 
1 1
0
1 2
1 
1 1
0
1 2
6 
1 1
0
1 3
1 
1 1
0
1 2
4 
1 1
0
2 2
1 4 
1 1
0
2 2
4 6 
1 1
0
1 4
1 
1 1
0
1 2
3 
1 1
0
2 2
1 3 
1 1
0
1 3
6 
1 1
0
2 3
1 6 
1 1
0
2 2
3 4 
1 1
0
3 2
1 3 4 
1 1
0
1 3
6 
1 1
0
1 5
1 
1 1
0
1 2
9 
1 1
0
2 2
1 9 
1 1
0
2 2
6 9 
1 1
0
1 3
1 
1 1
0
...

result:

ok 4094 lines

Test #7:

score: 0
Accepted
time: 8ms
memory: 7872kb

input:

8191
1 13
0
1 13
1
2 13
0 1
1 13
2
2 13
2 0
2 13
2 1
3 13
2 1 0
1 13
3
2 13
0 3
2 13
1 3
3 13
1 0 3
2 13
2 3
3 13
2 0 3
3 13
3 1 2
4 13
1 3 2 0
1 13
4
2 13
4 0
2 13
4 1
3 13
0 1 4
2 13
2 4
3 13
0 2 4
3 13
2 4 1
4 13
0 1 4 2
2 13
3 4
3 13
3 0 4
3 13
4 1 3
4 13
4 1 0 3
3 13
4 2 3
4 13
3 2 0 4
4 13
3 4...

output:

13 1
0 1 2 3 4 5 6 7 8 9 10 11 12 
1 1
0
1 2
1 
1 1
0
1 2
7 
1 1
0
1 3
1 
1 1
0
1 2
9 
1 1
0
2 2
1 9 
1 1
0
2 2
7 9 
1 1
0
1 4
1 
1 1
0
1 2
10 
1 1
0
2 2
1 10 
1 1
0
1 3
7 
1 1
0
2 3
1 7 
1 1
0
2 2
9 10 
1 1
0
3 2
1 9 10 
1 1
0
1 3
7 
1 1
0
1 5
1 
1 1
0
1 2
8 
1 1
0
2 2
1 8 
1 1
0
2 2
7 8 
1 1
0
1 3...

result:

ok 16382 lines

Test #8:

score: 0
Accepted
time: 14ms
memory: 8000kb

input:

11764
1 17
0
1 17
1
2 17
0 1
1 17
2
2 17
0 2
2 17
2 1
3 17
2 1 0
1 17
3
2 17
3 0
2 17
1 3
3 17
3 0 1
2 17
2 3
3 17
0 3 2
3 17
3 2 1
4 17
3 2 0 1
1 17
4
2 17
0 4
2 17
4 1
3 17
1 4 0
2 17
4 2
3 17
0 2 4
3 17
2 1 4
4 17
2 4 1 0
2 17
3 4
3 17
3 4 0
3 17
4 1 3
4 17
4 1 0 3
3 17
2 4 3
4 17
2 0 3 4
4 17
2 ...

output:

17 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
1 1
0
1 2
1 
1 1
0
1 2
9 
1 1
0
1 3
1 
1 1
0
1 2
6 
1 1
0
2 2
1 6 
1 1
0
2 2
6 9 
1 1
0
1 4
1 
1 1
0
1 2
13 
1 1
0
2 2
1 13 
1 1
0
1 3
9 
1 1
0
2 3
1 9 
1 1
0
2 2
6 13 
1 1
0
3 2
1 6 13 
1 1
0
1 3
9 
1 1
0
1 5
1 
1 1
0
1 2
7 
1 1
0
2 2
1 7 
1 1
0
2 2
7 ...

result:

ok 23528 lines

Test #9:

score: 0
Accepted
time: 14ms
memory: 7936kb

input:

10526
1 19
0
1 19
1
2 19
0 1
1 19
2
2 19
2 0
2 19
2 1
3 19
0 2 1
1 19
3
2 19
0 3
2 19
3 1
3 19
1 0 3
2 19
3 2
3 19
2 0 3
3 19
1 3 2
4 19
1 2 0 3
1 19
4
2 19
0 4
2 19
4 1
3 19
0 1 4
2 19
4 2
3 19
4 0 2
3 19
2 4 1
4 19
4 2 0 1
2 19
4 3
3 19
0 3 4
3 19
1 3 4
4 19
3 4 0 1
3 19
4 3 2
4 19
0 4 3 2
4 19
1 ...

output:

19 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 
1 1
0
1 2
1 
1 1
0
1 2
10 
1 1
0
1 3
1 
1 1
0
1 2
13 
1 1
0
2 2
1 13 
1 1
0
2 2
10 13 
1 1
0
1 4
1 
1 1
0
1 2
5 
1 1
0
2 2
1 5 
1 1
0
1 3
10 
1 1
0
2 3
1 10 
1 1
0
2 2
5 13 
1 1
0
3 2
1 5 13 
1 1
0
1 3
10 
1 1
0
1 5
1 
1 1
0
1 2
4 
1 1
0
2 2
1 4 
...

result:

ok 21052 lines

Test #10:

score: 0
Accepted
time: 27ms
memory: 8064kb

input:

10000
9 83
60 35 63 59 58 81 0 13 71
1 5
0
1 7
0
2 61
39 0
2 7
0 4
1 7
0
2 19
0 14
1 2
0
3 23
14 10 0
3 11
0 5 2
1 5
0
2 7
0 4
2 3
0 2
2 3
0 1
1 13
0
5 47
10 2 34 15 0
1 2
0
1 17
0
1 11
0
2 7
1 0
1 7
0
2 23
0 17
2 13
10 0
2 7
1 0
6 31
19 13 6 29 0 24
4 23
0 5 18 17
2 19
0 5
1 7
0
2 13
7 0
3 17
0 6 1...

output:

2 3
38 76 
5 1
0 1 2 3 4 
7 1
0 1 2 3 4 5 6 
1 2
36 
1 2
2 
7 1
0 1 2 3 4 5 6 
1 2
15 
2 1
0 1 
2 2
5 7 
2 2
6 9 
5 1
0 1 2 3 4 
1 2
2 
1 2
2 
1 2
1 
13 1
0 1 2 3 4 5 6 7 8 9 10 11 12 
4 2
18 22 24 33 
2 1
0 1 
17 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
11 1
0 1 2 3 4 5 6 7 8 9 10 
1 2
1 
7 1
0 ...

result:

ok 20000 lines

Test #11:

score: 0
Accepted
time: 15ms
memory: 10060kb

input:

10000
10 11
6 8 0 1 7 3 2 9 4 5
21 23
21 19 10 17 11 20 6 3 2 18 9 16 13 14 4 12 8 7 1 0 15
7 7
6 2 4 0 1 5 3
17 19
4 6 5 11 17 15 0 10 3 8 12 18 13 7 9 2 14
15 17
11 15 8 2 12 3 1 13 16 6 7 0 9 10 5
2 2
0 1
2 2
0 1
33 37
11 20 9 16 19 32 33 31 3 29 36 10 8 25 22 17 5 6 15 28 14 0 4 27 18 12 34 21 3...

output:

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

result:

ok 20000 lines

Test #12:

score: 0
Accepted
time: 25ms
memory: 8064kb

input:

10000
4 13
4 5 0 6
12 31
0 16 11 13 3 24 26 21 20 6 5 19
12 43
29 21 40 23 31 24 27 17 30 10 0 42
3 3
0 2 1
15 47
41 46 0 44 17 39 30 4 12 14 36 28 27 31 10
1 5
0
5 11
6 2 0 5 1
6 13
11 0 7 5 10 6
5 17
15 0 9 12 11
6 13
0 5 2 12 11 7
15 43
14 28 13 24 40 29 37 9 27 0 34 39 15 12 2
1 3
0
8 17
15 6 0 ...

output:

3 2
8 10 11 
1 6
6 
2 3
33 41 
2 3
1 2 
3 3
31 37 41 
5 1
0 1 2 3 4 
2 3
1 2 
2 3
4 8 
4 2
2 8 10 14 
1 3
12 
1 4
14 
3 1
0 1 2 
1 4
8 
2 1
0 1 
3 2
4 9 10 
4 2
1 3 5 12 
1 2
3 
5 2
3 12 15 16 18 
7 1
0 1 2 3 4 5 6 
5 2
2 5 15 16 18 
10 2
2 6 8 11 19 25 27 29 34 35 
3 2
2 7 9 
1 2
2 
3 3
7 14 15 
2 ...

result:

ok 20000 lines

Test #13:

score: 0
Accepted
time: 23ms
memory: 10044kb

input:

10000
13 19
13 6 0 9 15 2 4 10 3 5 11 12 14
5 11
5 8 10 0 6
2 3
0 1
1 2
0
10 19
6 16 2 1 17 0 4 10 5 7
4 7
0 1 4 2
41 73
55 47 13 35 18 68 3 25 67 36 70 69 62 37 56 64 49 72 12 0 4 17 31 8 66 63 2 16 65 60 24 26 7 21 33 52 54 39 29 53 71
1 3
0
26 61
43 0 37 54 47 49 17 38 19 28 35 18 39 36 33 34 8 2...

output:

1 6
13 
2 3
7 9 
1 2
1 
2 1
0 1 
1 4
10 
3 3
1 2 4 
1 12
72 
3 1
0 1 2 
2 5
10 17 
1 7
11 
1 7
27 
1 4
8 
2 3
1 2 
2 3
1 2 
1 2
1 
1 2
2 
1 6
6 
1 8
31 
1 4
13 
1 3
3 
1 4
12 
3 5
1 2 7 
1 7
5 
1 2
4 
3 1
0 1 2 
2 1
0 1 
2 4
4 6 
1 2
4 
2 2
1 10 
2 4
10 12 
2 4
4 6 
1 2
2 
2 6
3 5 
7 1
0 1 2 3 4 5 6...

result:

ok 20000 lines

Test #14:

score: 0
Accepted
time: 21ms
memory: 8060kb

input:

10000
2 3
0 2
38 61
50 55 35 52 17 40 15 51 39 11 5 41 2 33 49 25 0 24 53 13 30 59 9 34 57 37 38 27 29 1 19 31 46 8 45 58 6 42
11 17
5 13 1 11 2 0 6 7 4 12 10
6 11
3 0 4 7 10 6
21 29
17 14 7 18 20 28 23 25 16 3 22 5 21 2 0 9 13 1 12 11 19
5 5
0 3 2 1 4
20 23
19 16 0 1 15 18 14 12 21 6 22 8 11 13 20 ...

output:

1 2
2 
2 10
15 45 
1 7
3 
1 5
8 
2 8
7 24 
4 5
1 2 3 4 
1 14
20 
1 9
16 
1 6
7 
1 7
29 
1 6
6 
2 2
1 4 
1 6
8 
1 3
4 
2 4
2 3 
1 8
5 
1 7
8 
2 4
1 3 
1 6
3 
1 9
14 
1 6
5 
1 2
1 
2 7
11 22 
1 8
12 
2 5
2 8 
2 6
3 10 
1 7
2 
1 4
2 
1 2
1 
1 4
1 
1 5
11 
1 14
28 
2 3
1 2 
1 2
1 
1 10
8 
1 8
6 
1 6
5 
...

result:

ok 20000 lines

Test #15:

score: 0
Accepted
time: 24ms
memory: 10004kb

input:

10000
17 17
1 5 10 2 16 6 12 13 15 3 8 9 11 4 14 7 0
67 67
34 11 54 25 8 40 33 24 2 44 22 5 28 46 23 59 30 1 38 18 55 15 35 6 39 64 27 51 65 12 52 53 58 20 14 19 29 43 0 9 62 45 41 42 47 49 31 32 26 57 37 48 7 36 17 13 10 50 63 3 16 21 4 61 66 56 60
3 3
1 0 2
3 3
2 0 1
5 5
4 0 2 1 3
13 13
8 1 5 10 4...

output:

16 17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
66 67
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 
2 3
1 2 
2 3
1 2 
4 5
1 2 3 4 
12 13
1 2 3 4 5 6 7 8 9 10 ...

result:

ok 20000 lines

Test #16:

score: 0
Accepted
time: 197ms
memory: 8016kb

input:

1000
2 11
0 1
23 173
145 124 4 130 41 45 115 53 102 156 68 85 49 100 114 75 0 90 81 96 93 61 91
37 293
0 206 166 68 220 15 58 256 125 182 239 67 116 32 114 261 8 106 137 89 130 120 128 202 75 2 110 5 233 133 145 74 259 164 264 10 56
19 181
18 165 71 52 170 177 81 114 124 46 103 20 43 94 144 96 0 125...

output:

1 2
1 
2 3
50 60 
1 4
176 
18 2
27 38 42 44 45 51 52 58 66 80 94 100 122 127 147 148 171 172 
5 2
3 9 13 23 33 
1 3
126 
3 3
101 318 624 
1 3
16 
1 3
60 
8 2
8 10 24 31 32 38 39 44 
1 3
35 
8 2
17 19 24 44 51 59 61 69 
5 3
44 95 108 126 216 
6 3
82 100 284 471 479 501 
2 3
276 298 
5 3
72 181 186 19...

result:

ok 2000 lines

Test #17:

score: 0
Accepted
time: 37ms
memory: 10080kb

input:

1000
451 503
279 78 450 47 182 318 120 215 45 315 292 384 143 122 251 427 230 276 128 314 130 203 146 85 157 312 24 190 316 126 370 271 322 207 465 63 372 99 466 469 211 167 407 180 307 326 458 213 144 217 106 33 414 495 66 421 189 62 417 346 111 232 260 89 366 502 429 86 282 353 161 138 491 183 240...

output:

1 54
73 
1 45
97 
1 60
71 
1 41
53 
1 54
48 
1 50
15 
1 66
362 
1 27
22 
3 34
327 413 476 
1 22
20 
1 72
123 
1 62
137 
1 41
107 
1 40
34 
1 30
104 
1 49
151 
1 33
152 
1 40
6 
1 61
52 
2 3
1 2 
1 60
119 
1 48
288 
1 51
62 
1 12
7 
1 31
23 
1 37
38 
1 39
31 
1 70
79 
1 35
42 
1 43
55 
1 69
3 
1 59
2...

result:

ok 2000 lines

Test #18:

score: 0
Accepted
time: 163ms
memory: 7916kb

input:

1000
205 647
447 128 382 69 202 453 358 585 306 177 471 296 318 183 345 324 457 241 36 558 605 612 148 104 577 84 580 339 5 288 362 409 320 4 131 405 95 165 287 629 448 63 533 377 134 553 611 138 407 463 450 560 581 8 576 178 591 441 142 123 641 504 360 515 567 347 329 172 478 305 483 432 267 311 3 ...

output:

2 7
225 290 
3 7
7 27 54 
1 6
54 
1 4
17 
1 6
202 
1 5
71 
1 3
8 
1 7
98 
2 2
4 14 
4 4
12 36 57 102 
2 5
12 81 
2 4
1 117 
1 7
57 
2 5
30 47 
1 6
86 
9 3
13 19 21 28 34 66 72 87 96 
2 1
0 1 
1 9
114 
3 4
2 13 46 
2 4
16 108 
2 4
55 137 
2 4
12 13 
2 3
5 10 
1 5
3 
1 5
135 
1 6
157 
3 5
278 451 468 ...

result:

ok 2000 lines

Test #19:

score: 0
Accepted
time: 125ms
memory: 9964kb

input:

1000
94 193
184 174 163 185 118 147 125 21 155 93 188 36 112 10 95 101 64 128 179 35 48 43 42 150 108 23 31 104 3 120 2 78 84 53 25 69 116 97 71 0 59 98 83 160 85 90 117 121 61 102 30 191 19 135 56 29 55 173 24 15 47 89 16 161 154 114 124 146 109 144 111 182 14 183 60 74 140 148 157 138 170 115 86 6...

output:

1 12
131 
1 8
38 
1 6
14 
1 9
35 
5 3
5 8 10 25 31 
1 4
3 
1 10
247 
1 10
39 
1 11
495 
2 12
77 252 
1 12
662 
2 3
4 9 
1 10
528 
1 8
76 
1 10
177 
1 10
31 
2 11
159 185 
1 6
1 
1 13
162 
1 7
118 
2 7
98 147 
1 8
59 
1 8
56 
1 12
387 
1 7
3 
1 11
47 
1 8
64 
1 6
18 
4 6
23 38 100 131 
1 9
2 
1 8
21 ...

result:

ok 2000 lines

Test #20:

score: 0
Accepted
time: 75ms
memory: 9920kb

input:

1000
131 199
51 45 85 104 37 139 44 158 116 53 185 29 32 43 173 72 142 149 195 152 112 180 41 64 110 188 182 102 60 87 140 132 70 109 8 76 171 133 198 96 130 46 86 19 192 2 63 124 100 143 159 164 6 161 146 194 127 155 82 184 88 34 118 7 35 99 111 168 186 154 151 147 59 157 160 131 172 163 81 36 119 ...

output:

1 10
53 
1 17
11 
1 17
142 
1 19
40 
1 13
44 
2 8
32 36 
2 15
71 301 
2 17
295 327 
2 10
3 21 
1 19
30 
1 3
2 
1 18
767 
1 19
159 
1 8
7 
1 21
89 
1 14
223 
1 17
219 
1 26
176 
1 12
149 
1 13
24 
1 17
77 
4 4
8 12 13 17 
1 6
2 
1 15
263 
2 3
1 2 
3 13
30 36 45 
1 13
125 
4 15
282 474 554 557 
1 19
9...

result:

ok 2000 lines

Test #21:

score: 0
Accepted
time: 19ms
memory: 8072kb

input:

1000
139 139
44 102 101 91 113 62 65 127 137 18 103 42 53 10 52 87 4 89 78 70 55 132 123 121 83 5 8 29 58 100 71 34 33 106 138 3 110 43 59 117 107 32 82 22 14 30 47 77 73 133 72 97 21 86 6 49 9 90 126 23 19 80 41 85 26 61 75 125 122 105 15 60 88 135 56 46 79 94 63 129 17 98 74 13 16 108 112 96 39 7 ...

output:

138 139
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

result:

ok 2000 lines

Test #22:

score: 0
Accepted
time: 49ms
memory: 8064kb

input:

100
2 491
245 0
25 3413
0 1988 1276 1798 1323 708 3299 287 960 2934 3141 3327 1417 3275 1929 3347 3352 672 506 1711 1249 1874 449 3036 971
8 1019
599 691 470 85 451 976 0 471
1 109
0
12 757
739 335 553 468 348 105 257 477 213 0 151 42
61 5333
1044 5282 971 2923 80 154 4976 326 3659 0 1378 2457 2663 ...

output:

1 2
489 
24 2
57 344 1014 1029 1075 1119 1125 1195 1389 1431 1695 1803 1946 1970 2197 2216 2286 2340 2667 2942 2973 3034 3051 3189 
7 2
12 233 479 761 782 794 871 
109 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46...

result:

ok 200 lines

Test #23:

score: 0
Accepted
time: 59ms
memory: 8124kb

input:

100
278 2833
79 302 1453 2747 2818 2216 1785 1563 2081 1580 958 1791 1307 483 12 921 2781 1634 783 1046 1878 859 1736 1612 2801 1208 2575 2824 1629 585 762 2230 194 2125 2180 2179 2405 1821 1585 453 1383 447 235 2692 1278 506 1948 1571 1666 720 1667 1475 2509 2647 1309 1151 898 977 1313 308 1683 641...

output:

1 4
1682 
3 4
676 1143 1951 
1 6
754 
1 5
1733 
3 4
114 1044 1296 
3 4
412 417 432 
1 4
34 
1 5
964 
10 3
96 267 468 501 543 598 609 666 749 769 
2 4
748 1333 
1 3
114 
2 4
56 477 
1 4
2188 
1 5
919 
13 2
5 19 20 46 47 56 67 83 87 90 95 97 136 
1 5
4775 
4 3
11 22 134 191 
1 5
2161 
4 4
379 3009 473...

result:

ok 200 lines

Test #24:

score: 0
Accepted
time: 197ms
memory: 8012kb

input:

100
2060 2273
767 1795 435 985 57 1932 247 89 939 41 664 2242 2040 814 2013 2271 958 2222 1494 1456 2143 582 184 667 506 2238 1142 2031 1727 1091 493 1429 1145 728 1985 1964 792 992 410 452 545 1187 2052 2117 234 2004 1421 2132 2070 313 1157 748 240 758 1578 1024 2173 1789 1898 1074 1169 1049 765 41...

output:

1 92
1466 
2 58
21 135 
1 70
1178 
1 80
858 
1 57
383 
1 80
1407 
1 69
273 
1 38
53 
1 51
170 
1 91
542 
1 1
0
1 110
815 
1 87
641 
1 80
915 
1 133
1190 
1 38
80 
1 53
51 
1 75
594 
1 61
150 
1 93
4662 
1 95
471 
1 86
286 
1 74
2157 
1 76
1051 
1 63
1096 
1 77
525 
1 99
356 
1 76
1065 
1 59
943 
1 1...

result:

ok 200 lines

Test #25:

score: 0
Accepted
time: 84ms
memory: 8056kb

input:

100
325 1129
292 583 603 223 698 338 1122 10 867 705 652 602 51 140 584 782 1118 487 534 628 819 81 554 40 200 162 955 927 333 456 992 201 1064 310 124 557 94 985 675 515 189 1024 516 884 398 91 407 663 837 556 968 1073 90 281 561 160 259 888 308 102 482 330 855 141 288 787 372 279 480 690 600 179 1...

output:

2 6
770 1017 
1 8
58 
1 7
474 
3 8
917 1661 2053 
2 5
355 557 
1 7
99 
1 7
695 
2 4
14 16 
1 7
1884 
1 7
4505 
7 4
22 108 161 211 357 458 497 
1 8
1660 
1 4
3 
1 5
281 
1 6
391 
1 9
4391 
4 6
347 417 444 702 
1 7
1112 
1 9
377 
2 6
229 337 
1 8
518 
1 9
973 
3 4
22 33 53 
2 7
100 1396 
1 8
1930 
1 5...

result:

ok 200 lines

Test #26:

score: 0
Accepted
time: 103ms
memory: 8068kb

input:

100
458 929
631 686 117 194 405 237 831 288 35 447 400 865 229 909 679 162 630 520 812 324 576 496 535 43 0 244 56 305 750 396 645 927 606 823 258 758 767 386 203 918 910 233 659 884 746 85 212 365 617 329 209 900 678 915 97 885 817 836 802 335 733 572 755 742 563 410 167 289 7 453 388 443 281 190 6...

output:

1 10
86 
1 11
273 
1 9
65 
1 10
759 
1 13
509 
1 13
658 
1 6
20 
1 10
38 
1 3
6 
2 10
102 222 
1 13
2369 
1 16
1772 
3 8
77 111 356 
1 11
1306 
2 12
173 231 
1 10
520 
2 9
156 502 
1 16
4193 
1 9
64 
2 10
158 165 
1 12
233 
4 5
43 48 49 52 
1 10
112 
1 11
672 
1 15
772 
1 10
818 
1 15
515 
1 14
3648...

result:

ok 200 lines

Test #27:

score: 0
Accepted
time: 181ms
memory: 10072kb

input:

100
541 761
343 550 71 112 606 707 375 414 248 50 342 198 338 590 571 759 280 387 196 561 55 533 143 210 725 315 539 351 440 673 286 177 160 359 404 139 335 254 205 575 36 543 169 760 641 723 567 433 127 403 629 537 321 584 199 110 408 468 532 452 273 372 682 134 184 492 121 490 451 51 354 300 190 4...

output:

3 20
269 460 655 
2 20
185 723 
1 18
197 
1 20
263 
2 9
41 47 
1 13
43 
1 28
3345 
1 28
3724 
1 24
2034 
1 15
120 
1 18
574 
1 29
4920 
1 20
623 
1 17
723 
3 16
315 545 548 
1 22
115 
2 20
1032 1270 
2 14
130 590 
1 17
314 
1 17
281 
1 22
22 
1 13
210 
1 23
1031 
1 18
365 
1 10
103 
1 25
4825 
1 25
...

result:

ok 200 lines

Test #28:

score: 0
Accepted
time: 26ms
memory: 8208kb

input:

100
1423 1423
232 525 930 123 280 654 145 484 778 386 628 1039 804 45 1370 592 705 934 947 597 1278 645 696 115 1307 308 578 993 1287 193 1010 885 582 136 738 32 1250 1377 183 177 1416 11 370 1053 1418 65 48 448 175 792 529 797 14 179 631 847 38 1063 1390 656 1043 873 1027 690 634 604 9 1160 557 727...

output:

1422 1423
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...

result:

ok 200 lines

Test #29:

score: 0
Accepted
time: 34ms
memory: 8292kb

input:

10
7993 7993
7925 7104 7311 3183 1053 6564 7074 4967 769 2958 7364 7232 4315 5949 3871 6024 6222 7981 3702 4434 2732 7588 7526 212 6127 1219 3637 393 7229 7493 207 4957 2577 7659 7389 3444 4444 5811 7916 2555 6587 6486 2659 263 1027 7547 5206 4467 1291 6851 6590 4262 3549 6092 4015 1054 4635 2112 78...

output:

7992 7993
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...

result:

ok 20 lines

Test #30:

score: 0
Accepted
time: 19ms
memory: 10080kb

input:

10
6 29573
4370 20998 3600 28860 19784 0
5 32749
0 12773 8683 10478 4415
2 13901
10071 0
3 44701
44237 0 26317
1 8609
0
2 11503
965 0
1 1297
0
4 23801
16480 0 129 2134
2 15749
0 13316
3 18061
8349 14239 0

output:

5 2
1339 8959 9353 11054 11457 
4 2
8649 10136 18315 23183 
1 2
5339 
2 2
8610 12813 
8609 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 7...

result:

ok 20 lines

Test #31:

score: 0
Accepted
time: 18ms
memory: 8072kb

input:

10
2423 24659
5046 2123 2304 6184 2778 20409 6089 3720 4310 18664 13348 12437 13958 4335 4413 1884 1087 5028 6866 22156 4105 4092 13443 8532 5846 7747 3505 5005 21019 676 13790 17528 10848 15377 21546 14315 15756 15218 10311 1446 23146 8594 10674 12156 8953 140 8060 24490 3029 16358 463 15940 13432 ...

output:

5 5
4381 6907 14172 17902 18142 
3 4
1522 3926 5351 
2 5
6532 7303 
1 6
10366 
4 4
1770 4101 4676 5374 
1 5
1176 
1 6
1981 
2 4
1390 1699 
33 4
81 1736 2127 2638 3146 4289 4583 4839 5476 6074 7007 10401 11309 11483 12768 12931 13986 14543 16784 19765 20142 20295 20383 21183 22360 22732 23601 23871 2...

result:

ok 20 lines

Test #32:

score: 0
Accepted
time: 39ms
memory: 8080kb

input:

10
27791 30983
15484 22415 13855 15495 17417 9408 5123 8201 24203 13154 25137 9681 27394 10408 20395 18547 25950 24567 25061 24920 773 9609 10480 11830 6858 9233 6136 20982 30875 26573 3305 21872 2955 12610 29955 14537 26504 1477 6883 4210 19950 30204 15488 22180 7751 3877 12936 1954 23082 3067 2211...

output:

1 96
29718 
1 117
14014 
1 121
676 
1 77
2150 
1 92
3657 
1 106
34715 
1 87
7860 
1 105
25966 
1 57
787 
1 94
177 

result:

ok 20 lines

Test #33:

score: 0
Accepted
time: 25ms
memory: 9928kb

input:

10
2197 7253
4947 2552 2524 6057 6284 1032 3475 3699 1434 3626 525 1132 2657 5390 3530 5146 1810 4053 2581 4971 2580 3675 5961 1518 1570 4229 1835 2569 6481 3963 7165 6106 1250 243 6800 3308 6364 3610 4199 4440 6502 5411 4256 2543 3480 248 199 502 4770 855 6444 834 4068 1979 828 6381 3289 5777 550 2...

output:

1 9
3045 
5 8
4970 13431 20984 33828 36158 
1 11
59537 
1 8
1253 
1 8
3478 
2 9
17710 17780 
2 6
106 848 
1 9
2195 
1 10
15194 
3 8
11931 13343 14440 

result:

ok 20 lines

Test #34:

score: 0
Accepted
time: 25ms
memory: 8180kb

input:

10
10732 21503
5683 15374 12701 19032 10507 12795 1334 1404 21391 1027 3552 8963 13872 14945 15569 15572 10912 1822 20461 13019 8576 17448 4672 6110 4209 707 3927 7451 8667 4007 7615 710 6310 21201 7136 13435 16735 154 16694 18189 7684 21274 12268 4130 5491 7811 6140 11633 8446 2624 17019 7920 10474...

output:

1 17
20702 
1 16
21888 
2 12
3680 5170 
1 16
5625 
1 20
2761 
1 21
24305 
1 14
6683 
7 12
944 2237 10032 10812 11205 12166 12888 
4 11
1052 2640 3792 3831 
4 13
3808 7602 20524 21531 

result:

ok 20 lines

Test #35:

score: 0
Accepted
time: 31ms
memory: 9928kb

input:

10
524 773
667 450 19 239 437 182 579 564 254 689 674 568 236 642 529 352 706 599 107 460 534 279 609 93 742 268 372 327 519 464 301 1 650 63 586 110 726 293 756 167 643 765 478 355 595 416 153 241 342 501 413 592 377 234 358 755 444 224 67 440 20 491 490 258 64 71 607 271 219 533 576 278 614 461 21...

output:

3 15
178 184 718 
1 28
2829 
1 32
27180 
1 28
22059 
1 28
1438 
1 17
336 
1 29
22502 
1 27
32920 
1 29
2798 
1 24
1701 

result:

ok 20 lines

Test #36:

score: 0
Accepted
time: 27ms
memory: 8244kb

input:

10
55139 55147
43591 14674 26899 25678 7528 27223 50766 26393 8233 38072 48273 11188 3478 22018 43098 49708 3270 10438 34716 13303 367 37148 18286 6347 16390 54154 26514 14544 15497 64 10056 54185 35896 15281 50172 41743 25645 51612 9194 16557 52163 28025 53759 13376 40211 18493 40247 28008 17856 28...

output:

1 42928
45416 
2062 2063
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95...

result:

ok 20 lines

Test #37:

score: 0
Accepted
time: 21ms
memory: 8000kb

input:

3
10 6229
936 0 3568 131 2226 5474 5841 4624 811 3690
3 5003
2742 3138 0
194 188753
9780 132848 63101 60942 103103 57318 94142 146741 92155 152668 99413 0 2458 52221 186156 3674 63659 107568 83495 165348 52178 4895 61439 129362 103436 18413 104367 11745 8846 75016 92768 36276 95958 28532 88715 18473...

output:

9 2
33 594 951 1765 2381 3587 3607 4207 6045 
2 2
1293 1633 
193 2
388 947 1570 1634 3791 4724 7893 9854 10285 11708 12222 12356 16371 16837 17146 18507 19318 20024 20207 21969 23566 23818 24025 24582 25145 25736 27899 28322 32039 32592 33216 33228 33582 34539 35400 36181 37008 38377 39650 39725 399...

result:

ok 6 lines

Test #38:

score: 0
Accepted
time: 21ms
memory: 8116kb

input:

3
7324 72883
69476 35362 1897 35280 11920 57530 19677 42324 59798 46378 18674 18684 66354 25975 56319 31885 71554 35609 34553 49645 51808 67557 37781 30289 10237 37438 7659 863 50230 30149 55431 27452 50140 61315 33663 19352 60530 71359 32459 58060 4946 60040 22885 64125 20139 29402 61391 54765 1104...

output:

8 5
3128 9288 30119 31145 35211 44216 48739 50132 
9 5
8194 16753 24817 25891 44727 51564 54840 62685 67247 
4 5
3398 4236 10648 32107 

result:

ok 6 lines

Test #39:

score: 0
Accepted
time: 44ms
memory: 8484kb

input:

3
3336 3691
150 3577 837 3252 3215 688 3065 847 684 2297 2299 664 3367 813 3525 3689 89 1184 465 3384 1682 1873 1589 3450 1901 485 1841 1071 2509 1139 2222 818 1073 756 2916 850 18 2924 2191 3208 2433 3059 1492 2700 3653 411 218 1302 2358 1192 1054 1168 1378 1819 694 742 3078 2611 3490 2492 3406 179...

output:

1 69
3476 
1 120
158632 
1 98
25197 

result:

ok 6 lines

Test #40:

score: 0
Accepted
time: 22ms
memory: 10048kb

input:

3
29482 98327
2401 5690 97393 52140 27527 73599 49060 17544 70399 62248 43291 9316 34579 21595 57560 45335 31698 1248 55882 66221 61324 69877 57188 70014 72762 58031 59459 30185 35956 25834 50853 56778 12866 84131 18707 21922 41692 69640 92830 36719 5543 66512 88069 82962 75684 1391 78806 48654 3571...

output:

1 12
27533 
3 10
12754 49569 51467 
1 10
7458 

result:

ok 6 lines

Test #41:

score: 0
Accepted
time: 26ms
memory: 7932kb

input:

3
56 127
50 111 93 22 59 67 39 120 47 62 116 23 0 53 90 5 71 64 55 85 51 52 92 117 1 82 119 14 105 70 69 114 95 68 75 86 61 35 107 80 2 4 103 81 33 36 87 113 49 29 54 77 60 102 104 3
82927 165799
76622 139290 127619 21990 36319 54588 152606 69597 61378 43351 150153 33583 113121 72865 48173 137687 39...

output:

2 6
1 111 
1 20
161037 
1 20
24239 

result:

ok 6 lines

Test #42:

score: 0
Accepted
time: 29ms
memory: 10056kb

input:

3
68212 97883
41613 93058 19573 73851 62282 69643 56409 53457 21509 20653 65680 28307 59422 80222 52524 8346 39305 13162 49862 5652 43520 75167 24860 75787 83685 65826 47125 53162 64324 63362 70391 67587 31449 62709 60273 96664 45275 9765 37794 74517 15712 88046 94537 4923 16183 6941 69631 47063 150...

output:

2 32
18760 33126 
1 25
2740 
1 33
57992 

result:

ok 6 lines

Test #43:

score: 0
Accepted
time: 40ms
memory: 10000kb

input:

3
25714 25717
15088 22526 5758 21483 8453 17743 25319 15764 21083 7328 18066 17235 9642 4563 20770 23121 3247 8699 2930 5810 9370 5455 4297 17750 16788 22657 18184 24486 1002 2131 1606 4224 10753 9830 12768 20196 3624 1237 13294 25604 8730 16226 8719 16905 11799 24790 22773 21000 18347 15261 25372 2...

output:

1 25174
17276 
1 79689
137881 
1 20458
12495 

result:

ok 6 lines

Test #44:

score: 0
Accepted
time: 18ms
memory: 10112kb

input:

2
23 171541
98697 0 29405 42501 163488 157726 133732 25890 122616 57073 21492 23035 12755 67217 41752 74461 118686 95750 166311 107560 75121 155941 6256
4 28447
25748 9026 23554 0

output:

22 2
16912 18702 28235 29943 33710 37835 39126 62555 63798 67207 85064 93039 94239 97883 99979 100970 105619 115440 119144 133448 150647 160094 
3 2
14819 19610 24208 

result:

ok 4 lines

Test #45:

score: 0
Accepted
time: 20ms
memory: 7984kb

input:

2
13360 132763
44094 90038 92716 21633 128682 48634 35213 52001 78298 55346 50750 105358 7247 100946 16108 89436 30067 65470 120398 57992 100642 15292 69686 22150 19520 48604 37241 57277 66225 12587 26019 55500 12921 4531 76693 3444 83872 115362 74786 73252 63308 89630 114130 73895 89350 53605 71703...

output:

6 5
17490 25547 64188 70628 100411 106476 
6 5
5315 19197 41182 62408 65948 66459 

result:

ok 4 lines

Test #46:

score: 0
Accepted
time: 50ms
memory: 10068kb

input:

2
4832 5381
3222 3538 3112 894 2207 4871 70 3764 3813 4077 5186 5114 5352 4195 4735 4614 4867 4943 3961 3812 2094 4884 1789 795 5275 49 1533 1780 1633 1928 2571 2709 4792 3790 340 871 3849 2857 4874 1607 5228 2789 1719 2598 399 234 3793 4712 3373 322 2000 4146 721 974 145 2662 2290 257 3230 2046 369...

output:

1 84
2483 
1 104
75606 

result:

ok 4 lines

Test #47:

score: 0
Accepted
time: 26ms
memory: 8008kb

input:

2
40468 135077
96058 55445 48756 124324 91900 29558 69141 13005 29903 87721 7007 65434 73900 81742 20490 102816 107242 50183 34860 66546 60554 65460 76913 38994 72285 127621 31440 12267 44092 23991 67148 66085 58179 116578 121321 119026 35317 6010 34991 118853 96041 29634 47215 102444 35416 50622 72...

output:

1 13
87961 
3 10
36090 40503 58715 

result:

ok 4 lines

Test #48:

score: 0
Accepted
time: 30ms
memory: 8252kb

input:

2
84290 169079
127059 66657 61651 121872 113239 8356 90886 52591 14448 25784 131919 143302 157036 20944 25976 78335 153750 57871 21487 4544 36840 19505 86646 9845 165708 24714 24148 47413 139326 863 150147 40140 418 136306 117573 101002 96845 63487 61672 164792 118371 66508 64427 90913 89558 96855 7...

output:

1 19
137370 
1 17
7773 

result:

ok 4 lines

Test #49:

score: 0
Accepted
time: 28ms
memory: 8716kb

input:

2
120129 171341
110398 119483 31452 124116 83391 105206 113782 96001 135178 134709 31824 140049 8788 125086 76006 117379 85079 167990 152723 62019 10574 42418 64223 161029 167223 39307 137918 122615 106129 49848 140930 84081 57264 162048 87503 124024 96773 149613 117733 79629 86937 141330 50894 2724...

output:

1 34
2652 
1 31
8013 

result:

ok 4 lines

Test #50:

score: 0
Accepted
time: 36ms
memory: 8552kb

input:

2
137578 137587
135274 71032 97433 68393 25725 3828 27807 135730 115783 91789 120452 95395 37439 120525 95008 90395 70143 99423 51625 6261 9972 22238 129504 57393 41768 114228 38428 85848 62986 97568 15730 94502 11353 92481 127114 80058 10057 101730 78945 113223 39790 76879 47640 30662 9727 27891 13...

output:

1 102149
108737 
1 44754
43384 

result:

ok 4 lines

Test #51:

score: 0
Accepted
time: 21ms
memory: 8384kb

input:

1
3 199999
193667 0 15502

output:

2 2
47413 73752 

result:

ok 2 lines

Test #52:

score: 0
Accepted
time: 23ms
memory: 8252kb

input:

1
20105 199999
46654 146536 169399 40421 167047 42907 24666 79012 178470 63683 85423 58281 67519 152203 80111 98862 194589 188763 122932 117174 174098 174461 194088 22430 56866 159708 98517 156295 30340 157425 54753 160836 19633 96833 121268 178649 191017 150796 167076 96756 198225 4669 107399 17464...

output:

16 5
5032 6625 16233 28910 38444 42401 48500 56926 70377 71050 73480 76869 81019 88761 95925 171099 

result:

ok 2 lines

Test #53:

score: 0
Accepted
time: 42ms
memory: 9348kb

input:

1
180250 199999
189078 195476 172553 133293 37093 72698 197912 159314 119078 198806 147543 20836 167364 23860 113289 138683 178548 170845 37393 111747 178054 64889 105017 55556 144681 11204 72679 7319 159195 125646 60137 79694 82520 84012 60404 104992 22906 38355 37357 168557 56915 85924 177365 1486...

output:

1 114
65179 

result:

ok 2 lines

Test #54:

score: 0
Accepted
time: 27ms
memory: 9976kb

input:

1
60061 199999
157215 33938 158407 93886 136932 84450 38475 114415 86660 18575 3325 141315 99424 144311 34744 49582 197663 170581 80654 179350 161103 104039 94671 50120 186944 160865 42447 96877 109964 24894 3290 111072 58306 50848 82017 118051 43726 78326 161496 146731 195226 59925 186911 19439 401...

output:

1 10
131695 

result:

ok 2 lines

Test #55:

score: 0
Accepted
time: 28ms
memory: 8176kb

input:

1
99729 199999
30086 30555 10118 181847 2997 122174 153358 196665 196594 31730 189807 164679 125944 21116 173012 144636 162773 137290 111887 46993 94084 89988 48596 83518 17189 72082 33756 147411 147319 134250 50604 34855 66458 103332 151057 197405 195001 159110 196068 118658 42291 121524 184263 924...

output:

2 18
154208 164274 

result:

ok 2 lines

Test #56:

score: 0
Accepted
time: 36ms
memory: 9976kb

input:

1
140028 199999
5335 157624 58044 59830 77586 78007 195292 149961 107515 116630 150568 46507 109695 116531 192970 155131 30135 65209 84585 52812 142977 55746 176356 175247 173543 136091 100186 135056 93593 107308 29017 108533 63087 152948 67333 162347 134578 105974 101828 73371 67997 165278 88599 10...

output:

3 33
111102 155807 178457 

result:

ok 2 lines

Test #57:

score: 0
Accepted
time: 48ms
memory: 8976kb

input:

1
199976 199999
133008 191728 136938 125252 9027 103691 113322 162671 41110 71424 28728 90939 126416 63364 23262 45041 7917 159597 148962 109919 45615 188801 132889 176694 66892 192412 69157 16547 75814 158618 161752 80376 32766 34578 17578 69633 67660 127232 129029 57710 92300 26805 29741 142045 16...

output:

1 82725
192407 

result:

ok 2 lines