QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#56865#4818. Inverse Line GraphKING_UT#AC ✓6847ms227316kbC++203.9kb2022-10-21 18:59:542022-10-21 18:59:55

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-21 18:59:55]
  • 评测
  • 测评结果:AC
  • 用时:6847ms
  • 内存:227316kb
  • [2022-10-21 18:59:54]
  • 提交

answer

#include <bits/stdc++.h>
#define SIZE 300005
#define MX 3000005
using namespace std;
typedef pair <int,int> P;

vector <P> vec[SIZE];
int col[MX];
set <P> edge;
bool use[SIZE];
int now_sz;
bool clique(vector <int> nd){
	for(int i=0;i<nd.size();i++){
		for(int j=i+1;j<nd.size();j++){
			int a=nd[i],b=nd[j];
			if(a>b) swap(a,b);
			if(edge.find(P(a,b))==edge.end()) return false;
		}
	}
	return true;
}
bool cur[SIZE];
bool labelling(vector <int> nd,int now){
	//for(int i=0;i<nd.size();i++) printf("%d ",nd[i]);
	//printf(": %d\n",now);
	for(int i=0;i<nd.size();i++) cur[nd[i]]=true;
	bool up=true;
	for(int i=0;i<nd.size();i++){
		int v=nd[i];
		for(int j=0;j<vec[v].size();j++){
			int to=vec[v][j].first,id=vec[v][j].second;
			if(cur[to]){
				//printf("[%d %d] %d\n",v,to,col[id]);
				if(col[id]!=-1&&col[id]!=now) up=false;
				col[id]=now;
			}
		}
	}
	for(int i=0;i<nd.size();i++) cur[nd[i]]=false;
	return up;
}
bool dfs(vector <int>nd);
bool check_vertex(int v);
int now_col;
bool dfs(vector <int> nd){
	//for(int i=0;i<nd.size();i++) printf("%d ",nd[i]);puts("");
	if(!clique(nd)) return false;
	if(!labelling(nd,now_col++)) return false;
	for(int i=0;i<nd.size();i++){
		int v=nd[i];
		if(!check_vertex(v)) return false;
	}
	return true;
}
bool check_vertex(int v){
	//printf("* %d : ",v);
	set <int> st;
	vector <int> nd;
	for(int i=0;i<vec[v].size();i++){
		int to=vec[v][i].first,id=vec[v][i].second;
		//printf("%d ",col[id]);
		if(col[id]!=-1){
			st.insert(col[id]);
			if(st.size()>2) return false;
		} else{
			nd.push_back(to);
		}
	}
	//puts("");
	if(!nd.empty()){
		nd.push_back(v);
		if(!dfs(nd)) return false;
	}
	return true;
}
bool start(vector <int> nd){
	int v=nd[0];
	int f=now_col;
	queue <int> que;
	que.push(v);
	use[v]=true;
	vector <int> all;
	while(!que.empty()){
		v=que.front();que.pop();
		all.push_back(v);
		for(int i=0;i<vec[v].size();i++){
			int to=vec[v][i].first,id=vec[v][i].second;
			col[id]=-1;
			if(!use[to]){
				que.push(to);
				use[to]=true;
			}
		}
	}
	if(!dfs(nd)){
		now_col=f;
		for(int i=0;i<all.size();i++) use[all[i]]=false;
		return false;
	}
	return true;
}
bool run(int v){
	if(vec[v].size()==0) return true;
	if(vec[v].size()<=4){
		//return start(vector <int>{0,1});
		for(int S=0;S<1<<vec[v].size();S++){
			if(!(S>>0&1)) continue;
			vector <int> nd;
			nd.push_back(v);
			for(int i=0;i<vec[v].size();i++){
				if(S>>i&1){
					nd.push_back(vec[v][i].first);
				}
			}
			if(start(nd)){
				return true;
			}
		}
		return false;
	}
	int m=5;
	vector <int> mx;
	for(int S=0;S<1<<m;S++){
		vector <int> nd;
		for(int i=0;i<m;i++){
			if(S>>i&1){
				nd.push_back(vec[v][i].first);
			}
		}
		if(mx.size()<nd.size()&&clique(nd)){
			mx=nd;
		}
	}
	if(mx.size()<=2) return false;
	vector <int> one=mx;
	one.push_back(v);
	for(int i=m;i<vec[v].size();i++){
		int to=vec[v][i].first;
		vector <int> nd=mx;
		nd.push_back(to);
		if(clique(nd)){
			one.push_back(to);
		}
	}
	return start(one);
}
void solve(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++) vec[i].clear();
	edge.clear();
	for(int i=0;i<m;i++){
		int u,v;
		scanf("%d%d",&u,&v);u--,v--;
		vec[u].push_back(P(v,i));
		vec[v].push_back(P(u,i));
		edge.insert(P(min(u,v),max(u,v)));
	}
	for(int i=0;i<n;i++) use[i]=false;
	for(int i=0;i<m;i++) col[i]=-1;
	now_sz=0;
	now_col=0;
	for(int i=0;i<n;i++){
		if(use[i]) continue;
		if(!run(i)){
			puts("No");
			return;
		}
	}
	puts("Yes");
	vector <int> L(n),R(n);
	for(int i=0;i<n;i++){
		set <int> st;
		for(int j=0;j<vec[i].size();j++){
			int id=vec[i][j].second;
			if(col[id]!=-1) st.insert(col[id]);
		}
		assert(st.size()<=2);
		while(st.size()<2){
			st.insert(now_col++);
		}
		set <int>::iterator it=st.begin();
		L[i]=*it;
		R[i]=*(++it);
	}
	printf("%d %d\n",now_col,n);
	for(int i=0;i<n;i++) printf("%d %d\n",L[i]+1,R[i]+1);
}
int main(){
	int T;
	scanf("%d",&T);
	while(T--) solve();
}
/*
 
Yes
5 5
1 2
1 4
2 5
2 3
3 4
Yes
2 1
1 2
Yes
3 2
1 2
1 3
Yes
3 3
1 2
1 3
2 3
No
Yes
5 5
1 5
1 2
2 3
2 4
3 4

 */

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 10876kb

input:

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

output:

Yes
5 5
1 2
1 4
2 5
2 3
3 4
Yes
2 1
1 2
Yes
3 2
1 2
1 3
Yes
3 3
1 2
1 3
2 3
No
Yes
5 5
1 5
1 2
2 3
2 4
3 4

result:

ok that's great! (sum n = 20, sum m = 19) (6 test cases)

Test #2:

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

input:

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

output:

Yes
8 6
1 4
2 5
3 6
3 7
1 2
1 8
Yes
4 2
1 2
3 4
Yes
2 1
1 2
Yes
7 5
4 5
1 2
1 3
2 3
6 7
Yes
8 6
1 5
4 6
7 8
3 4
2 3
1 2

result:

ok that's great! (sum n = 20, sum m = 12) (5 test cases)

Test #3:

score: 0
Accepted
time: 6ms
memory: 10732kb

input:

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

output:

Yes
7 5
1 2
2 3
4 5
6 7
1 3
Yes
5 4
1 2
1 3
2 4
3 5
Yes
5 5
1 2
2 3
2 5
3 4
1 4
Yes
6 3
1 2
3 4
5 6
Yes
7 6
1 6
3 4
4 5
5 7
1 2
2 3
Yes
4 4
1 2
1 4
3 4
2 3
Yes
7 6
1 2
2 4
1 3
5 6
3 7
2 3
Yes
2 1
1 2
Yes
6 5
1 4
1 2
3 5
2 6
2 3
Yes
8 4
1 2
3 4
5 6
7 8
Yes
4 2
1 2
3 4
Yes
6 3
1 2
3 4
5 6
Yes
2 1
1 2
...

result:

ok that's great! (sum n = 50, sum m = 33) (14 test cases)

Test #4:

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

input:

5
5 3
2 3
1 2
2 5
9 12
2 6
2 5
3 5
3 4
5 8
2 8
6 9
4 7
1 9
1 8
7 9
1 6
2 0
5 3
4 5
1 3
3 4
2 1
1 2

output:

No
Yes
8 9
1 2
3 8
4 5
5 6
3 4
1 8
6 7
2 3
1 7
Yes
4 2
1 2
3 4
Yes
7 5
1 4
5 6
1 2
2 3
3 7
Yes
3 2
1 2
1 3

result:

ok that's great! (sum n = 23, sum m = 19) (5 test cases)

Test #5:

score: 0
Accepted
time: 200ms
memory: 10844kb

input:

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

output:

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

result:

ok that's great! (sum n = 300000, sum m = 223451) (61395 test cases)

Test #6:

score: 0
Accepted
time: 319ms
memory: 10720kb

input:

38520
8 8
1 2
3 5
3 7
4 8
1 4
7 8
2 5
1 8
11 18
4 5
1 5
1 6
1 9
7 8
10 11
6 9
7 10
4 9
2 11
4 6
1 4
8 10
3 6
2 9
3 5
7 11
3 4
12 26
10 11
1 2
5 11
2 10
6 8
1 7
2 12
2 7
6 9
3 6
5 8
8 10
5 9
4 11
1 11
5 6
1 4
5 12
8 11
7 12
3 8
6 12
1 12
5 10
9 12
3 4
4 2
3 4
1 4
14 30
4 9
9 10
4 6
3 11
11 13
12 14
6...

output:

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

result:

ok that's great! (sum n = 300000, sum m = 439705) (38520 test cases)

Test #7:

score: 0
Accepted
time: 409ms
memory: 10912kb

input:

29408
2 0
10 20
7 9
3 4
3 10
7 10
4 8
4 5
5 8
6 9
3 5
1 3
8 9
4 7
4 10
1 10
6 7
4 6
1 2
7 8
3 8
6 10
4 2
1 3
2 4
8 6
3 8
5 6
2 5
1 5
2 7
4 6
14 35
9 10
8 13
5 7
3 13
2 7
4 5
8 11
11 12
6 12
1 13
1 12
2 5
5 10
4 10
2 12
4 7
5 9
8 9
1 3
4 9
5 12
2 10
3 10
9 11
1 11
2 8
2 3
7 12
6 11
8 10
3 8
9 13
11 1...

output:

Yes
4 2
1 2
3 4
Yes
8 10
1 2
2 7
1 3
3 4
3 8
4 6
4 5
3 5
5 6
1 4
Yes
6 4
1 3
2 4
1 5
2 6
No
Yes
9 14
1 6
2 3
3 6
4 7
2 4
1 8
2 7
3 5
4 5
3 4
1 5
1 2
5 6
8 9
Yes
10 14
1 2
1 5
2 3
1 6
3 4
6 7
8 9
3 6
4 6
3 9
7 10
6 8
4 9
4 5
Yes
10 17
1 2
2 3
4 8
1 3
3 8
5 6
7 9
4 5
3 10
5 8
6 7
2 8
4 6
1 8
7 8
3 4
5...

result:

ok that's great! (sum n = 300000, sum m = 602206) (29408 test cases)

Test #8:

score: 0
Accepted
time: 645ms
memory: 10816kb

input:

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

output:

Yes
8 5
1 3
2 4
5 6
2 7
1 8
Yes
10 23
1 7
3 9
1 5
3 4
5 6
1 2
5 9
5 10
6 9
1 3
4 10
1 9
1 10
6 7
2 6
4 5
7 8
2 3
4 8
2 5
2 10
2 4
2 7
No
Yes
9 11
1 7
2 3
3 6
1 5
5 6
2 8
6 9
2 5
4 5
3 4
1 2
Yes
9 12
1 5
2 8
4 5
3 4
1 8
3 7
6 7
1 9
5 6
1 2
7 8
2 3
Yes
14 7
1 2
3 4
5 6
7 8
9 10
11 12
13 14
Yes
10 14
1...

result:

ok that's great! (sum n = 300000, sum m = 917019) (19907 test cases)

Test #9:

score: 0
Accepted
time: 703ms
memory: 10940kb

input:

12137
39 271
17 32
26 33
16 32
21 35
28 39
24 33
3 15
5 31
21 29
10 13
11 39
3 35
7 29
10 22
3 21
7 10
4 34
15 16
2 18
27 35
4 39
18 19
35 36
19 26
9 37
5 34
21 39
23 33
1 34
20 39
1 23
12 37
5 38
5 12
32 38
1 38
24 38
3 27
23 26
2 14
6 33
9 33
9 12
2 28
2 8
13 32
36 39
13 16
3 20
8 31
15 37
22 36
2...

output:

Yes
10 39
1 5
4 6
6 7
4 9
5 6
3 4
8 10
6 8
1 3
1 10
4 8
1 6
5 10
1 4
4 7
5 7
2 8
2 6
2 5
7 9
7 8
1 8
1 2
2 4
3 9
2 9
2 7
6 9
7 10
3 10
3 6
5 8
2 3
5 9
3 7
3 8
1 7
4 5
8 9
Yes
6 3
1 2
3 4
5 6
No
Yes
10 22
1 9
4 5
1 8
3 7
2 3
7 8
2 4
3 5
3 8
7 10
1 10
3 4
5 6
1 2
5 10
2 8
1 3
1 4
2 6
6 7
7 9
6 9
Yes
2...

result:

ok that's great! (sum n = 300000, sum m = 1507380) (12137 test cases)

Test #10:

score: 0
Accepted
time: 809ms
memory: 10864kb

input:

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

output:

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

result:

ok that's great! (sum n = 300000, sum m = 1741177) (10112 test cases)

Test #11:

score: 0
Accepted
time: 1099ms
memory: 11068kb

input:

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

output:

Yes
10 19
1 7
2 4
3 4
4 6
1 3
7 8
7 9
3 9
1 6
4 5
3 6
3 5
5 7
2 8
1 10
1 2
5 9
2 3
5 6
Yes
15 81
1 14
12 15
3 7
1 5
4 9
13 15
8 10
9 12
2 15
3 9
8 15
1 9
5 13
1 7
8 12
10 13
6 8
6 11
6 10
9 10
9 11
1 8
2 10
4 5
5 15
1 6
4 14
4 10
12 13
3 4
2 7
6 15
3 6
2 14
1 15
3 15
1 11
6 12
2 6
12 14
1 12
3 12
11...

result:

ok that's great! (sum n = 300000, sum m = 2530246) (6175 test cases)

Test #12:

score: 0
Accepted
time: 1292ms
memory: 11172kb

input:

5039
111 1318
69 97
72 104
34 107
89 108
6 74
36 40
58 96
50 100
20 32
8 35
24 109
5 43
60 104
21 80
58 94
76 99
88 111
27 58
4 110
3 37
81 96
71 89
102 103
98 102
43 54
13 52
23 107
33 84
70 98
31 92
19 43
68 93
28 96
65 77
96 108
30 82
17 36
40 47
26 102
45 48
30 89
70 90
73 96
13 108
10 85
19 75
...

output:

Yes
22 111
1 13
13 14
1 8
5 10
1 6
5 13
1 15
14 16
2 15
1 3
3 11
3 10
3 4
8 12
3 13
7 10
4 11
3 15
5 6
3 6
7 9
4 7
6 12
6 8
7 18
5 12
2 7
5 20
11 13
12 19
1 2
6 11
4 10
6 13
14 15
7 11
1 10
3 9
2 18
10 11
9 12
6 16
4 6
2 9
5 8
1 18
2 10
2 8
1 7
6 10
13 15
4 5
4 15
6 9
8 10
3 19
7 21
7 15
1 4
8 15
5 ...

result:

ok that's great! (sum n = 300000, sum m = 2937547) (5039 test cases)

Test #13:

score: 0
Accepted
time: 1346ms
memory: 11204kb

input:

4021
5 3
2 3
4 5
2 5
47 183
15 45
29 45
20 26
11 34
18 23
4 25
4 39
22 29
18 25
5 12
6 42
9 18
14 38
6 12
24 40
18 39
9 46
7 38
15 27
30 39
30 35
26 32
3 30
21 46
7 33
38 46
10 22
7 36
27 46
19 46
19 31
10 13
16 42
16 21
7 16
25 29
10 28
26 46
1 3
15 17
22 34
15 24
15 37
8 40
7 27
26 37
10 15
42 44
...

output:

Yes
7 5
4 5
1 2
1 6
3 7
2 3
No
Yes
15 81
1 7
5 9
3 10
2 3
1 5
4 5
5 8
9 14
3 13
1 8
4 10
5 7
4 11
8 14
2 14
11 15
3 5
5 14
6 15
1 11
3 9
1 13
2 15
7 11
6 8
5 10
4 12
1 10
2 5
12 15
7 13
2 13
5 6
4 7
14 15
4 15
2 4
1 14
10 14
9 10
7 12
3 4
7 15
7 14
4 9
2 8
12 13
1 2
2 9
10 11
8 13
3 6
6 7
8 12
3 7
8...

result:

ok that's great! (sum n = 278099, sum m = 3000000) (4021 test cases)

Test #14:

score: 0
Accepted
time: 1347ms
memory: 11292kb

input:

3705
130 1346
38 108
28 45
89 123
19 93
24 50
21 42
29 61
14 28
48 116
26 71
101 113
18 80
70 92
106 108
1 4
17 71
5 65
84 92
6 121
71 129
83 126
5 77
48 123
94 104
20 58
3 128
13 65
111 128
113 118
5 116
80 129
10 15
84 107
55 89
75 100
119 122
19 99
60 87
1 18
102 128
25 80
104 128
49 79
5 115
74 ...

output:

Yes
64 130
1 10
11 13
4 10
1 2
11 16
1 8
19 20
1 11
1 16
1 4
8 13
6 14
2 16
12 15
1 14
11 12
10 14
10 15
3 13
8 15
1 5
5 10
6 13
1 13
2 6
10 11
18 21
12 13
7 11
5 13
3 4
8 14
5 14
22 23
4 5
4 6
24 25
1 3
26 27
28 29
7 10
1 12
30 31
5 32
10 13
7 17
6 12
2 13
7 14
4 13
33 34
35 36
37 38
3 14
2 15
4 17...

result:

ok that's great! (sum n = 264646, sum m = 3000000) (3705 test cases)

Test #15:

score: 0
Accepted
time: 1338ms
memory: 11356kb

input:

3784
7 7
1 6
1 4
2 4
1 3
4 6
5 7
2 7
43 328
10 12
14 15
18 25
24 38
18 43
1 3
36 41
7 21
10 32
21 33
1 22
14 22
19 36
28 30
20 30
6 34
23 24
5 21
3 33
17 29
14 23
24 26
15 27
9 43
7 26
22 40
9 27
16 32
13 35
34 37
8 34
15 35
4 20
9 14
17 18
1 32
3 19
5 33
25 39
4 21
12 15
9 39
40 43
30 33
17 32
9 40...

output:

Yes
8 7
1 2
3 4
2 6
1 3
5 7
1 8
4 5
Yes
10 43
1 3
5 7
3 8
1 10
8 9
4 10
1 8
2 10
3 4
1 9
6 10
2 9
7 9
2 3
2 4
7 8
6 7
5 6
3 10
1 6
8 10
1 2
2 7
2 5
5 8
2 8
4 6
5 9
3 7
6 9
9 10
1 7
6 8
5 10
4 7
3 6
3 5
1 5
4 8
1 4
3 9
4 9
4 5
Yes
22 126
1 12
3 16
7 14
10 15
17 20
5 8
12 16
5 13
3 15
16 17
3 9
13 16
...

result:

ok that's great! (sum n = 272523, sum m = 3000000) (3784 test cases)

Test #16:

score: 0
Accepted
time: 1252ms
memory: 11300kb

input:

3162
137 1468
72 136
53 128
14 22
51 105
28 137
23 32
49 66
24 56
28 89
2 101
8 62
68 104
21 90
69 136
37 114
50 127
56 67
10 129
60 63
134 135
16 78
77 102
103 106
5 68
14 95
4 72
42 137
19 93
72 110
73 92
6 61
56 85
4 69
18 83
53 126
73 136
30 35
6 25
71 106
14 129
77 131
60 92
37 49
69 91
77 78
1...

output:

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

result:

ok that's great! (sum n = 249028, sum m = 3000000) (3162 test cases)

Test #17:

score: 0
Accepted
time: 1323ms
memory: 11292kb

input:

3356
54 454
29 31
3 20
17 34
18 30
9 10
3 12
15 25
3 13
1 45
37 51
16 30
27 47
5 51
12 32
11 16
28 29
31 40
2 6
14 35
1 39
6 14
11 20
5 23
25 38
33 39
7 28
2 8
6 24
19 46
27 41
33 52
20 37
29 54
42 50
6 34
7 24
25 36
48 49
39 41
52 54
30 45
13 44
3 24
23 24
11 46
23 49
50 53
51 53
1 48
16 31
22 42
3...

output:

Yes
14 54
1 5
3 13
6 9
2 9
4 7
3 10
9 11
6 13
2 11
1 11
4 5
6 12
4 9
3 8
5 10
3 4
1 6
2 14
6 7
4 6
2 5
5 7
7 9
9 10
10 12
6 10
1 7
5 11
3 5
2 3
3 6
2 6
10 11
1 3
3 9
2 10
4 11
7 12
1 10
3 12
1 4
7 8
2 4
4 10
1 2
5 6
2 7
5 9
1 9
7 10
7 11
6 11
3 7
3 11
Yes
13 34
1 6
2 4
1 3
2 8
1 8
4 7
1 9
1 10
5 6
5...

result:

ok that's great! (sum n = 260516, sum m = 3000000) (3356 test cases)

Test #18:

score: 0
Accepted
time: 1310ms
memory: 11244kb

input:

3325
68 615
24 59
7 41
20 27
31 53
45 48
40 65
48 53
39 44
35 53
23 53
25 67
12 36
8 61
35 65
59 67
12 49
46 67
4 31
28 39
6 49
5 28
20 24
53 57
52 60
32 47
19 38
12 25
26 56
4 45
27 34
38 53
15 21
7 57
2 11
6 12
11 41
14 55
7 24
21 23
38 57
13 34
29 43
45 51
17 44
30 67
20 23
46 63
31 34
31 47
6 47...

output:

Yes
15 68
1 4
7 15
6 15
12 14
4 15
1 12
3 7
1 6
1 3
6 14
7 13
6 12
3 15
3 4
7 10
13 14
3 9
1 5
2 13
2 9
10 11
4 10
2 10
7 9
4 6
1 8
1 9
4 8
1 14
2 6
9 14
9 13
13 15
9 15
2 3
6 9
6 13
2 15
8 9
1 15
7 12
1 7
7 14
9 10
14 15
5 6
9 12
10 14
12 13
3 10
12 15
3 14
2 14
1 13
4 5
1 10
2 7
2 12
7 8
3 12
3 6
...

result:

ok that's great! (sum n = 261664, sum m = 3000000) (3325 test cases)

Test #19:

score: 0
Accepted
time: 1280ms
memory: 11304kb

input:

2871
163 712
160 162
26 128
15 120
147 153
99 144
33 137
30 69
107 115
12 15
9 61
82 102
50 161
156 163
48 161
73 118
110 152
2 32
3 136
36 72
99 139
34 85
3 99
26 124
33 43
135 145
4 160
8 87
64 94
29 113
125 131
80 88
17 84
103 108
80 125
45 57
31 55
64 89
46 58
97 157
136 148
69 159
9 149
16 89
6...

output:

No
Yes
9 14
1 4
4 5
1 6
1 5
3 4
2 5
5 8
5 6
6 7
7 9
1 2
6 8
2 3
3 5
Yes
56 159
1 6
24 25
8 18
11 14
2 14
19 20
16 19
4 21
9 13
17 18
13 19
6 14
2 22
4 15
7 16
2 3
4 5
4 6
16 17
7 14
7 21
1 18
5 9
13 16
3 8
2 13
3 21
1 3
8 15
14 15
15 21
4 14
5 19
6 7
18 26
2 7
1 8
17 21
6 16
5 21
27 28
4 18
6 19
2 1...

result:

ok that's great! (sum n = 244676, sum m = 3000000) (2871 test cases)

Test #20:

score: 0
Accepted
time: 1329ms
memory: 11288kb

input:

3036
72 655
16 64
10 27
24 72
1 67
17 53
7 46
35 66
21 24
9 24
4 58
24 62
19 63
11 34
11 64
13 64
23 41
20 70
21 65
10 72
38 42
5 25
4 12
11 16
61 66
21 60
9 72
25 34
28 40
34 48
42 54
45 60
34 64
12 53
5 22
8 30
15 42
35 54
42 53
15 27
21 37
7 48
19 24
17 33
14 65
27 48
61 70
8 13
28 37
62 65
2 14
...

output:

Yes
15 72
1 4
5 6
8 9
2 13
1 8
1 14
2 14
1 9
9 13
7 9
6 14
2 7
4 9
4 5
6 7
14 15
3 7
2 8
9 11
1 10
3 8
5 8
2 12
3 9
8 13
10 15
7 8
4 10
11 14
6 9
1 3
1 15
1 7
13 14
4 14
3 11
4 8
4 13
5 15
7 10
2 4
6 13
11 15
1 13
12 14
2 15
12 13
7 14
9 15
3 12
3 13
1 5
7 13
4 6
6 8
2 6
5 13
2 3
6 10
8 14
11 12
3 1...

result:

ok that's great! (sum n = 252869, sum m = 3000000) (3036 test cases)

Test #21:

score: 0
Accepted
time: 1309ms
memory: 11444kb

input:

3032
10 13
1 2
5 7
1 9
3 4
8 10
6 9
1 4
6 10
3 5
2 7
9 10
4 9
1 7
73 703
9 46
52 62
38 73
10 39
41 44
11 35
51 68
1 19
2 67
7 63
30 36
60 63
29 61
13 67
33 64
12 18
18 51
29 46
55 61
18 57
13 26
17 64
3 15
5 20
8 19
35 45
3 18
15 27
30 37
66 69
45 46
36 37
33 35
48 68
46 55
30 32
15 23
25 36
46 64
3...

output:

Yes
10 10
1 2
1 8
5 6
2 5
6 7
3 9
1 7
4 10
2 3
3 4
Yes
15 73
1 9
8 15
11 12
5 12
6 10
4 13
12 14
3 8
2 5
1 13
6 9
2 11
7 8
9 14
3 11
1 3
3 13
2 12
8 9
3 10
3 14
8 11
6 11
9 15
8 13
7 9
3 7
8 10
5 11
8 12
5 9
9 12
3 4
4 11
3 6
5 8
2 8
3 9
1 2
2 9
1 4
10 11
1 10
4 5
3 15
3 5
5 6
2 6
4 15
2 14
4 12
5 7...

result:

ok that's great! (sum n = 254049, sum m = 3000000) (3032 test cases)

Test #22:

score: 0
Accepted
time: 1279ms
memory: 11496kb

input:

2640
89 987
53 55
23 65
14 71
11 87
62 71
15 72
57 70
47 61
29 54
51 89
79 83
46 54
44 79
9 63
14 41
49 61
19 83
20 89
43 77
41 89
6 68
29 75
15 81
21 63
37 78
52 58
42 44
36 45
40 60
14 78
64 74
22 80
21 46
39 57
25 87
54 76
50 84
46 80
47 51
65 80
6 28
30 89
26 39
5 55
9 14
30 44
26 61
41 62
36 50...

output:

Yes
15 89
1 10
11 13
2 4
11 14
7 8
2 3
5 9
9 15
1 3
9 12
12 13
7 11
13 15
1 4
2 14
1 9
1 15
3 11
4 12
2 5
3 9
5 13
10 14
3 6
2 12
11 15
12 15
1 2
4 14
1 5
9 11
6 15
4 9
7 9
11 12
6 9
6 12
7 13
8 15
8 11
1 11
5 15
3 5
4 5
8 9
9 14
5 14
2 6
8 14
9 10
5 10
2 8
6 8
7 14
6 7
4 8
7 15
2 11
2 15
5 8
14 15
...

result:

ok that's great! (sum n = 233919, sum m = 3000000) (2640 test cases)

Test #23:

score: 0
Accepted
time: 1240ms
memory: 11480kb

input:

2697
131 1677
35 128
39 47
13 84
19 67
39 127
81 102
8 65
116 117
55 65
16 97
1 26
10 95
85 93
5 130
78 87
10 18
47 49
121 131
36 120
71 122
38 116
27 111
53 59
11 121
83 109
4 31
21 71
15 19
22 58
13 64
68 99
5 110
33 115
41 96
60 63
110 127
28 78
82 127
85 114
35 90
66 106
58 99
79 99
102 115
71 1...

output:

Yes
22 131
1 10
12 13
11 16
3 18
5 17
1 5
5 12
17 18
3 10
1 14
11 14
3 14
4 15
16 17
1 16
2 15
1 19
1 6
16 19
19 20
15 20
10 19
11 13
1 17
2 11
1 2
8 9
6 10
6 16
2 5
14 18
1 20
5 16
2 4
13 14
12 21
3 20
4 16
11 19
10 20
7 9
2 3
18 20
1 18
3 13
3 15
11 12
5 20
9 12
9 10
3 5
4 10
16 18
15 18
17 19
4 1...

result:

ok that's great! (sum n = 240904, sum m = 3000000) (2697 test cases)

Test #24:

score: 0
Accepted
time: 1341ms
memory: 11428kb

input:

2742
164 1280
105 111
70 144
12 32
35 65
106 144
25 26
1 11
12 56
19 160
149 151
20 53
92 155
117 155
40 154
30 151
100 141
64 152
105 118
103 132
25 62
17 67
48 136
45 160
91 116
68 109
120 124
54 125
30 128
33 102
105 149
136 161
106 120
30 92
98 136
24 81
24 140
90 133
62 162
73 90
62 140
21 45
2...

output:

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

result:

ok that's great! (sum n = 246601, sum m = 3000000) (2742 test cases)

Test #25:

score: 0
Accepted
time: 1427ms
memory: 11816kb

input:

845
116 3941
2 90
96 116
21 57
47 87
101 113
13 55
63 75
4 79
30 93
33 68
35 69
55 56
34 46
80 111
49 68
14 71
21 101
38 107
78 92
106 115
19 25
18 115
39 78
19 55
74 79
2 72
70 105
35 94
88 110
6 80
38 116
21 39
94 101
3 65
30 81
84 115
24 30
67 84
25 75
6 31
64 109
30 39
14 50
41 104
1 53
56 108
1...

output:

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

result:

ok that's great! (sum n = 255437, sum m = 3000000) (845 test cases)

Test #26:

score: 0
Accepted
time: 1548ms
memory: 11896kb

input:

851
213 3934
40 201
12 160
8 175
20 60
117 172
18 143
70 188
36 54
48 61
165 210
32 159
32 132
72 173
72 122
32 62
152 201
151 197
13 28
150 191
5 135
89 101
103 196
16 125
68 140
98 188
11 184
3 38
153 180
12 129
12 201
35 177
41 50
157 170
25 131
144 186
77 159
40 144
131 196
82 90
50 79
42 157
47...

output:

Yes
22 213
1 16
5 18
6 18
3 11
7 12
1 5
14 20
17 21
6 13
11 19
9 22
10 22
18 19
1 8
13 18
21 22
19 20
8 16
9 20
1 20
10 15
2 21
2 20
5 11
8 19
6 16
5 6
11 18
2 11
8 12
6 22
2 16
11 21
1 21
3 13
17 22
5 19
3 6
3 20
3 10
14 18
7 22
2 13
6 19
13 21
2 12
3 4
1 10
1 22
14 16
10 21
12 19
9 11
18 22
12 15
...

result:

ok that's great! (sum n = 249106, sum m = 3000000) (851 test cases)

Test #27:

score: 0
Accepted
time: 1522ms
memory: 11944kb

input:

865
202 3535
125 155
156 174
28 122
34 154
87 163
2 119
139 171
119 197
48 107
17 71
7 108
9 152
130 182
103 108
34 102
124 178
43 74
70 118
20 194
59 136
89 95
117 153
47 93
69 183
48 84
39 56
37 135
36 201
61 197
70 187
82 86
128 140
26 184
59 132
184 200
3 183
93 165
20 81
79 103
38 52
15 54
10 1...

output:

Yes
22 202
1 4
3 22
5 22
11 16
10 15
9 10
1 18
3 13
5 13
10 22
14 16
15 17
20 22
8 9
10 11
4 16
2 18
6 9
6 19
3 15
6 8
12 16
11 22
14 21
1 20
1 12
4 18
2 15
9 16
3 16
5 9
5 7
17 18
9 15
8 16
2 7
1 2
2 10
10 16
5 10
11 12
2 8
7 11
6 15
8 15
5 20
14 15
2 13
12 15
6 22
4 8
2 11
9 21
8 10
7 20
3 10
19 2...

result:

ok that's great! (sum n = 260611, sum m = 3000000) (865 test cases)

Test #28:

score: 0
Accepted
time: 1432ms
memory: 11980kb

input:

763
90 1002
39 87
16 76
59 81
41 50
9 66
24 36
6 35
62 89
48 87
1 56
5 80
13 21
5 26
12 38
2 57
78 84
53 59
44 63
9 39
11 49
59 71
17 39
22 42
45 70
24 43
48 58
5 77
15 44
34 86
62 87
5 10
57 60
24 41
20 52
45 53
18 41
72 75
26 71
28 52
13 48
28 63
53 81
24 50
38 42
47 82
53 86
64 81
1 25
25 28
46 7...

output:

Yes
15 90
1 12
2 12
7 9
6 8
2 7
4 8
7 14
2 6
5 14
2 15
11 15
4 14
1 6
5 13
10 11
2 5
6 7
10 12
3 14
3 10
1 4
1 8
2 13
6 10
1 2
7 11
6 9
2 3
3 8
3 12
7 8
12 15
8 10
4 9
8 9
4 6
6 12
1 14
5 6
1 9
10 14
1 15
5 10
3 11
13 15
12 13
8 13
6 14
11 14
10 13
9 12
3 4
4 13
5 15
1 13
11 12
2 8
14 15
4 7
8 14
1 ...

result:

ok that's great! (sum n = 300000, sum m = 2932020) (763 test cases)

Test #29:

score: 0
Accepted
time: 1497ms
memory: 11932kb

input:

787
552 5078
68 114
107 123
182 385
17 376
255 534
302 525
147 447
6 513
147 533
239 503
102 466
345 395
33 501
287 407
248 415
79 451
224 253
196 202
315 393
164 374
17 432
64 281
345 455
2 467
107 258
217 331
106 363
154 429
293 536
211 548
9 282
258 364
100 338
278 366
321 393
48 284
72 382
2 231...

output:

No
Yes
949 752
36 37
1 30
38 39
4 22
40 41
42 43
44 45
2 32
7 8
46 47
48 49
50 51
4 21
52 53
8 9
54 55
7 21
10 18
56 57
58 59
60 61
62 63
64 65
1 24
66 67
8 11
68 69
70 71
72 73
3 12
74 75
18 28
8 27
76 77
1 21
78 79
24 28
17 26
80 81
82 83
10 29
84 85
86 87
88 89
10 27
16 18
11 16
90 91
92 93
12 22...

result:

ok that's great! (sum n = 300000, sum m = 2988551) (787 test cases)

Test #30:

score: 0
Accepted
time: 1494ms
memory: 12044kb

input:

793
233 4455
32 50
67 169
45 106
116 179
113 225
35 72
40 139
161 222
14 76
135 213
47 228
26 27
86 229
160 187
13 185
27 117
135 147
29 189
220 229
64 205
16 222
88 137
61 107
59 217
160 228
34 71
49 184
46 127
65 152
24 133
73 208
51 196
201 213
189 216
157 190
40 64
46 95
48 174
172 177
174 223
1...

output:

Yes
31 233
1 10
15 20
3 6
10 15
1 16
14 23
5 11
4 11
11 13
7 17
1 6
4 7
12 17
8 21
1 17
7 22
12 21
8 17
10 13
6 16
12 27
7 25
5 12
20 21
1 14
6 22
6 21
12 19
3 15
24 25
14 16
4 9
3 17
1 13
2 15
2 7
8 14
16 20
14 20
11 14
8 22
2 16
6 10
20 22
13 19
10 22
7 15
16 17
5 18
4 16
5 17
15 21
4 21
1 8
2 12
...

result:

ok that's great! (sum n = 300000, sum m = 2918149) (793 test cases)

Test #31:

score: 0
Accepted
time: 1478ms
memory: 12176kb

input:

618
482 4657
114 226
85 115
16 226
13 22
186 414
4 246
30 296
331 473
210 458
399 402
399 449
102 338
196 267
95 196
3 267
205 305
95 424
111 135
53 154
20 234
416 432
307 355
69 458
18 315
74 180
30 443
163 307
159 313
401 454
104 109
32 300
136 355
245 408
258 420
408 478
115 274
451 454
9 63
292 ...

output:

Yes
506 482
31 32
1 21
9 24
13 25
33 34
35 36
37 38
39 40
11 23
6 11
41 42
7 8
1 2
43 44
45 46
20 22
47 48
15 18
1 13
12 13
49 50
2 3
51 52
53 54
55 56
2 22
3 21
7 21
57 58
2 13
4 15
8 19
8 24
9 13
59 60
61 62
63 64
4 20
4 6
65 66
67 68
6 8
69 70
4 7
71 72
73 74
4 13
2 9
75 76
5 11
5 15
77 78
8 22
3...

result:

ok that's great! (sum n = 300000, sum m = 2878189) (618 test cases)

Test #32:

score: 0
Accepted
time: 1561ms
memory: 12224kb

input:

584
699 11313
219 483
233 432
23 76
540 544
247 623
269 687
433 637
238 295
11 652
460 627
228 382
72 462
197 556
38 609
370 681
214 215
210 501
594 666
106 427
331 605
111 175
141 693
386 491
386 639
65 548
76 156
428 475
237 297
307 573
279 472
247 463
164 512
5 126
400 428
268 462
131 445
74 469
...

output:

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

result:

ok that's great! (sum n = 292591, sum m = 3000000) (584 test cases)

Test #33:

score: 0
Accepted
time: 1566ms
memory: 12280kb

input:

572
559 9457
200 397
36 528
50 511
459 527
50 430
27 134
56 243
353 550
60 549
173 372
8 382
156 335
161 539
480 520
194 356
97 508
66 144
329 438
383 511
47 401
472 514
27 316
305 453
68 90
58 276
178 557
313 502
137 441
74 178
74 458
22 68
244 435
524 554
59 245
82 285
315 395
185 497
429 493
39 5...

output:

Yes
360 559
1 18
17 21
24 26
34 35
3 26
24 32
14 27
10 24
28 29
20 21
36 37
4 17
5 6
2 21
38 39
9 29
12 17
1 22
27 33
40 41
21 22
24 25
24 33
7 32
42 43
44 45
3 7
19 22
46 47
16 28
48 49
12 33
3 33
10 13
50 51
16 24
7 8
14 17
4 6
25 27
5 20
52 53
11 24
1 16
54 55
56 57
11 19
58 59
6 16
13 25
14 16
6...

result:

ok that's great! (sum n = 277820, sum m = 3000000) (572 test cases)

Test #34:

score: 0
Accepted
time: 2318ms
memory: 37552kb

input:

47
3291 67320
254 1488
111 2438
322 2365
689 1652
368 2650
94 2670
1233 2593
1784 3200
1296 1679
1234 3149
1828 2222
2418 3042
1988 3065
94 1275
394 2968
1328 2585
1132 3055
487 2947
2873 2975
1853 2499
216 477
1052 2382
553 1762
1938 2697
1698 2043
403 2274
35 1030
348 400
1086 1389
1616 3288
1186 ...

output:

Yes
3694 3291
1 44
7 43
48 61
76 77
36 45
78 79
3 67
80 81
13 15
82 83
84 85
39 47
34 47
86 87
88 89
43 60
90 91
92 93
15 30
94 95
96 97
15 46
98 99
100 101
102 103
6 43
2 63
104 105
106 107
108 109
30 72
21 36
110 111
112 113
30 57
114 115
116 117
118 119
120 121
122 123
24 49
1 59
124 125
5 24
126...

result:

ok that's great! (sum n = 98829, sum m = 3000000) (47 test cases)

Test #35:

score: 0
Accepted
time: 2571ms
memory: 32160kb

input:

52
2688 8
453 829
353 453
453 2363
750 2363
797 938
750 2612
797 2612
353 829
226 4143
72 116
94 156
8 205
13 15
44 101
54 101
26 146
2 161
114 139
123 134
24 62
30 153
157 178
65 191
101 139
33 57
148 193
146 159
29 74
70 121
109 136
45 112
112 180
67 215
18 59
82 143
8 155
181 202
55 194
128 174
1...

output:

Yes
5369 2688
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
101 10...

result:

ok that's great! (sum n = 107778, sum m = 3000000) (52 test cases)

Test #36:

score: 0
Accepted
time: 2650ms
memory: 36000kb

input:

41
918 34485
302 692
486 663
461 780
198 810
239 330
272 347
229 769
148 238
144 472
26 837
375 856
220 487
60 561
27 460
10 556
362 666
339 790
608 742
223 830
25 898
640 847
262 311
204 465
328 494
101 344
156 207
621 910
234 726
82 225
51 300
230 615
102 761
82 569
875 901
355 810
271 843
59 841
...

output:

Yes
49 918
1 6
34 40
35 44
17 45
9 44
17 23
5 32
27 28
5 26
9 24
6 46
33 42
3 14
6 38
5 40
11 44
15 28
28 43
18 41
24 46
3 26
36 45
31 44
12 34
26 37
31 48
42 46
6 25
9 26
8 26
1 3
15 48
14 28
19 34
21 25
20 43
6 31
13 28
9 15
13 30
13 33
23 38
6 14
25 28
2 41
23 45
24 41
34 47
7 38
7 26
1 26
5 37
1...

result:

ok that's great! (sum n = 130911, sum m = 3000000) (41 test cases)

Test #37:

score: 0
Accepted
time: 2827ms
memory: 39016kb

input:

38
9054 4
1330 5030
273 6005
6005 6814
5030 7284
7641 169509
4533 6988
3960 4941
1016 5421
5007 7497
3490 5354
3370 6111
1373 6006
727 7194
108 5316
3162 6320
1096 7111
4970 6219
3490 6172
2955 6081
2270 3017
4313 6751
2341 2730
1780 6172
5197 6137
2316 7208
140 3999
820 5815
2471 6288
152 6771
2319...

output:

Yes
18104 9054
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
1...

result:

ok that's great! (sum n = 207979, sum m = 3000000) (38 test cases)

Test #38:

score: 0
Accepted
time: 2780ms
memory: 43260kb

input:

32
9549 184425
3769 8881
3816 7958
2297 5867
5145 9032
3315 5678
6600 8732
8312 8352
3642 9494
5897 7519
1460 9427
1225 6410
1453 5982
1050 7961
649 1897
5873 8095
3907 5533
4687 5272
4464 9432
8738 8848
5347 7853
6529 8852
3947 7530
3319 5086
5177 8403
4198 5137
5201 8602
2370 4742
3136 4068
349 22...

output:

Yes
13712 9549
110 111
112 113
1 99
62 106
114 115
116 117
12 106
118 119
120 121
13 19
122 123
124 125
8 73
126 127
128 129
130 131
15 61
132 133
134 135
49 93
136 137
138 139
140 141
22 26
142 143
144 145
38 93
146 147
148 149
150 151
34 53
72 74
152 153
154 155
47 106
17 86
156 157
158 159
160 16...

result:

ok that's great! (sum n = 179588, sum m = 3000000) (32 test cases)

Test #39:

score: 0
Accepted
time: 2848ms
memory: 40712kb

input:

36
5235 159223
259 858
2592 3667
116 3140
2119 3478
1539 4429
1980 2410
186 1570
2337 4303
206 2332
1894 2176
2177 2258
281 2667
1017 1147
2061 3106
1410 1475
366 2888
845 874
4156 5147
252 4232
735 789
2278 3385
420 5119
1650 3680
472 1868
2647 3843
256 1363
226 3474
473 1770
2901 4580
2113 2119
20...

output:

Yes
5624 5235
1 41
13 23
103 104
38 46
47 59
46 56
31 37
105 106
107 108
12 17
4 73
109 110
111 112
51 113
26 48
22 27
67 68
114 115
116 117
118 119
120 121
122 123
60 75
44 59
72 75
124 125
9 55
34 58
126 127
128 129
34 67
20 38
130 131
23 37
132 133
134 135
136 137
38 56
3 73
138 139
38 61
140 141...

result:

ok that's great! (sum n = 198942, sum m = 3000000) (36 test cases)

Test #40:

score: 0
Accepted
time: 2827ms
memory: 52976kb

input:

33
12395 0
4142 167625
245 1626
547 3180
837 1244
193 1081
347 844
2125 2499
1833 3933
2296 4001
1162 3552
3002 3708
1454 1725
922 3895
534 1546
1424 2540
2866 3320
860 2132
3209 4130
830 3834
17 3451
655 2168
2822 3688
647 3323
3740 3751
3752 3814
1956 2497
2410 3863
2344 3761
2866 3472
535 3064
33...

output:

Yes
24790 12395
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...

result:

ok that's great! (sum n = 293242, sum m = 3000000) (33 test cases)

Test #41:

score: 0
Accepted
time: 2852ms
memory: 51960kb

input:

37
17600 17242
5505 11380
8075 14278
8477 9369
10240 15385
2654 2863
455 9691
12743 16046
12233 16046
8443 11799
62 10414
3295 15778
11143 12290
260 14136
690 5234
6810 16213
9430 10076
7842 11399
8088 10996
1200 14422
7456 16712
11811 13685
7861 10076
12872 15026
4876 13677
5749 8088
8339 16610
57 ...

output:

Yes
34098 17600
50 51
52 53
54 55
56 57
58 59
1 17
60 61
62 63
34 36
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
11 25
98 99
100 101
102 103
104 105
106 107
108 109
110 111
112 113
114 115
116 117
2 22
118 119
120 121
122 123
124 125
126 127
...

result:

ok that's great! (sum n = 299984, sum m = 3000000) (37 test cases)

Test #42:

score: 0
Accepted
time: 2851ms
memory: 51664kb

input:

33
19845 230274
11728 15986
257 4596
503 15990
15022 16543
732 12728
8104 15865
3121 17470
13607 15882
1879 16851
142 2057
10673 11877
9190 14659
11219 18119
7672 14190
266 11912
5651 6060
347 17125
12401 16504
9879 11119
12443 17722
204 12533
13477 14564
5500 11722
5430 15904
6659 11478
18362 18839...

output:

Yes
33170 19845
110 111
112 113
114 115
116 117
118 119
120 121
122 123
124 125
126 127
128 129
130 131
132 133
1 60
36 45
134 135
136 137
138 139
14 94
140 141
142 143
144 145
146 147
148 149
150 151
152 153
154 155
156 157
158 159
160 161
162 163
164 165
166 167
168 169
15 74
45 65
170 171
172 173...

result:

ok that's great! (sum n = 299797, sum m = 3000000) (33 test cases)

Test #43:

score: 0
Accepted
time: 2705ms
memory: 55512kb

input:

32
335 3799
141 214
145 310
103 188
174 269
69 315
261 268
134 257
270 327
9 27
258 307
218 228
307 334
229 250
8 197
61 121
186 232
9 174
67 91
64 174
43 185
58 179
24 92
58 217
16 278
120 240
221 251
27 196
5 160
8 56
161 185
120 222
121 196
187 255
221 228
255 268
114 305
36 306
83 225
223 327
22...

output:

Yes
266 335
1 13
13 15
1 18
14 20
12 19
12 16
7 21
14 21
7 22
29 30
31 32
33 34
11 15
5 21
35 36
11 17
16 17
13 19
37 38
39 40
7 14
11 12
7 12
12 15
41 42
43 44
18 22
2 3
2 19
1 6
3 4
12 21
45 46
5 10
15 20
2 7
47 48
11 14
7 17
6 14
8 22
49 50
7 19
51 52
53 54
55 56
11 20
57 58
59 60
61 62
3 14
1 2
...

result:

ok that's great! (sum n = 300000, sum m = 2847258) (32 test cases)

Test #44:

score: 0
Accepted
time: 3049ms
memory: 62096kb

input:

30
8141 47416
3603 7546
486 5336
4017 7215
1964 5816
1307 4468
3782 5938
2958 7408
4526 5973
3203 7403
6623 7215
3407 7844
816 4367
1382 2555
3508 5938
3407 5817
1580 8017
3546 7352
357 1645
289 5655
4105 7383
3014 7887
4792 6411
167 1719
3125 6237
3014 5488
5740 5796
2928 5655
1368 2048
2697 5945
5...

output:

Yes
14128 8141
1 11
66 67
6 29
68 69
70 71
72 73
74 75
76 77
1 39
78 79
80 81
82 83
84 85
86 87
88 89
90 91
92 93
94 95
96 97
9 46
5 21
98 99
100 101
102 103
104 105
106 107
108 109
110 111
112 113
114 115
33 49
116 117
118 119
120 121
122 123
124 125
14 15
126 127
128 129
5 30
130 131
132 133
134 1...

result:

ok that's great! (sum n = 300000, sum m = 2974703) (30 test cases)

Test #45:

score: 0
Accepted
time: 2667ms
memory: 57660kb

input:

31
27511 200045
14431 27486
3637 20331
868 5552
21451 24334
601 4128
22649 27094
1928 17970
21075 27086
4561 10937
4461 22784
6343 10532
10253 20400
12295 21168
15949 17377
14845 14979
4914 6552
918 27316
19656 20534
4102 15245
5138 16859
1450 11548
13163 19936
6984 7458
13292 16196
3739 5161
20053 ...

output:

No
No
Yes
25854 14399
82 83
84 85
86 87
88 89
90 91
92 93
94 95
96 97
98 99
100 101
102 103
104 105
106 107
108 109
110 111
112 113
114 115
116 117
118 119
120 121
122 123
124 125
126 127
128 129
130 131
132 133
1 72
134 135
136 137
138 139
4 38
140 141
142 143
144 145
43 53
146 147
148 149
150 151
...

result:

ok that's great! (sum n = 300000, sum m = 2998405) (31 test cases)

Test #46:

score: 0
Accepted
time: 1435ms
memory: 12676kb

input:

3450
73 667
1 60
29 55
11 59
20 25
15 47
13 47
15 35
28 71
22 44
7 64
11 49
7 19
11 50
49 53
23 62
36 59
2 3
5 41
10 55
4 38
62 65
30 48
14 25
6 33
22 69
10 11
56 73
4 63
57 65
26 43
22 26
51 56
9 15
61 64
39 67
31 45
23 34
13 50
12 17
14 20
35 48
29 56
24 25
47 57
39 51
43 50
66 73
5 36
35 53
3 15
...

output:

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

result:

ok that's great! (sum n = 285800, sum m = 3000000) (3450 test cases)

Test #47:

score: 0
Accepted
time: 1431ms
memory: 12568kb

input:

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

output:

Yes
10 32
1 4
5 8
3 5
4 8
2 5
4 5
2 4
1 10
1 2
1 3
2 6
5 9
5 6
1 8
2 8
3 8
8 9
2 3
7 10
1 6
3 6
2 10
7 8
6 9
2 9
3 9
5 7
3 4
4 9
1 5
6 7
5 10
Yes
4 2
1 2
3 4
Yes
18 75
1 5
1 2
3 7
2 8
1 12
5 13
5 10
7 12
2 11
5 6
7 10
10 12
4 5
4 10
5 7
2 14
2 12
4 7
5 15
4 11
4 8
4 14
8 13
12 13
4 9
7 8
2 6
6 16
2 ...

result:

ok that's great! (sum n = 257395, sum m = 3000000) (2638 test cases)

Test #48:

score: 0
Accepted
time: 1468ms
memory: 11664kb

input:

2037
83 114
24 82
24 31
24 54
32 57
30 74
24 28
50 74
40 44
15 60
60 67
44 65
44 66
28 53
2 78
28 40
50 69
22 60
69 82
40 57
24 40
65 67
31 82
22 69
53 69
22 74
35 38
69 74
65 66
66 74
44 69
66 78
22 57
37 78
22 50
40 53
2 32
2 37
35 60
32 60
35 57
32 35
15 24
15 57
57 60
2 50
15 32
54 75
30 37
15 3...

output:

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

result:

ok that's great! (sum n = 233764, sum m = 3000000) (2037 test cases)

Test #49:

score: 0
Accepted
time: 1474ms
memory: 11484kb

input:

1813
197 3378
8 132
25 75
156 169
96 148
30 87
81 185
66 177
118 131
50 103
48 135
85 145
105 133
46 173
69 110
122 181
28 108
69 181
43 195
101 155
26 51
117 190
165 171
5 157
31 183
51 195
135 159
44 124
30 74
129 147
49 172
72 159
4 29
142 162
72 76
13 182
18 182
16 161
174 182
20 103
123 191
8 5...

output:

Yes
22 197
1 22
15 18
8 12
4 8
1 18
8 21
6 17
12 13
7 16
1 17
7 15
7 9
2 5
1 8
5 17
11 22
15 17
5 21
3 4
11 17
4 13
10 15
1 2
6 13
13 15
17 20
6 11
1 16
4 22
3 11
1 6
2 18
4 6
4 21
8 20
18 19
4 18
3 12
15 21
9 15
8 16
4 20
5 13
7 8
2 15
16 22
7 14
9 16
13 17
8 10
10 17
1 20
1 10
9 12
13 14
4 11
16 2...

result:

ok that's great! (sum n = 225372, sum m = 3000000) (1813 test cases)

Test #50:

score: 0
Accepted
time: 1402ms
memory: 44376kb

input:

27
16686 64795
3765 7749
226 12234
2556 8932
9341 11404
2025 2717
14273 14800
965 2597
5472 11735
3544 9444
12013 15899
2869 14399
1323 12802
12339 12406
12328 16285
5393 12245
4415 8977
9332 11214
11717 13913
3034 6699
469 1039
11096 11886
1810 3038
9676 12933
1718 8436
8958 10152
6167 14713
2629 1...

output:

Yes
30581 16686
75 76
77 78
79 80
1 3
81 82
83 84
85 86
87 88
89 90
91 92
93 94
95 96
5 37
97 98
99 100
101 102
103 104
105 106
28 54
107 108
109 110
111 112
113 114
115 116
117 118
119 120
121 122
123 124
125 126
127 128
129 130
131 132
133 134
135 136
137 138
139 140
141 142
143 144
145 146
19 68
...

result:

ok that's great! (sum n = 300000, sum m = 1562874) (27 test cases)

Test #51:

score: 0
Accepted
time: 3479ms
memory: 73376kb

input:

24
1516 1694
556 1219
751 1341
1015 1140
394 1253
890 972
34 976
557 913
186 1209
590 1018
647 1140
1405 1460
134 1341
590 1003
169 273
11 140
110 390
489 689
405 1157
286 913
444 751
459 1419
518 1018
518 643
374 848
110 950
932 1102
1296 1392
647 1209
472 1109
74 913
369 950
154 932
74 1157
19 751...

output:

Yes
2800 1516
22 23
24 25
26 27
28 29
30 31
32 33
34 35
36 37
38 39
40 41
1 8
42 43
44 45
46 47
48 49
50 51
52 53
54 55
7 10
56 57
58 59
60 61
62 63
64 65
66 67
68 69
70 71
72 73
74 75
5 21
76 77
78 79
80 81
5 6
82 83
84 85
86 87
88 89
90 91
92 93
94 95
96 97
98 99
100 101
102 103
104 105
12 16
106 ...

result:

ok that's great! (sum n = 299927, sum m = 3000000) (24 test cases)

Test #52:

score: 0
Accepted
time: 3676ms
memory: 83992kb

input:

16
10582 199186
22 1980
1828 7051
288 634
4837 7875
2746 5374
803 4917
8342 9735
2917 6927
5307 9477
5227 6693
4567 6881
4240 10211
103 5626
758 8631
2110 8886
7748 9392
2880 7898
3889 9234
146 1435
530 3758
1548 2972
827 8682
10104 10444
1523 7670
4965 7408
2479 5640
4449 7206
886 5048
6052 7171
39...

output:

Yes
15250 10582
110 111
1 82
112 113
114 115
116 117
41 79
118 119
33 61
120 121
8 62
122 123
24 67
124 125
27 40
126 127
5 52
128 129
130 131
48 64
132 133
134 135
69 109
136 137
138 139
140 141
142 143
33 43
144 145
146 147
42 75
148 149
42 49
150 151
152 153
154 155
156 157
158 159
160 161
162 16...

result:

ok that's great! (sum n = 300000, sum m = 2961875) (16 test cases)

Test #53:

score: 0
Accepted
time: 4568ms
memory: 138804kb

input:

11
21566 516221
6909 17836
10230 21242
114 6607
9127 11384
2716 7314
4443 19172
4649 7485
15656 18157
1182 11931
8997 12637
11709 15455
6655 7695
3377 9063
363 10459
2942 6445
13108 21241
7960 10624
2013 11871
18654 20058
148 15436
12363 21455
2234 15005
499 8082
320 1549
9158 15817
11687 16811
8430...

output:

Yes
32578 21566
125 126
1 61
127 128
18 55
129 130
45 54
131 132
133 134
135 136
137 138
139 140
141 142
143 144
145 146
4 106
147 148
149 150
4 105
8 108
88 100
151 152
36 88
153 154
7 70
155 156
157 158
159 160
161 162
93 95
163 164
165 166
167 168
169 170
65 96
48 50
171 172
173 174
175 176
177 1...

result:

ok that's great! (sum n = 265250, sum m = 3000000) (11 test cases)

Test #54:

score: 0
Accepted
time: 5808ms
memory: 212608kb

input:

14
7801 88
153 2675
316 5402
997 3521
3328 5565
316 7475
6572 6833
997 3345
6459 6891
456 5402
997 5545
2711 6891
6459 6833
2675 3328
2711 5402
316 2685
6459 6572
2711 7761
1262 6833
153 2753
2753 5565
2685 3328
3355 6459
997 2711
456 3345
6572 6891
1262 2675
2711 3345
3328 6833
3540 7475
3345 5545
...

output:

Yes
15566 7801
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
101 102
103 10...

result:

ok that's great! (sum n = 299941, sum m = 3000000) (14 test cases)

Test #55:

score: 0
Accepted
time: 4358ms
memory: 105296kb

input:

21
9463 3482
4249 5310
191 2099
3889 5020
2199 3361
4737 7177
7296 8615
528 8642
1348 1417
2624 5832
2936 8502
4737 7915
1933 8468
2930 6106
5996 8437
859 2273
528 7406
5830 6553
3070 8832
856 7469
1388 6528
461 3907
5742 7920
6206 7892
1180 9229
7296 7915
6946 7177
236 7959
5027 7469
3889 7959
4216...

output:

Yes
18548 9463
23 24
25 26
27 28
29 30
31 32
1 16
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
1 7
87 88
89 90
91 92
93 94
95 96
97 98
99 100
101 102
103 104
105 106
107 108
109 110
1...

result:

ok that's great! (sum n = 300000, sum m = 2999999) (21 test cases)

Test #56:

score: 0
Accepted
time: 4856ms
memory: 154988kb

input:

20
19878 32
3893 16147
10823 14133
3893 6914
5384 17268
8902 15983
438 3669
3893 5384
3893 15983
14133 17268
6914 16147
8902 10823
12005 14133
11691 16147
8902 16147
15983 17268
3669 6914
11691 15983
8902 13770
3893 17268
8902 11691
10823 11691
5384 15983
10823 16147
438 13770
12005 17268
13770 1614...

output:

Yes
39738 19878
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
101 102
103 1...

result:

ok that's great! (sum n = 299996, sum m = 3000000) (20 test cases)

Test #57:

score: 0
Accepted
time: 6069ms
memory: 208228kb

input:

18
462 12605
129 462
19 68
88 307
101 140
140 318
347 360
86 193
68 155
377 416
257 328
383 400
390 444
46 320
396 398
86 237
211 403
56 397
294 422
34 114
95 175
268 394
217 369
14 411
71 277
154 442
85 413
64 400
94 350
280 352
107 310
273 319
40 167
80 424
6 39
238 334
249 428
248 346
185 259
202...

output:

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

result:

ok that's great! (sum n = 299987, sum m = 3000000) (18 test cases)

Test #58:

score: 0
Accepted
time: 5204ms
memory: 162096kb

input:

17
50097 200421
17256 37403
10923 36257
7188 49287
7680 22079
1233 42840
29920 48596
19390 47941
37717 44604
3768 48253
37598 44224
21756 24145
32625 33796
28533 48253
18784 36476
18918 21060
11551 36875
1473 35053
38575 48184
24646 28868
8155 45473
29952 36440
18711 36337
30688 43015
10902 35194
21...

output:

Yes
94286 50097
116 117
118 119
120 121
122 123
124 125
126 127
128 129
130 131
132 133
134 135
136 137
138 139
140 141
142 143
144 145
146 147
148 149
150 151
152 153
154 155
156 157
158 159
160 161
162 163
164 165
1 68
166 167
168 169
170 171
172 173
174 175
176 177
178 179
180 181
182 183
184 185...

result:

ok that's great! (sum n = 300000, sum m = 2991933) (17 test cases)

Test #59:

score: 0
Accepted
time: 5088ms
memory: 134560kb

input:

18
12119 1247
6217 8133
6771 7404
3345 7816
7682 11857
1847 8528
627 8578
5241 9426
6814 7840
726 9100
3864 11634
6999 11221
3209 11410
3966 10478
6771 7100
3738 11297
1732 5829
5241 8896
7841 11634
4280 9776
2959 5642
5642 8628
3891 8209
6051 7443
7898 11033
4039 5689
4442 5439
2256 3521
4607 11578...

output:

Yes
24045 12119
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 101
102 103
104 105
106 107
108 109
110 111
11...

result:

ok that's great! (sum n = 300000, sum m = 2999999) (18 test cases)

Test #60:

score: 0
Accepted
time: 6210ms
memory: 198436kb

input:

11
11 24
9 10
5 6
1 7
1 2
4 10
4 7
6 11
7 8
6 10
10 11
1 4
5 10
4 9
5 11
1 3
7 11
2 7
2 4
3 7
5 9
4 11
3 8
1 11
2 11
77622 390427
19664 67006
27296 52166
59603 69655
19776 52166
40360 50475
51555 53913
45852 50025
20741 61112
6626 59877
28135 40844
37061 65119
19472 69173
3045 59950
66200 73719
1202...

output:

Yes
9 11
1 3
1 7
2 3
1 4
5 6
5 8
1 2
2 9
4 6
4 5
1 5
Yes
146154 77622
124 125
126 127
128 129
130 131
132 133
134 135
136 137
138 139
140 141
142 143
144 145
146 147
148 149
150 151
152 153
154 155
1 75
156 157
158 159
2 55
160 161
162 163
164 165
166 167
168 169
170 171
172 173
174 175
176 177
178 ...

result:

ok that's great! (sum n = 300000, sum m = 2999852) (11 test cases)

Test #61:

score: 0
Accepted
time: 6023ms
memory: 178744kb

input:

14
14 31
7 13
3 14
12 14
4 9
3 9
4 11
11 13
4 7
5 14
2 10
10 14
6 8
2 14
4 13
7 10
2 12
10 12
7 9
7 12
5 12
1 8
7 14
2 3
3 5
6 11
10 13
9 13
10 11
2 7
2 9
4 6
475 13283
104 339
236 390
131 337
266 459
286 318
161 315
222 327
15 402
81 398
141 278
92 230
84 265
28 40
239 395
233 430
144 343
124 377
2...

output:

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

result:

ok that's great! (sum n = 300000, sum m = 2999901) (14 test cases)

Test #62:

score: 0
Accepted
time: 5479ms
memory: 136804kb

input:

13
5657 6666
2347 3929
2907 3432
3929 4681
1414 4927
2758 5091
87 3642
253 515
2393 3048
3569 5343
470 4358
4248 5454
847 4084
2392 3656
2721 4347
1623 4113
756 5584
1951 2700
1202 4828
4552 4565
1718 4936
1077 4059
3106 3376
671 4861
135 1466
3722 5369
1926 3504
2538 5059
500 1267
1127 3071
604 442...

output:

Yes
10697 5657
38 39
40 41
42 43
44 45
46 47
48 49
1 8
50 51
52 53
54 55
56 57
58 59
60 61
62 63
64 65
66 67
8 19
68 69
70 71
72 73
74 75
76 77
78 79
80 81
3 5
82 83
84 85
86 87
88 89
90 91
92 93
94 95
10 20
96 97
98 99
100 101
102 103
104 105
106 107
108 109
110 111
112 113
114 115
116 117
118 119
...

result:

ok that's great! (sum n = 300000, sum m = 2999904) (13 test cases)

Test #63:

score: 0
Accepted
time: 5344ms
memory: 153788kb

input:

16
1030 68
366 901
366 393
31 84
142 803
640 901
568 863
393 803
366 803
568 640
184 803
574 803
568 803
84 224
224 863
31 411
31 224
342 574
393 607
184 977
142 692
692 977
84 366
313 640
607 901
253 393
803 977
142 977
313 574
142 574
313 411
84 568
84 253
253 607
31 142
342 411
84 142
224 253
184...

output:

Yes
2030 1030
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
1 9
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
101 102
103...

result:

ok that's great! (sum n = 300000, sum m = 2999941) (16 test cases)

Test #64:

score: 0
Accepted
time: 5355ms
memory: 147172kb

input:

21
128830 194705
2707 21887
96471 109999
17543 72201
32975 109831
14568 93566
37840 80840
112962 121466
49785 70320
65358 113338
9272 41267
39569 121414
29764 117123
83116 105486
32383 97753
59725 82053
2707 49079
76894 121836
69814 78799
106885 115539
446 124699
102142 103139
24261 37014
47453 5293...

output:

Yes
251815 128830
111 112
113 114
115 116
117 118
119 120
121 122
123 124
125 126
127 128
129 130
131 132
133 134
1 36
135 136
137 138
139 140
141 142
143 144
145 146
147 148
149 150
151 152
153 154
155 156
157 158
159 160
161 162
163 164
165 166
167 168
169 170
171 172
173 174
175 176
177 178
179 1...

result:

ok that's great! (sum n = 300000, sum m = 2999811) (21 test cases)

Test #65:

score: 0
Accepted
time: 5150ms
memory: 152976kb

input:

15
8 1
2 3
2 0
52 1
20 34
2 0
2146 838
561 848
833 1754
1343 2036
135 2029
638 647
1611 2030
459 2029
184 1061
274 1917
945 1178
135 1150
538 561
884 1732
343 833
39 144
184 2036
281 1611
184 538
449 1584
229 1369
281 1868
145 1369
229 2030
518 2075
538 1536
1190 1948
1150 1582
184 511
667 1061
1274...

output:

Yes
15 8
2 3
1 4
1 5
6 7
8 9
10 11
12 13
14 15
Yes
4 2
1 2
3 4
Yes
103 52
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
1 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
1 67
68 69
70 71
72 73
74 75
76 77
78...

result:

ok that's great! (sum n = 300000, sum m = 2999999) (15 test cases)

Test #66:

score: 0
Accepted
time: 5451ms
memory: 160756kb

input:

16
1 0
25532 90615
1799 19462
593 15854
10358 12719
7127 13104
3630 19017
7744 21425
15182 25485
9074 11894
44 9485
8459 9914
3341 16988
2363 7796
6905 15487
6828 8418
257 14087
18019 22473
3144 18882
5671 10411
11169 23470
10063 20838
3758 18367
3402 21904
4266 14240
11048 23242
21511 23108
12719 1...

output:

Yes
2 1
1 2
Yes
47550 25532
86 87
88 89
1 63
90 91
92 93
94 95
96 97
98 99
100 101
102 103
104 105
106 107
108 109
110 111
112 113
114 115
116 117
118 119
120 121
122 123
33 71
124 125
126 127
128 129
130 131
132 133
134 135
136 137
138 139
140 141
142 143
144 145
146 147
148 149
150 151
152 153
154...

result:

ok that's great! (sum n = 300000, sum m = 2852224) (16 test cases)

Test #67:

score: 0
Accepted
time: 6832ms
memory: 222024kb

input:

11
55 237
38 53
5 30
47 55
12 30
20 21
1 54
1 26
6 55
1 38
41 55
8 33
42 43
6 12
1 20
10 22
17 34
19 38
50 51
26 38
10 52
8 25
3 43
6 10
13 50
10 30
22 40
10 25
3 5
18 42
1 8
30 45
5 31
13 42
41 54
31 33
6 40
35 47
34 42
22 55
21 22
3 19
51 53
17 38
31 45
34 35
3 17
22 30
19 34
6 34
47 50
42 45
21 4...

output:

Yes
46 55
1 9
6 8
5 8
12 13
5 7
5 10
14 15
1 3
16 17
6 10
18 19
10 20
8 9
21 22
23 24
25 26
5 6
1 8
3 5
1 7
2 7
2 10
2 6
27 28
3 10
7 9
29 30
31 32
33 34
7 10
6 7
11 35
3 6
4 5
3 4
36 37
38 39
5 9
40 41
9 10
1 5
4 8
2 8
42 43
7 8
4 10
2 3
11 44
45 46
2 9
6 9
4 6
3 9
1 2
2 5
Yes
8 6
1 2
4 5
3 6
7 8
2...

result:

ok that's great! (sum n = 300000, sum m = 2999992) (11 test cases)

Test #68:

score: 0
Accepted
time: 4965ms
memory: 137440kb

input:

15
38002 1578639
25652 36001
12874 21272
3217 7981
417 29158
20168 34327
884 2535
16158 19576
5505 16571
9724 23070
23720 23926
1422 11092
9265 29283
2139 29226
13210 13803
21059 22393
9059 16256
3159 33001
17427 32151
21277 36591
28091 28432
9215 22662
7381 35295
13120 28747
2333 33148
22753 28842
...

output:

Yes
53475 38002
169 170
171 172
173 174
1 111
175 176
106 156
133 157
177 178
179 180
181 182
183 184
185 186
187 188
189 190
191 192
193 194
195 196
197 198
199 200
201 202
203 204
205 206
11 67
207 208
74 150
209 210
211 212
18 163
213 214
137 157
215 216
127 150
217 218
19 118
58 139
219 220
130 ...

result:

ok that's great! (sum n = 300000, sum m = 2628253) (15 test cases)

Test #69:

score: 0
Accepted
time: 5715ms
memory: 137144kb

input:

12
1846 7280
770 1163
129 1280
474 909
968 1567
28 1808
288 853
7 1496
1295 1566
225 766
942 1212
28 1191
70 103
860 1106
1363 1724
261 1212
24 523
1090 1188
696 1234
24 1698
305 572
654 1177
1092 1842
1652 1675
383 698
803 1675
268 729
460 485
1051 1098
588 949
86 1719
1062 1352
819 1357
588 1712
6...

output:

Yes
3044 1846
34 35
36 37
38 39
40 41
42 43
44 45
1 18
8 33
46 47
48 49
50 51
52 53
54 55
16 17
56 57
58 59
60 61
62 63
6 28
64 65
5 13
66 67
68 69
9 18
70 71
72 73
74 75
21 24
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 101
8 21
102 103
14 17
104 105
106 107
3 24
108...

result:

ok that's great! (sum n = 300000, sum m = 2999572) (12 test cases)

Test #70:

score: 0
Accepted
time: 6315ms
memory: 193100kb

input:

15
1 0
15 2
4 9
9 13
8682 187
23 3290
151 7904
2816 6885
481 7618
1205 2816
481 6655
4534 6841
151 6885
5837 8277
6217 6814
7618 8515
6841 7771
41 4839
481 4128
827 6885
6217 7798
3617 8277
6655 8515
6655 8580
3290 6841
1205 7771
6841 7570
41 3617
6814 7618
3617 7618
4128 4534
7798 7904
827 6245
790...

output:

Yes
2 1
1 2
Yes
28 15
3 4
5 6
7 8
1 9
10 11
12 13
14 15
16 17
1 2
18 19
20 21
22 23
2 24
25 26
27 28
Yes
17308 8682
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
1 9
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
...

result:

ok that's great! (sum n = 300000, sum m = 2999998) (15 test cases)

Test #71:

score: 0
Accepted
time: 1104ms
memory: 56676kb

input:

12
229 4389
17 153
51 77
17 172
95 193
32 64
10 172
73 138
60 195
98 209
24 112
9 212
82 143
3 209
14 82
97 154
163 185
7 57
47 139
38 50
105 160
37 177
65 146
87 151
20 83
39 192
87 148
6 220
107 216
18 166
161 191
5 29
35 99
46 183
85 166
4 94
31 66
13 198
171 196
199 214
29 212
10 108
25 90
75 21...

output:

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

result:

ok that's great! (sum n = 300000, sum m = 726112) (12 test cases)

Test #72:

score: 0
Accepted
time: 6121ms
memory: 180508kb

input:

7
49 391
6 39
24 38
3 25
13 16
11 12
4 7
29 37
30 45
13 37
31 41
25 26
23 39
37 44
22 32
18 41
21 48
2 12
31 49
16 47
12 40
7 13
3 39
11 40
6 13
26 31
1 28
18 20
42 47
1 40
24 47
8 47
39 42
3 27
20 45
2 14
25 48
21 47
15 49
13 33
9 38
43 47
24 42
8 25
1 34
27 34
8 11
10 20
21 33
26 49
14 36
11 20
6 ...

output:

Yes
13 49
1 8
4 7
6 7
3 6
6 10
2 9
3 9
8 9
1 6
4 9
7 9
1 7
2 3
7 11
4 10
3 4
3 10
2 10
5 7
9 10
6 8
2 5
7 12
3 5
6 9
5 9
7 8
1 2
1 4
10 11
5 6
5 8
2 8
4 8
1 5
7 10
2 4
1 3
2 7
1 9
5 10
3 7
8 10
4 6
1 10
11 13
3 8
2 6
4 5
Yes
6 5
1 2
1 3
3 4
3 5
2 6
Yes
9 6
4 5
1 6
3 7
2 8
1 2
3 9
Yes
73 1734
1 18
33...

result:

ok that's great! (sum n = 300000, sum m = 2899616) (7 test cases)

Test #73:

score: 0
Accepted
time: 2507ms
memory: 99644kb

input:

15
50 391
21 36
11 48
15 45
33 46
20 44
6 22
4 49
6 7
12 47
25 27
22 29
5 43
4 9
16 27
38 49
16 19
17 48
1 38
12 24
4 10
11 12
38 45
4 42
14 49
20 42
16 33
13 32
1 3
25 45
7 48
7 26
11 17
1 16
42 45
15 26
3 27
14 22
1 14
28 41
18 26
31 43
2 36
3 50
14 31
28 32
8 46
13 35
27 37
2 4
15 46
43 49
30 41
...

output:

Yes
15 50
1 5
7 9
5 7
8 9
8 10
1 10
3 10
3 12
5 8
7 8
2 10
2 9
4 7
1 7
3 13
5 6
5 10
3 6
1 6
8 11
1 9
7 10
11 14
2 5
3 4
3 9
4 5
2 4
6 10
4 8
6 7
4 6
3 5
2 6
3 7
5 9
4 10
1 2
4 9
1 4
2 8
3 8
6 8
11 15
2 3
1 3
6 9
9 10
1 8
2 7
Yes
10 37
1 8
4 5
6 7
1 9
5 6
1 5
2 8
6 8
3 6
4 9
1 3
5 10
2 4
4 7
6 10
3 ...

result:

ok that's great! (sum n = 300000, sum m = 1515620) (15 test cases)

Test #74:

score: 0
Accepted
time: 6006ms
memory: 154268kb

input:

14
6349 16835
2332 2536
220 1974
1319 1525
264 3678
658 2667
644 1329
3364 3903
996 6257
1737 4391
1531 4924
2400 4151
1555 2816
106 1467
167 730
1044 6159
1044 2624
819 3101
404 2633
1172 4066
3595 5313
2438 4483
3999 4264
503 6319
2962 3873
395 3002
1180 1510
3474 4483
1558 5503
911 3744
1905 3346...

output:

Yes
11592 6349
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
1 19
75 76
77 78
79 80
81 82
28 43
83 84
85 86
87 88
89 90
91 92
93 94
95 96
97 98
99 100
101 102
103 104
105 106
107 108
109 110
111 112
113 114
4 35
115 116
4 24
117 118
119 120
121 122
123 124
125 126
127 128
1...

result:

ok that's great! (sum n = 300000, sum m = 2999825) (14 test cases)

Test #75:

score: 0
Accepted
time: 4248ms
memory: 93268kb

input:

20
285 5617
141 184
21 64
126 191
14 194
36 155
55 260
8 150
79 267
82 216
15 164
18 57
110 263
21 85
33 235
54 260
133 191
162 181
40 128
176 205
87 158
114 135
189 237
42 133
72 279
156 179
160 272
61 190
67 154
13 149
67 213
21 69
92 96
222 239
247 269
163 196
148 187
21 101
174 238
15 64
72 251
...

output:

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

result:

ok that's great! (sum n = 300000, sum m = 2844468) (20 test cases)

Test #76:

score: 0
Accepted
time: 5614ms
memory: 163164kb

input:

16
20 14
11 13
12 16
11 12
1 7
10 11
12 20
7 16
8 13
11 16
10 13
2 5
10 20
8 18
1 5
81 0
2 0
9774 1735
1799 4654
7415 9367
256 2632
1641 3188
6162 9643
5876 7934
1453 6567
2360 7737
1453 2360
2360 8691
4905 6638
7156 9506
7215 8948
5915 7251
4896 5798
2943 6732
8611 9358
5851 7418
4407 7146
2857 331...

output:

Yes
28 20
1 2
3 11
12 13
14 15
2 3
16 17
1 4
9 10
18 19
7 8
5 8
5 6
8 9
20 21
22 23
4 5
24 25
10 26
27 28
6 7
Yes
162 81
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...

result:

ok that's great! (sum n = 300000, sum m = 2999994) (16 test cases)

Test #77:

score: 0
Accepted
time: 5579ms
memory: 182800kb

input:

1
300000 2358937
192970 272531
122003 158946
255691 294793
51704 262865
119440 279146
225321 249954
19066 125336
14150 36379
80261 112311
141995 285858
8085 290445
229184 241830
11762 99234
100623 282678
41309 235346
56578 189172
104864 257299
53620 94547
178788 267251
193551 209443
103157 265506
94...

output:

Yes
67840 300000
1 10
11 15
21 24
31 39
41 47
51 57
61 67
71 80
81 89
91 99
101 107
111 116
121 126
131 139
141 149
151 154
161 164
171 173
181 184
191 197
201 205
211 214
221 227
231 239
241 246
251 253
261 268
271 279
281 285
291 295
301 304
311 313
321 329
331 339
341 347
351 356
361 369
371 378
...

result:

ok that's great! (sum n = 300000, sum m = 2358937) (1 test case)

Test #78:

score: 0
Accepted
time: 4625ms
memory: 153856kb

input:

1
300000 1781686
13025 190261
84725 234810
188596 237589
38327 68414
98803 157541
279323 295616
14945 42759
243383 275922
53713 245122
204079 239143
279976 288799
83977 278200
4264 234285
93946 230838
47657 285885
34943 188576
102912 290759
131129 297261
256544 266501
117373 209052
43541 211692
5269...

output:

Yes
86592 300000
1 8
9 12
17 19
25 32
33 40
41 47
49 55
57 59
65 69
73 76
81 85
89 95
97 100
105 109
113 119
121 125
129 133
137 141
145 152
153 160
161 167
169 175
177 181
185 192
193 198
201 203
209 212
217 222
225 232
233 235
241 243
249 253
257 261
265 270
273 279
281 285
289 292
297 301
305 308...

result:

ok that's great! (sum n = 300000, sum m = 1781686) (1 test case)

Test #79:

score: 0
Accepted
time: 3792ms
memory: 139344kb

input:

1
300000 1489093
54281 161757
151437 170800
233227 262742
146464 279261
6081 267018
12408 107225
134242 239388
157334 186176
37979 271117
1869 290413
84712 229550
104055 288777
171988 194446
13644 112526
21610 92365
106034 280324
15355 277732
4610 190422
73331 172190
262301 298765
29358 178369
4787 ...

output:

Yes
100737 300000
1 4
8 12
15 18
22 25
29 31
36 41
43 46
50 56
57 62
64 69
71 73
78 81
85 89
92 94
99 103
106 109
113 119
120 125
127 131
134 140
141 145
148 150
155 161
162 167
169 173
176 179
183 185
190 192
197 199
204 206
211 214
218 223
225 230
232 236
239 241
246 248
253 255
260 262
267 269
27...

result:

ok that's great! (sum n = 300000, sum m = 1489093) (1 test case)

Test #80:

score: 0
Accepted
time: 2712ms
memory: 100248kb

input:

1
300000 1194883
118485 232473
35012 138129
52888 283792
179619 232869
94054 276522
32928 235656
126988 156346
74875 146533
5421 265324
22229 130205
59894 282610
155998 287675
69677 121057
82250 186169
15887 125442
69794 169396
66423 208201
270576 274356
217125 293447
6743 143984
78141 119720
9895 2...

output:

Yes
120516 300000
1 4
7 12
13 16
19 24
25 28
31 34
37 41
43 48
49 54
55 60
61 66
67 70
73 75
79 82
85 87
91 96
97 100
103 105
109 113
115 117
121 123
127 131
133 137
139 143
145 149
151 155
157 160
163 168
169 174
175 177
181 183
187 192
193 198
199 203
205 207
211 216
217 219
223 225
229 234
235 23...

result:

ok that's great! (sum n = 300000, sum m = 1194883) (1 test case)

Test #81:

score: 0
Accepted
time: 2109ms
memory: 85148kb

input:

1
300000 898538
172285 249431
53612 187993
218182 265023
48489 129543
195702 246863
1015 253783
156535 285915
67873 148750
110331 182404
155830 260458
42677 44704
121370 194959
141338 178252
152162 195914
141544 267451
203794 259221
204923 245267
7813 154305
113610 251746
117918 196488
33018 137733
...

output:

Yes
150245 300000
1 5
6 10
11 15
16 18
21 25
26 30
31 33
36 39
41 44
46 48
51 53
56 60
61 65
66 68
71 75
76 79
81 85
86 90
91 94
96 100
101 104
106 110
111 115
116 120
121 123
126 129
131 134
136 139
141 145
146 149
151 154
156 159
161 163
166 169
171 174
176 179
181 183
186 188
191 194
196 198
201 ...

result:

ok that's great! (sum n = 300000, sum m = 898538) (1 test case)

Test #82:

score: 0
Accepted
time: 1299ms
memory: 60900kb

input:

1
300000 600000
239662 259691
230742 268433
106625 186331
117262 225446
151387 188549
5891 268935
132070 167798
12164 77229
22281 213489
103176 276167
129592 138756
133869 281235
203857 268132
215749 255764
46566 256138
146949 298278
123319 267880
260179 260986
53042 296172
16501 120402
178747 18003...

output:

Yes
200000 300000
1 2
5 6
9 10
13 14
17 18
21 22
25 26
29 30
33 34
37 38
41 42
45 46
49 50
53 54
57 58
61 62
65 66
69 70
73 74
77 78
81 82
85 86
89 90
93 94
97 98
101 102
105 106
109 110
113 114
117 118
121 122
125 126
129 130
133 134
137 138
141 142
145 146
149 150
153 154
157 158
161 162
165 166
1...

result:

ok that's great! (sum n = 300000, sum m = 600000) (1 test case)

Test #83:

score: 0
Accepted
time: 6847ms
memory: 227316kb

input:

1
2601 3000000
454 976
234 689
1712 2330
1272 2243
621 916
297 1877
299 870
533 1434
879 886
1058 1729
1593 1602
1000 1102
262 2505
793 1207
273 669
1213 1379
1356 1781
397 1045
154 1478
1951 2378
262 2555
1113 2359
1325 2085
267 1959
874 1154
15 1582
327 2331
665 2382
1154 1917
1951 2266
500 1520
1...

output:

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

result:

ok that's great! (sum n = 2601, sum m = 3000000) (1 test case)

Test #84:

score: 0
Accepted
time: 2775ms
memory: 100464kb

input:

1
300000 1199986
23493 32550
36076 221019
108969 226559
101758 232138
89276 126162
52445 298481
37211 158136
5475 298576
73063 179708
196899 222752
82191 278193
28564 299914
118062 279866
224022 264693
175733 220576
45396 126785
103885 180165
199892 275712
119150 175677
26483 259790
130288 278612
35...

output:

Yes
333334 300000
1 33335
2 33336
3 33337
4 33338
5 33339
6 33340
7 33341
8 33342
9 33343
10 33344
11 33345
12 33346
13 33347
14 33348
15 33349
16 33350
17 33351
18 33352
19 33353
20 33354
21 33355
22 33356
23 33357
24 33358
25 33359
26 33360
27 33361
28 33362
29 33363
30 33364
31 33365
32 33366
33 ...

result:

ok that's great! (sum n = 300000, sum m = 1199986) (1 test case)

Test #85:

score: 0
Accepted
time: 2197ms
memory: 85316kb

input:

1
300000 899997
83066 195271
44035 235685
57164 69859
14388 122905
14052 238855
159852 187079
173800 215504
3391 168022
118099 173989
242789 283302
94115 174482
65972 158796
35988 65246
51756 222035
134066 146499
249740 255189
97916 239217
1221 249547
195778 260085
3924 64005
133021 169075
85032 209...

output:

Yes
342858 300000
1 42858
2 42859
3 42860
4 42861
5 42862
6 42863
7 42864
8 42865
9 42866
10 42867
11 42868
12 42869
13 42870
14 42871
15 42872
16 42873
17 42874
18 42875
19 42876
20 42877
21 42878
22 42879
23 42880
24 42881
25 42882
26 42883
27 42884
28 42885
29 42886
30 42887
31 42888
32 42889
33 ...

result:

ok that's great! (sum n = 300000, sum m = 899997) (1 test case)

Test #86:

score: 0
Accepted
time: 2061ms
memory: 60820kb

input:

1
300000 600000
18866 27449
67750 265792
61732 116658
63433 204041
110602 202919
85043 265195
68399 279259
72457 297321
137482 164904
16433 115336
8162 138443
282613 288657
5960 55715
114972 163995
41300 141413
77711 175290
60781 128692
75953 263491
186082 186513
59919 119242
1095 67848
31902 285092...

output:

Yes
360000 300000
1 60001
2 60002
3 60003
4 60004
5 60005
6 60006
7 60007
8 60008
9 60009
10 60010
11 60011
12 60012
13 60013
14 60014
15 60015
16 60016
17 60017
18 60018
19 60019
20 60020
21 60021
22 60022
23 60023
24 60024
25 60025
26 60026
27 60027
28 60028
29 60029
30 60030
31 60031
32 60032
33 ...

result:

ok that's great! (sum n = 300000, sum m = 600000) (1 test case)

Test #87:

score: 0
Accepted
time: 564ms
memory: 37976kb

input:

1
300000 300000
30505 245964
33493 82262
102022 186324
82795 182598
904 177691
83940 115813
6420 286314
97982 145863
138139 153161
119685 128483
31141 248856
158109 259343
99699 157038
92610 246606
148340 162285
199598 285320
127451 267647
58072 124517
75430 133694
53195 246223
131827 144744
97612 2...

output:

Yes
300000 300000
1 2
4 5
7 8
10 11
13 14
16 17
19 20
22 23
25 26
28 29
31 32
34 35
37 38
40 41
43 44
46 47
49 50
52 53
55 56
58 59
61 62
64 65
67 68
70 71
73 74
76 77
79 80
82 83
85 86
88 89
91 92
94 95
97 98
100 101
103 104
106 107
109 110
112 113
115 116
118 119
121 122
124 125
127 128
130 131
13...

result:

ok that's great! (sum n = 300000, sum m = 300000) (1 test case)