QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#334170#7222. The Great Huntricky_linTL 1ms6128kbC++141.6kb2024-02-21 12:14:422024-02-21 12:14:42

Judging History

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

  • [2024-02-21 12:14:42]
  • 评测
  • 测评结果:TL
  • 用时:1ms
  • 内存:6128kb
  • [2024-02-21 12:14:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int NN = 1e4 + 8; 
int n;
inline int read(){
	register char c = getchar();
	register int res = 0;
	while(!isdigit(c)) c = getchar();
	while(isdigit(c)) res = res * 10 + c - '0',c = getchar();
	return res;
}
struct Edge{
	int to,next;
}edge[NN << 1];
int head[NN],cnt;
void init(){
	memset(head,-1,sizeof(head));
	cnt = 1;
}
void add_edge(int u,int v){
	edge[++cnt] = {v,head[u]};
	head[u] = cnt;
}

int fa[NN],dep[NN];
void dfs(int u,int father){
	fa[u] = father;
	dep[u] = dep[father] + 1;
	for(int i = head[u]; i != -1; i = edge[i].next){
		int v = edge[i].to;
		if(v == father) continue;
		dfs(v,u);
	}
}

bitset<NN> e[NN];
int p[NN],rev[NN];
bitset<NN> vis;

inline bool match(int u){
	bitset<NN> now = e[u] & vis;
	for(int v = now._Find_first(); v != NN; v = now._Find_next(v)){
		vis.reset(v);
		int x = p[v];
		if(x){
			if(match(x)){
				p[v] = u;
				return true;
			}
		}
		else{
			p[v] = u;
			return true;
		}
	}
	return false;
}

int main(){
	n = read();
	init();
	for(int i = 1,u,v; i < n; ++i){
		u = read();v = read();
		add_edge(u,v);add_edge(v,u);
	}
	dfs(1,0);
	for(int i = 1,u,v; i <= n; ++i){
		u = read();v = read();
		if(dep[u] < dep[v]) swap(u,v);
		
		while(dep[u] > dep[v]) e[i].set(u),u = fa[u];
		while(u != v) e[i].set(u),e[i].set(v),u = fa[u],v = fa[v];
		e[i].set(u);
		vis.set();
		if(!match(i)){
			puts("No");
			return 0;
		}
	}
	
	puts("Yes");
	for(int i = 1; i <= n; ++i) rev[p[i]] = i;
	for(int i = 1; i <= n; ++i) printf("%d ",rev[i]);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

10
2 1
3 1
6 1
8 2
4 3
9 6
5 4
7 8
10 7
8 7
10 2
7 2
10 1
3 1
5 2
5 1
6 1
9 2
3 4

output:

Yes
8 10 7 2 1 5 4 6 9 3 

result:

ok 

Test #2:

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

input:

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

output:

No

result:

ok 

Test #3:

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

input:

100
19 1
49 19
13 49
5 13
98 5
27 98
76 27
38 76
67 38
14 67
75 14
44 75
9 44
45 9
82 45
57 82
16 57
18 16
37 18
3 37
50 3
42 50
32 42
60 32
48 60
10 48
90 10
93 90
25 93
94 25
78 94
51 78
40 51
86 40
85 86
23 85
87 23
83 87
7 83
28 7
88 28
2 88
56 2
47 56
79 47
97 79
95 97
39 95
73 39
55 73
8 55
46...

output:

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

result:

ok 

Test #4:

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

input:

100
71 1
3 71
19 3
96 19
68 96
18 68
76 18
67 76
59 67
9 59
81 9
46 81
94 46
95 94
87 95
93 87
33 93
61 33
69 61
37 69
23 37
36 23
90 36
54 90
51 54
50 51
91 50
34 91
45 34
64 45
48 64
12 48
78 12
75 78
16 75
39 16
28 39
58 28
92 58
82 92
77 82
11 77
72 11
24 72
44 24
57 44
55 57
17 55
7 17
10 7
53 ...

output:

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

result:

ok 

Test #5:

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

input:

100
29 1
3 1
41 1
87 1
86 1
35 1
67 1
45 1
84 1
4 1
16 1
26 1
64 1
53 1
69 1
57 1
6 1
43 1
100 1
21 1
79 1
80 1
54 1
2 1
99 1
81 1
59 1
97 1
74 1
75 1
71 1
44 1
34 1
88 1
65 1
31 1
66 1
85 1
8 1
47 1
24 1
42 1
30 1
82 1
51 1
58 1
93 1
52 1
72 1
17 1
20 1
40 1
36 1
9 1
78 1
62 1
61 1
89 1
33 1
76 1
9...

output:

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

result:

ok 

Test #6:

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

input:

100
81 1
74 1
65 1
22 1
33 1
99 1
93 1
59 1
88 1
78 1
20 1
51 1
57 1
43 1
35 1
17 1
32 1
18 1
30 1
31 1
76 1
6 1
39 1
16 1
12 1
21 1
62 1
91 1
50 1
71 1
46 1
53 1
63 1
75 1
41 1
42 1
83 1
72 1
90 1
98 1
64 1
61 1
45 1
9 1
77 1
4 1
47 1
49 1
2 1
25 1
66 1
28 1
73 1
60 1
56 1
11 1
80 1
3 1
58 1
87 1
8...

output:

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

result:

ok 

Test #7:

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

input:

100
11 1
91 11
99 91
63 99
59 63
97 59
52 97
49 52
29 49
23 29
30 23
88 30
6 88
45 6
47 45
22 47
70 22
90 70
76 90
60 76
93 60
36 93
27 36
100 27
24 100
65 24
9 65
87 9
17 87
18 17
84 18
72 84
10 72
78 10
54 78
95 54
58 95
51 58
66 51
42 66
21 42
67 21
41 67
15 41
55 15
50 55
96 50
86 96
43 86
44 43...

output:

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

result:

ok 

Test #8:

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

input:

100
53 1
58 53
99 58
25 99
13 25
17 13
71 17
4 71
93 4
47 93
57 47
34 57
85 34
87 85
49 87
100 49
62 100
76 62
65 76
31 65
89 31
81 89
83 81
35 83
56 35
55 56
43 55
26 43
86 26
41 86
51 41
22 51
63 22
14 63
90 14
91 90
44 91
70 44
52 70
40 52
94 40
73 94
77 73
30 77
88 30
38 88
84 38
29 84
97 29
2 9...

output:

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

result:

ok 

Test #9:

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

input:

100
64 1
88 1
8 1
18 1
65 1
47 1
21 1
100 1
58 1
6 1
97 1
55 1
20 1
90 1
95 1
34 1
51 1
94 1
85 1
98 1
72 1
19 1
68 1
32 1
69 1
44 1
25 1
49 1
29 1
30 1
23 1
10 1
53 1
99 1
70 1
93 1
33 1
75 1
92 1
41 1
60 1
27 1
87 1
43 1
3 1
61 1
96 1
81 1
24 1
7 1
78 1
66 1
91 1
28 1
82 1
84 1
2 1
45 1
37 1
17 1
...

output:

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

result:

ok 

Test #10:

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

input:

100
83 1
7 1
67 1
89 1
99 1
27 1
24 1
41 1
25 1
51 1
3 1
26 1
61 1
87 1
73 1
23 1
75 1
69 1
48 1
63 1
94 1
84 1
97 1
43 1
93 1
47 1
55 1
71 1
31 1
2 1
90 1
6 1
91 1
46 1
13 1
80 1
54 1
32 1
50 1
28 1
57 1
77 1
22 1
29 1
95 1
8 1
68 1
86 1
65 1
30 1
34 1
36 1
70 1
92 1
21 1
42 1
40 1
19 1
52 1
56 1
7...

output:

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

result:

ok 

Test #11:

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

input:

100
84 1
12 84
59 12
14 59
96 14
5 96
9 5
17 9
67 17
15 67
7 15
48 7
46 48
93 46
70 93
61 70
37 61
57 37
60 57
43 60
89 43
54 89
26 54
95 26
72 95
29 72
87 29
99 87
24 99
90 24
3 90
52 3
85 52
28 85
30 28
78 30
75 78
53 75
55 53
31 55
6 31
82 6
25 82
11 25
13 11
73 13
27 73
39 27
2 39
79 2
47 79
69 ...

output:

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

result:

ok 

Test #12:

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

input:

100
16 1
93 16
89 93
60 89
87 60
70 87
92 70
97 92
15 97
40 15
39 40
42 39
73 42
71 73
12 71
84 12
96 84
17 96
48 17
55 48
50 55
38 50
19 38
28 19
90 28
25 90
27 25
22 27
45 22
76 45
2 76
57 2
81 57
10 81
46 10
41 46
51 41
78 51
56 78
9 56
31 9
98 31
86 98
91 86
77 91
5 77
66 5
64 66
61 64
49 61
14 ...

output:

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

result:

ok 

Test #13:

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

input:

100
21 1
82 1
38 1
17 1
87 1
43 1
14 1
28 1
33 1
55 1
47 1
40 1
58 1
45 1
6 1
12 1
39 1
96 1
26 1
50 1
84 1
18 1
5 1
75 1
22 1
97 1
10 1
36 1
35 1
48 1
77 1
95 1
72 1
73 1
83 1
25 1
11 1
51 1
65 1
74 1
8 1
61 1
92 1
69 1
85 1
56 1
78 1
27 1
52 1
19 1
64 1
23 1
31 1
59 1
37 1
67 1
44 1
88 1
20 1
13 1...

output:

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

result:

ok 

Test #14:

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

input:

100
30 1
90 1
42 1
55 1
9 1
18 1
62 1
35 1
63 1
89 1
17 1
32 1
36 1
19 1
95 1
12 1
29 1
47 1
8 1
70 1
75 1
81 1
28 1
79 1
71 1
56 1
85 1
39 1
58 1
21 1
65 1
26 1
24 1
31 1
86 1
69 1
91 1
77 1
22 1
100 1
78 1
67 1
92 1
93 1
87 1
14 1
98 1
99 1
73 1
37 1
84 1
94 1
46 1
11 1
82 1
97 1
66 1
50 1
44 1
72...

output:

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

result:

ok 

Test #15:

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

input:

100
83 1
44 1
11 44
93 83
20 11
63 93
69 63
71 69
99 20
94 99
92 94
32 92
50 32
96 71
3 50
2 96
61 3
51 61
41 2
89 51
80 41
76 89
95 80
9 76
54 95
40 54
37 9
34 37
45 34
36 45
97 36
53 97
72 40
91 53
67 72
85 67
28 85
26 91
5 28
27 5
4 27
100 4
18 100
79 26
82 18
84 79
65 82
12 65
56 84
16 56
42 12
...

output:

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

result:

ok 

Test #16:

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

input:

100
38 1
87 1
73 87
6 73
63 6
37 38
66 63
29 66
8 29
40 8
88 40
24 88
47 24
86 47
74 86
43 74
33 43
84 33
81 84
89 81
91 37
7 89
65 7
49 65
77 49
98 77
79 98
92 79
28 91
68 92
90 68
14 90
55 14
10 55
52 10
94 52
30 94
15 30
61 15
78 61
62 78
99 62
57 99
82 57
2 82
96 2
70 96
12 70
53 12
22 53
83 22
...

output:

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

result:

ok 

Test #17:

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

input:

100
98 1
62 1
71 1
77 1
63 1
30 1
51 1
24 1
82 1
9 1
17 1
57 1
36 1
25 1
80 1
96 1
16 1
6 1
68 1
44 1
23 1
89 1
60 1
8 1
65 1
47 1
76 1
66 1
21 1
75 1
28 1
97 1
99 1
2 1
53 1
14 1
50 1
90 1
64 1
5 1
3 1
46 1
34 1
85 1
4 1
41 1
72 1
54 1
81 1
92 1
52 1
13 1
61 1
69 1
45 1
74 1
79 1
33 1
38 1
95 1
48 ...

output:

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

result:

ok 

Test #18:

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

input:

100
58 1
26 1
6 1
51 1
91 1
80 1
89 1
35 1
22 1
57 1
41 1
75 1
48 1
72 1
17 1
67 1
30 1
61 1
79 1
98 1
43 1
3 1
81 1
63 1
25 1
27 1
87 1
90 1
11 1
100 1
66 1
84 1
45 1
20 1
47 1
36 1
14 1
54 1
88 1
38 1
55 1
68 1
50 1
74 1
2 1
82 1
70 1
83 1
37 1
93 1
53 1
16 1
85 1
23 1
71 1
21 1
34 1
15 1
78 1
86 ...

output:

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

result:

ok 

Test #19:

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

input:

100
88 1
28 1
80 28
53 80
31 88
66 31
98 66
90 53
50 90
79 50
64 79
84 64
7 98
82 84
42 7
34 42
85 82
81 85
93 81
71 93
48 71
46 48
43 46
27 34
41 43
26 27
77 26
17 77
62 41
74 17
22 74
19 62
38 22
95 19
68 95
9 68
20 38
5 20
32 9
94 5
86 32
57 86
58 94
100 57
92 58
30 92
8 100
72 30
70 8
4 70
67 4
...

output:

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

result:

ok 

Test #20:

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

input:

100
36 1
58 1
69 58
64 69
62 64
8 62
74 8
23 74
96 23
21 36
59 96
53 59
22 53
82 21
88 22
7 88
30 7
89 30
54 89
83 54
15 83
50 82
81 15
72 81
79 50
92 72
76 92
91 76
46 91
31 46
11 31
55 11
60 55
4 60
49 4
40 49
19 40
70 19
43 70
27 43
84 27
38 84
99 38
13 99
35 13
42 35
25 42
28 25
90 79
37 28
14 3...

output:

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

result:

ok 

Test #21:

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

input:

100
53 1
74 1
64 1
27 1
67 1
5 1
35 1
95 1
57 1
8 1
21 1
9 1
99 1
42 1
41 1
81 1
90 1
50 1
49 1
71 1
17 1
28 1
33 1
18 1
52 1
97 1
26 1
73 1
31 1
79 1
87 1
88 1
76 1
56 1
3 1
39 1
63 1
4 1
80 1
19 1
54 1
6 1
65 1
13 1
94 1
38 1
7 1
40 1
29 1
2 1
70 1
47 1
32 1
98 1
61 1
25 1
10 1
55 1
77 1
82 1
11 1...

output:

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

result:

ok 

Test #22:

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

input:

100
96 1
17 1
8 1
34 1
11 1
98 1
60 1
48 1
80 1
55 1
39 1
5 1
54 1
19 1
90 1
44 1
31 1
91 1
26 1
15 1
14 1
32 1
47 1
36 1
49 1
46 1
13 1
82 1
69 1
45 1
99 1
88 1
65 1
59 1
52 1
58 1
21 1
86 1
18 1
66 1
79 1
73 1
72 1
93 1
30 1
76 1
100 1
20 1
33 1
22 1
41 1
81 1
78 1
97 1
35 1
29 1
10 1
95 1
77 1
94...

output:

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

result:

ok 

Test #23:

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

input:

100
76 1
88 1
19 76
51 88
46 19
47 46
20 51
9 47
33 20
80 33
28 9
12 28
81 12
10 81
17 80
43 10
24 17
89 24
65 43
97 65
73 97
37 89
75 73
54 37
92 75
66 92
13 54
58 66
16 13
41 58
71 16
68 41
59 68
38 59
14 71
78 38
30 14
27 30
36 27
42 36
8 42
77 78
91 77
7 8
95 91
100 7
98 100
82 98
34 82
99 34
35...

output:

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

result:

ok 

Test #24:

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

input:

100
19 1
23 1
85 23
75 85
68 75
25 68
57 25
10 19
8 57
15 8
78 15
63 78
61 63
41 61
34 41
16 34
64 10
43 16
88 43
56 88
77 64
72 56
79 72
98 77
11 79
2 11
53 2
62 53
7 98
28 62
55 28
66 55
32 66
91 32
12 91
26 12
42 26
39 7
89 42
60 39
80 89
6 80
47 6
17 47
73 17
49 73
58 49
20 58
38 20
40 38
48 60
...

output:

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

result:

ok 

Test #25:

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

input:

100
94 1
83 1
39 1
29 1
23 1
14 1
63 1
42 1
67 1
4 1
59 1
41 1
12 1
11 1
9 1
92 1
48 1
10 1
43 1
53 1
97 1
77 1
2 1
85 1
45 1
24 1
64 1
28 1
82 1
88 1
79 1
35 1
6 1
68 1
34 1
70 1
7 1
22 1
37 1
44 1
49 1
33 1
20 1
51 1
18 1
69 1
91 1
73 1
100 1
95 1
93 1
58 1
62 1
96 1
21 1
47 1
61 1
13 1
52 1
65 1
...

output:

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

result:

ok 

Test #26:

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

input:

100
74 1
90 1
45 1
27 1
13 1
4 1
51 1
37 1
82 1
11 1
47 1
6 1
80 1
58 1
57 1
86 1
70 1
42 1
84 1
41 1
64 1
77 1
15 1
88 1
48 1
28 1
61 1
35 1
20 1
63 1
5 1
96 1
50 1
87 1
79 1
34 1
93 1
10 1
94 1
32 1
62 1
56 1
8 1
78 1
33 1
26 1
67 1
66 1
95 1
49 1
65 1
31 1
2 1
7 1
17 1
97 1
14 1
43 1
69 1
60 1
39...

output:

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

result:

ok 

Test #27:

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

input:

100
80 1
97 1
81 1
77 97
44 80
54 77
55 81
18 55
22 54
15 22
17 44
89 18
12 89
60 12
86 60
56 15
2 56
35 86
5 17
83 35
58 2
93 58
36 83
72 36
99 72
3 99
9 5
30 93
21 9
90 3
63 90
8 30
67 8
31 63
78 67
26 78
14 31
47 21
73 14
94 26
52 94
53 47
50 52
92 73
29 50
38 53
51 92
100 51
34 38
33 34
82 33
16...

output:

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

result:

ok 

Test #28:

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

input:

100
77 1
94 1
70 1
75 94
43 70
55 43
9 55
88 9
33 88
62 33
6 62
52 75
7 6
40 7
4 40
82 4
46 82
47 46
68 47
51 68
16 51
17 16
21 17
89 21
56 89
93 56
63 93
32 63
41 32
2 41
31 52
44 2
8 44
48 8
66 48
65 66
50 65
36 50
57 31
25 36
73 25
95 73
26 95
81 57
13 26
28 13
49 28
61 81
72 49
59 72
11 61
45 59...

output:

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

result:

ok 

Test #29:

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

input:

100
68 1
92 1
87 1
38 1
78 1
20 1
3 1
21 1
75 1
19 1
99 1
16 1
12 1
85 1
22 1
18 1
61 1
70 1
37 1
84 1
74 1
24 1
69 1
72 1
42 1
26 1
25 1
35 1
54 1
8 1
31 1
46 1
15 1
62 1
29 1
28 1
57 1
51 1
11 1
82 1
39 1
49 1
56 1
9 1
17 1
93 1
14 1
77 1
81 1
50 1
86 1
40 1
45 1
91 1
52 1
43 1
97 1
76 1
6 1
27 1
...

output:

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

result:

ok 

Test #30:

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

input:

100
89 1
10 1
59 1
74 1
5 1
72 1
44 1
41 1
68 1
32 1
15 1
20 1
92 1
4 1
50 1
54 1
33 1
45 1
76 1
27 1
94 1
55 1
17 1
91 1
47 1
43 1
48 1
84 1
100 1
62 1
37 1
16 1
39 1
83 1
64 1
85 1
93 1
69 1
87 1
77 1
23 1
49 1
7 1
53 1
95 1
14 1
86 1
3 1
22 1
58 1
82 1
38 1
90 1
71 1
25 1
75 1
34 1
11 1
60 1
80 1...

output:

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

result:

ok 

Test #31:

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

input:

100
22 1
14 1
96 1
21 96
33 22
20 14
34 21
50 20
38 50
97 34
32 97
61 32
87 38
46 87
79 33
67 61
49 67
57 79
66 57
70 49
99 46
19 66
13 99
51 19
58 70
76 13
95 51
78 58
16 76
84 95
9 78
17 84
92 9
12 92
85 16
23 85
26 12
71 26
3 17
82 3
56 71
43 82
30 23
45 30
63 43
2 56
75 45
48 75
69 48
100 69
5 1...

output:

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

result:

ok 

Test #32:

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

input:

100
63 1
49 1
20 1
76 20
51 49
95 51
5 76
66 5
26 66
83 26
61 83
13 61
24 13
94 24
75 94
19 75
54 95
68 19
29 68
56 29
32 56
85 32
9 85
4 9
28 4
64 28
90 64
81 90
30 81
87 30
7 87
96 7
18 96
12 18
42 12
40 54
17 40
98 42
80 17
84 98
14 84
25 14
59 80
48 59
82 25
36 48
27 82
43 27
57 36
86 43
35 86
3...

output:

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

result:

ok 

Test #33:

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

input:

100
83 1
45 1
44 1
33 1
94 1
52 1
34 1
96 1
92 1
27 1
43 1
71 1
70 1
9 1
77 1
29 1
25 1
79 1
5 1
49 1
2 1
41 1
13 1
22 1
46 1
12 1
56 1
68 1
99 1
28 1
93 1
72 1
63 1
82 1
4 1
57 1
90 1
66 1
37 1
67 1
74 1
89 1
60 1
95 1
80 1
17 1
87 1
35 1
8 1
59 1
3 1
78 1
23 1
62 1
51 1
26 1
97 1
86 1
24 1
50 1
69...

output:

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

result:

ok 

Test #34:

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

input:

100
30 1
58 1
36 1
7 1
10 1
14 1
67 1
100 1
73 1
42 1
53 1
57 1
97 1
61 1
69 1
71 1
26 1
63 1
22 1
12 1
86 1
59 1
81 1
24 1
32 1
5 1
54 1
28 1
46 1
45 1
96 1
65 1
6 1
90 1
38 1
29 1
72 1
80 1
31 1
34 1
2 1
77 1
41 1
64 1
40 1
25 1
78 1
51 1
66 1
17 1
50 1
3 1
39 1
93 1
74 1
48 1
79 1
55 1
16 1
33 1
...

output:

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

result:

ok 

Test #35:

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

input:

100
69 1
8 1
80 1
5 8
86 80
60 86
34 69
42 5
11 34
10 60
12 11
56 10
44 56
16 12
74 16
3 44
43 3
99 74
97 99
48 42
23 97
78 23
81 78
39 43
26 81
24 39
65 48
82 24
61 65
19 26
7 19
52 7
87 61
31 52
57 87
29 57
49 31
21 29
75 82
6 75
64 21
96 64
27 96
14 27
93 14
47 6
83 47
37 49
18 93
79 83
71 18
15 ...

output:

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

result:

ok 

Test #36:

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

input:

100
10 1
43 1
67 1
78 67
75 78
48 75
96 48
39 96
99 39
23 99
32 23
81 32
19 43
34 81
56 34
28 56
27 19
68 28
53 27
24 53
65 24
3 65
46 68
94 46
89 3
30 94
69 30
35 69
9 35
91 9
44 91
73 89
22 44
37 10
83 22
7 83
63 7
12 73
74 63
58 74
50 58
14 50
61 14
52 61
92 52
77 92
93 77
86 12
8 93
18 86
98 8
4...

output:

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

result:

ok 

Test #37:

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

input:

100
100 1
24 1
99 1
41 1
3 1
87 1
73 1
18 1
53 1
31 1
61 1
82 1
84 1
62 1
16 1
4 1
95 1
57 1
36 1
96 1
94 1
12 1
69 1
32 1
78 1
97 1
20 1
27 1
83 1
33 1
5 1
64 1
23 1
44 1
60 1
70 1
2 1
79 1
47 1
14 1
39 1
13 1
45 1
71 1
17 1
74 1
58 1
28 1
49 1
21 1
55 1
56 1
76 1
35 1
38 1
66 1
15 1
77 1
22 1
88 1...

output:

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

result:

ok 

Test #38:

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

input:

100
73 1
53 1
66 1
35 1
60 1
51 1
63 1
79 1
16 1
32 1
70 1
94 1
82 1
95 1
38 1
90 1
62 1
43 1
98 1
47 1
56 1
24 1
48 1
15 1
7 1
36 1
85 1
30 1
83 1
9 1
29 1
74 1
46 1
31 1
42 1
41 1
75 1
20 1
54 1
4 1
76 1
84 1
45 1
2 1
81 1
57 1
12 1
6 1
33 1
37 1
67 1
58 1
52 1
49 1
65 1
8 1
91 1
92 1
68 1
97 1
77...

output:

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

result:

ok 

Test #39:

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

input:

100
78 1
69 1
62 1
95 1
30 62
35 69
43 30
82 35
58 95
52 78
54 43
68 54
85 82
51 52
2 51
94 58
48 94
45 2
27 85
14 68
56 14
31 56
76 27
66 31
57 76
72 57
98 45
60 48
89 60
84 72
53 98
79 84
44 79
92 66
39 92
7 44
74 39
61 53
93 7
11 93
59 11
41 74
6 41
5 89
34 6
42 34
83 42
3 83
22 59
100 3
40 5
67 ...

output:

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

result:

ok 

Test #40:

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

input:

100
15 1
58 1
51 1
72 1
84 51
86 84
97 72
63 97
56 63
59 56
74 59
37 74
32 37
38 86
46 32
5 46
23 5
62 23
61 62
2 61
31 2
48 58
40 31
34 40
95 34
82 95
9 38
43 82
7 9
24 7
17 48
4 24
66 43
79 66
83 4
55 79
67 55
16 83
77 16
3 77
68 67
60 68
96 60
14 96
81 14
22 3
20 81
69 20
42 17
6 69
41 22
26 41
7...

output:

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

result:

ok 

Test #41:

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

input:

100
39 1
29 1
28 1
63 1
37 1
3 1
82 1
32 1
92 1
16 1
65 1
56 1
5 1
30 1
78 1
81 1
60 1
99 1
21 1
17 1
96 1
93 1
27 1
45 1
85 1
51 1
35 1
25 1
13 1
86 1
91 1
38 1
48 1
94 1
33 1
98 1
87 1
4 1
70 1
95 1
97 1
69 1
80 1
2 1
8 1
61 1
59 1
15 1
44 1
41 1
58 1
54 1
52 1
34 1
36 1
53 1
12 1
19 1
57 1
9 1
7 ...

output:

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

result:

ok 

Test #42:

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

input:

100
64 1
100 1
90 1
81 1
39 1
42 1
32 1
63 1
72 1
41 1
92 1
10 1
84 1
43 1
38 1
27 1
8 1
26 1
47 1
96 1
95 1
25 1
4 1
46 1
87 1
67 1
21 1
44 1
69 1
31 1
24 1
91 1
88 1
49 1
57 1
45 1
80 1
65 1
56 1
93 1
66 1
75 1
85 1
35 1
2 1
86 1
82 1
15 1
37 1
78 1
89 1
7 1
18 1
48 1
29 1
60 1
79 1
70 1
22 1
34 1...

output:

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

result:

ok 

Test #43:

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

input:

100
46 1
65 1
24 1
73 1
52 46
38 52
59 65
74 38
86 24
12 59
92 86
83 74
34 92
88 73
6 34
32 83
89 32
56 89
68 6
53 56
13 88
15 13
99 53
47 99
54 47
93 68
3 12
70 15
33 54
11 3
45 33
41 70
36 93
27 36
9 45
81 27
7 41
18 7
40 81
82 9
50 82
2 50
66 2
28 40
61 66
96 28
4 18
94 11
8 61
79 8
58 4
17 94
72...

output:

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

result:

ok 

Test #44:

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

input:

100
15 1
25 1
60 1
2 1
69 25
65 2
48 65
47 48
97 47
36 97
19 36
39 60
64 19
80 64
59 80
94 39
99 59
81 94
84 99
11 84
77 11
72 77
16 72
85 16
30 85
45 30
66 81
6 45
42 6
20 42
58 20
86 66
46 58
96 46
43 15
68 96
52 86
83 68
12 83
51 12
14 52
92 51
63 92
27 63
21 27
18 21
57 14
10 57
8 10
38 18
61 38...

output:

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

result:

ok 

Test #45:

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

input:

100
21 1
63 1
8 1
9 1
50 1
75 1
86 1
15 1
51 1
13 1
11 1
26 1
27 1
10 1
59 1
98 1
7 1
91 1
23 1
17 1
82 1
53 1
18 1
52 1
67 1
89 1
88 1
87 1
61 1
55 1
22 1
41 1
72 1
81 1
65 1
20 1
60 1
37 1
92 1
69 1
99 1
80 1
66 1
44 1
34 1
70 1
36 1
68 1
90 1
78 1
97 1
46 1
62 1
4 1
100 1
47 1
74 1
25 1
5 1
16 1
...

output:

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

result:

ok 

Test #46:

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

input:

100
65 1
44 1
11 1
59 1
49 1
54 1
39 1
28 1
68 1
5 1
55 1
62 1
90 1
30 1
4 1
78 1
53 1
69 1
43 1
76 1
12 1
60 1
58 1
34 1
48 1
51 1
20 1
42 1
52 1
72 1
64 1
10 1
13 1
80 1
91 1
2 1
35 1
16 1
99 1
66 1
97 1
75 1
84 1
40 1
85 1
57 1
45 1
33 1
86 1
56 1
36 1
46 1
98 1
82 1
15 1
94 1
38 1
100 1
17 1
77 ...

output:

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

result:

ok 

Test #47:

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

input:

100
3 1
24 1
87 1
16 1
32 24
89 16
71 89
51 87
57 32
41 51
31 41
15 31
73 71
56 57
34 56
47 34
46 47
54 3
2 15
23 46
58 54
97 73
25 97
60 25
68 60
4 58
8 2
10 68
40 23
42 8
14 10
50 4
11 14
18 11
38 42
48 38
84 50
100 18
35 48
12 100
9 84
29 35
27 12
39 40
43 29
80 43
98 39
5 9
69 80
72 27
88 72
95 ...

output:

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

result:

ok 

Test #48:

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

input:

100
85 1
58 1
90 1
98 1
39 98
91 90
52 39
41 52
16 91
47 41
9 47
11 9
37 16
44 11
70 58
71 44
86 37
54 71
33 54
62 33
13 62
66 13
61 86
60 61
28 60
17 66
38 17
35 38
96 35
45 96
68 45
8 68
80 28
14 8
95 14
76 80
31 76
78 31
93 95
48 93
21 48
3 21
83 78
100 3
82 70
23 83
67 100
32 67
20 23
53 32
24 2...

output:

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

result:

ok 

Test #49:

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

input:

100
44 1
53 1
39 1
17 1
25 1
64 1
94 1
48 1
78 1
90 1
5 1
100 1
29 1
4 1
38 1
8 1
47 1
11 1
81 1
61 1
99 1
24 1
18 1
23 1
58 1
27 1
98 1
72 1
79 1
97 1
15 1
40 1
33 1
46 1
82 1
96 1
3 1
71 1
69 1
42 1
80 1
51 1
2 1
91 1
66 1
45 1
9 1
12 1
26 1
41 1
32 1
54 1
83 1
67 1
52 1
76 1
68 1
65 1
6 1
63 1
74...

output:

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

result:

ok 

Test #50:

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

input:

100
91 1
36 1
31 1
74 1
56 1
28 1
5 1
77 1
39 1
42 1
16 1
23 1
45 1
9 1
100 1
57 1
24 1
79 1
97 1
88 1
73 1
3 1
48 1
90 1
59 1
4 1
89 1
67 1
63 1
32 1
94 1
80 1
33 1
15 1
26 1
92 1
58 1
66 1
41 1
49 1
35 1
93 1
95 1
68 1
27 1
21 1
85 1
81 1
7 1
96 1
50 1
86 1
99 1
87 1
61 1
51 1
11 1
43 1
78 1
25 1
...

output:

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

result:

ok 

Test #51:

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

input:

100
5 1
87 1
83 1
98 1
34 1
75 1
64 1
69 1
21 1
39 1
12 1
49 1
10 1
47 1
67 1
81 1
14 1
59 1
68 1
90 1
70 1
52 1
48 1
66 1
72 1
60 1
55 1
86 1
54 1
4 1
22 1
42 1
16 1
56 10
43 47
50 64
2 16
32 87
46 72
95 56
88 55
19 59
20 2
36 14
85 43
57 69
79 67
18 12
63 42
82 48
76 19
15 34
62 88
74 36
97 46
44 ...

output:

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

result:

ok 

Test #52:

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

input:

100
69 1
29 1
84 1
31 1
23 1
8 1
85 1
20 1
82 1
38 1
47 1
91 1
94 1
71 1
64 1
89 1
67 1
79 1
35 1
92 1
55 1
46 1
87 1
76 1
40 1
59 1
19 1
81 1
68 1
99 1
58 1
70 1
57 1
72 99
42 68
4 70
17 42
14 4
51 72
28 51
80 79
50 59
54 57
34 89
5 40
24 19
90 54
60 81
88 90
3 28
100 14
74 3
56 88
63 55
48 24
75 1...

output:

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

result:

ok 

Test #53:

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

input:

100
5 1
57 1
84 1
52 1
51 1
16 1
47 1
2 1
10 1
62 1
36 1
44 1
70 1
30 1
26 1
98 1
38 1
21 1
55 1
68 1
92 1
97 1
12 1
86 1
64 1
89 1
6 1
4 1
63 1
49 1
82 1
94 1
73 1
43 73
3 63
77 49
48 21
85 77
17 3
18 85
14 6
88 86
61 12
46 18
54 61
13 46
45 13
96 97
50 4
8 17
100 43
19 8
23 26
15 89
74 100
28 96
3...

output:

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

result:

ok 

Test #54:

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

input:

100
94 1
21 1
95 1
8 1
18 1
88 1
37 1
13 1
28 1
38 1
56 1
67 1
43 1
75 1
5 1
17 1
91 1
10 1
30 1
77 1
29 1
97 1
7 1
96 1
11 1
63 1
41 1
50 1
49 1
9 1
6 1
84 1
23 1
31 43
55 11
15 31
60 63
72 5
100 91
48 6
85 95
35 48
16 21
26 37
93 28
57 23
76 93
65 10
82 8
87 15
73 67
80 9
61 84
99 65
74 61
59 57
1...

output:

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

result:

ok 

Test #55:

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

input:

100
89 1
98 1
88 1
67 1
53 1
48 1
78 1
19 1
35 1
40 1
47 1
28 1
46 1
11 1
21 1
71 1
60 1
97 1
80 1
33 1
42 1
12 1
76 1
62 1
92 1
13 1
95 1
75 1
17 1
50 1
66 1
49 1
52 1
84 62
57 52
82 75
23 66
9 49
3 9
94 57
25 17
87 82
83 3
16 23
31 50
15 83
18 94
91 92
29 18
38 15
64 87
96 31
73 29
5 73
99 95
74 5...

output:

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

result:

ok 

Test #56:

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

input:

100
9 1
52 1
79 1
43 1
83 1
86 1
99 1
47 1
87 1
36 1
95 1
44 1
26 1
37 1
20 1
22 1
60 1
97 1
57 1
4 1
2 1
39 1
66 1
70 1
92 1
17 1
61 1
5 1
27 1
75 1
14 1
7 1
24 1
85 24
96 61
62 96
77 85
16 70
45 62
63 66
40 57
12 5
31 16
71 75
8 77
80 12
53 71
68 7
59 39
58 60
3 68
15 53
25 92
51 80
41 8
32 41
54 ...

output:

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

result:

ok 

Test #57:

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

input:

100
99 1
34 1
70 1
26 1
86 1
94 1
67 1
25 1
61 1
66 1
73 1
38 1
87 1
49 1
21 1
3 1
52 1
100 1
54 1
76 1
58 1
8 1
44 1
6 1
40 1
55 1
29 1
77 1
59 1
31 1
65 1
81 1
69 1
95 59
28 69
48 3
85 65
12 81
22 99
14 48
24 25
71 70
56 40
27 31
78 58
79 78
82 71
13 82
23 79
17 49
72 77
97 66
83 56
33 67
36 85
43...

output:

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

result:

ok 

Test #58:

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

input:

100
75 1
22 1
36 1
74 1
7 1
93 1
16 1
21 1
42 1
61 1
26 1
55 1
98 1
100 1
23 1
2 1
17 1
71 1
25 1
56 1
12 1
83 1
80 1
15 1
86 1
81 1
77 1
33 1
92 1
53 1
44 1
52 1
35 1
29 53
88 44
5 88
10 5
8 92
96 10
28 86
90 52
43 80
48 90
76 29
85 96
91 48
82 35
46 82
11 46
39 77
13 76
57 91
62 57
47 13
70 47
14 ...

output:

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

result:

ok 

Test #59:

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

input:

100
52 1
75 1
5 1
62 1
23 1
74 1
28 1
7 1
68 1
49 1
26 1
44 1
4 1
100 1
43 1
59 1
33 1
17 1
24 1
89 1
12 1
77 1
32 1
96 1
55 1
18 1
6 1
88 1
81 1
92 1
3 1
99 1
46 1
22 99
67 88
70 67
14 3
48 22
76 14
41 92
69 46
60 69
37 76
27 48
97 41
39 37
8 27
38 39
80 6
73 8
78 38
36 60
66 73
50 66
31 18
65 80
5...

output:

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

result:

ok 

Test #60:

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

input:

100
26 1
9 1
97 1
66 1
86 1
18 1
93 1
99 1
64 1
55 1
19 66
2 86
49 55
29 9
38 29
44 64
94 49
82 18
77 97
70 26
57 38
30 82
28 44
68 70
52 57
95 77
40 28
10 99
51 40
75 94
32 10
100 52
74 32
80 2
27 75
83 74
78 80
58 51
54 30
87 95
23 78
96 19
65 54
35 100
88 58
98 23
12 88
60 96
85 27
76 68
3 83
7 7...

output:

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

result:

ok 

Test #61:

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

input:

100
54 1
71 1
100 1
9 1
19 1
78 1
41 1
75 1
84 1
38 1
28 75
96 38
40 96
39 84
83 40
79 39
17 79
24 17
97 24
99 97
49 28
35 99
95 49
62 35
45 95
31 62
59 41
2 83
89 31
86 89
32 2
37 32
14 86
61 78
60 37
36 14
91 60
57 91
13 57
47 36
85 47
64 13
68 85
46 19
90 68
52 45
15 52
76 64
81 76
77 90
25 77
92...

output:

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

result:

ok 

Test #62:

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

input:

100
50 1
40 1
87 1
19 1
34 1
33 1
49 1
67 1
65 1
15 1
91 49
53 33
97 15
21 97
82 21
42 82
62 42
4 65
17 62
52 4
78 52
95 17
61 95
71 78
63 61
28 63
64 71
85 64
70 91
83 67
6 85
3 28
92 3
41 34
96 92
39 6
69 96
35 69
7 35
98 7
16 98
12 16
51 12
57 83
66 39
20 51
79 70
100 57
80 20
11 100
94 80
74 66
...

output:

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

result:

ok 

Test #63:

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

input:

100
99 1
63 1
7 1
22 1
100 1
45 1
10 1
3 1
95 1
71 1
40 95
8 63
33 8
96 33
64 40
77 71
9 45
62 96
21 62
51 21
37 77
39 10
36 37
31 99
35 51
93 31
56 36
49 22
72 49
97 9
89 39
88 7
19 72
85 88
46 100
98 93
16 98
48 19
74 85
59 89
65 35
4 59
2 74
18 56
55 46
78 3
34 78
29 55
92 16
6 64
52 48
94 18
24 ...

output:

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

result:

ok 

Test #64:

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

input:

100
81 1
100 1
17 1
43 1
10 1
29 1
34 1
25 1
21 1
4 1
60 4
6 29
68 60
51 25
93 6
18 21
24 68
90 24
73 18
26 73
12 90
86 51
64 26
47 64
72 12
80 72
7 80
40 47
96 7
84 96
48 84
63 86
15 63
67 40
92 48
32 67
28 32
57 92
75 28
79 75
20 57
23 79
78 23
19 78
36 20
30 19
62 15
45 36
87 62
31 45
35 31
83 35...

output:

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

result:

ok 

Test #65:

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

input:

100
68 1
25 1
99 1
7 1
27 1
75 1
63 1
11 1
64 1
69 1
37 69
60 37
45 64
70 60
6 75
92 11
40 45
73 70
20 40
89 73
84 20
15 89
55 15
61 84
36 63
59 55
32 6
16 59
4 32
56 16
77 56
17 61
93 17
14 93
54 77
42 14
10 42
47 92
51 54
24 36
80 51
48 10
52 80
57 52
18 48
91 24
100 18
74 100
49 74
71 47
98 71
53...

output:

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

result:

ok 

Test #66:

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

input:

100
92 1
72 1
62 1
21 1
10 1
47 1
17 1
50 1
5 1
51 1
2 62
24 21
69 2
77 51
18 24
23 50
75 18
27 72
85 92
76 75
14 5
64 77
53 10
60 17
66 27
52 69
88 53
43 14
34 88
11 47
46 64
67 66
22 34
25 43
41 76
82 22
13 67
65 11
80 41
9 80
79 65
70 85
19 79
56 70
93 13
30 60
90 46
99 25
20 99
44 19
42 44
40 42...

output:

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

result:

ok 

Test #67:

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

input:

100
25 1
56 1
78 1
40 1
64 1
26 1
48 1
83 1
58 1
62 1
69 83
93 62
90 58
63 90
52 63
12 69
91 93
92 52
9 91
6 9
2 6
57 92
39 2
46 57
88 48
87 39
8 12
99 87
97 46
45 99
82 8
28 64
81 82
38 40
20 81
59 97
11 45
36 59
49 20
24 11
60 24
19 36
33 49
54 19
96 60
17 96
84 17
32 84
70 88
68 32
61 54
43 61
14...

output:

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

result:

ok 

Test #68:

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

input:

100
13 1
16 1
50 1
76 1
62 1
39 1
17 1
26 1
41 1
29 1
35 41
77 29
8 17
14 77
88 14
79 35
86 79
19 88
25 19
55 25
5 86
47 55
97 47
43 97
49 26
28 43
20 28
57 20
70 5
59 70
93 57
40 93
82 49
46 8
6 40
34 82
75 59
68 39
53 6
66 53
84 66
72 75
37 84
100 37
90 100
60 90
4 60
65 68
87 34
3 87
69 72
32 69
...

output:

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

result:

ok 

Test #69:

score: -100
Time Limit Exceeded

input:

10000
8285 1
5274 8285
925 5274
6279 925
1629 6279
593 1629
6906 593
2783 6906
2772 2783
2356 2772
8811 2356
8061 8811
5384 8061
9147 5384
6687 9147
2277 6687
4413 2277
8369 4413
6178 8369
9328 6178
7069 9328
5822 7069
8903 5822
2405 8903
7267 2405
301 7267
4655 301
3854 4655
6031 3854
9986 6031
388...

output:


result: