QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#176604#7222. The Great Huntucup-team004TL 307ms20520kbC++204.3kb2023-09-11 20:16:502023-09-17 01:42:48

Judging History

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

  • [2023-09-17 01:42:48]
  • 自动重测本题所有获得100分的提交记录
  • 测评结果:TL
  • 用时:307ms
  • 内存:20520kb
  • [2023-09-11 20:16:50]
  • 评测
  • 测评结果:100
  • 用时:313ms
  • 内存:20728kb
  • [2023-09-11 20:16:50]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

constexpr int V = 2E5;

struct Edge {
    int to;
    int cap;
};

std::vector<Edge> e;
std::vector<int> adj[V];

void addEdge(int u, int v, int cap) {
    adj[u].push_back(e.size());
    e.push_back({v, cap});
    adj[v].push_back(e.size());
    e.push_back({u, 0});
}

constexpr int inf = 1E9;

int h[V];
int tot = 0;
int cur[V];
bool bfs(int s, int t) {
    std::fill(h, h + tot, -1);
    std::queue<int> q;
    q.push(s);
    h[s] = 0;
    
    while (!q.empty()) {
        int x = q.front();
        q.pop();
        
        for (auto i : adj[x]) {
            auto [y, cap] = e[i];
            if (cap > 0 && h[y] == -1) {
                h[y] = h[x] + 1;
                q.push(y);
            }
        }
    }
    
    return h[t] != -1;
}

int dfs(int x, int t, int f) {
    if (x == t) {
        return f;
    }
    int res = 0;
    for (auto &i = cur[x]; i < adj[x].size(); i++) {
        int j = adj[x][i];
        auto [y, cap] = e[j];
        if (cap > 0 && h[y] == h[x] + 1) {
            int a = dfs(y, t, std::min(cap, f));
            f -= a;
            res += a;
            e[j].cap -= a;
            e[j ^ 1].cap += a;
            if (f == 0) {
                break;
            }
        }
    }
    return res;
}

int flow(int s, int t) {
    int ans = 0;
    while (bfs(s, t)) {
        std::fill(cur, cur + tot, 0);
        ans += dfs(s, t, inf);
    }
    return ans;
}

constexpr int N = 1E4;

int f[N];
int g[N];

int find(int x) {
    if (f[f[x]] == f[x]) {
        return f[x];
    }
    int y = find(f[x]);
    int u = tot++;
    if (g[x] != -1) {
        addEdge(u, g[x], inf);
    }
    if (g[f[x]] != -1) {
        addEdge(u, g[f[x]], inf);
    }
    f[x] = y;
    g[x] = u;
    return y;
}

void merge(int x, int y) {
    x = find(x);
    y = find(y);
    f[y] = x;
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int n;
    std::cin >> n;
    
    std::iota(f, f + n, 0);
    std::fill(g, g + n, -1);
    
    std::vector<std::vector<int>> adj(n);
    for (int i = 1; i < n; i++) {
        int u, v;
        std::cin >> u >> v;
        u--, v--;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    
    tot = 2 * n + 2;
    int s = 2 * n, t = 2 * n + 1;
    
    for (int i = 0; i < n; i++) {
        addEdge(s, n + i, 1);
        addEdge(i, t, 1);
    }
    
    std::vector<int> u(n), v(n);
    std::vector<std::vector<int>> q1(n), q2(n);
    for (int i = 0; i < n; i++) {
        std::cin >> u[i] >> v[i];
        u[i]--, v[i]--;
        q1[u[i]].push_back(i);
        q1[v[i]].push_back(i);
    }
    std::vector<bool> vis(n);
    
    auto dfs = [&](auto self, int x, int p) -> void {
        for (auto y : adj[x]) {
            if (y == p) {
                continue;
            }
            self(self, y, x);
            merge(x, y);
        }
        for (auto i : q1[x]) {
            if (!vis[i]) {
                vis[i] = true;
            } else {
                int y = u[i] ^ v[i] ^ x;
                int a = find(y);
                q2[a].push_back(i);
            }
        }
        for (auto i : q2[x]) {
            find(u[i]);
            find(v[i]);
            if (g[u[i]] != -1) {
                addEdge(n + i, g[u[i]], inf);
            }
            if (g[v[i]] != -1) {
                addEdge(n + i, g[v[i]], inf);
            }
            addEdge(n + i, x, inf);
        }
        g[x] = x;
    };
    dfs(dfs, 0, -1);
    
    int ans = flow(s, t);
    if (ans < n) {
        std::cout << "No\n";
        return 0;
    }
    std::cout << "Yes\n";
    
    std::vector<int> a(n);
    std::fill(cur, cur + tot, 0);
    auto match = [&](auto self, int x) {
        if (x < n) {
            return x;
        }
        for (auto &i = cur[x]; i < ::adj[x].size(); i++) {
            int j = ::adj[x][i];
            auto [y, cap] = e[j];
            if (j % 2 == 0 && e[j ^ 1].cap > 0) {
                e[j ^ 1].cap--;
                return self(self, y);
            }
        }
        assert(false);
    };
    for (int i = 0; i < n; i++) {
        a[i] = match(match, n + i);
        std::cout << a[i] + 1 << " \n"[i == n - 1];
    }
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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
7 2 8 10 3 5 1 6 9 4

result:

ok 

Test #2:

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

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: 2ms
memory: 9032kb

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

result:

ok 

Test #4:

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

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

result:

ok 

Test #5:

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

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 5 6 43 100 21 79 95 80 54 2 99 81 59 97 13 74 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 23 91 25 77 15 22 46 18 70 83 38 28 19 14 92 48 1

result:

ok 

Test #6:

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

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 24 89 23 92 5 36 8 69 100 52 96 14 13 34 55 79 95 85 15 70 68 37 7 27 48 44 94 97 26 84 29 82 10 67 54 19 40 38 1

result:

ok 

Test #7:

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

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

result:

ok 

Test #8:

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

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

result:

ok 

Test #9:

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

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 1 39 47 21 100 58 6 77 97 55 20 90 95 34 89 51 94 85 98 72 19 68 48 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 82 62 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 9 80 46 5 13 65

result:

ok 

Test #10:

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

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 12 79 5 98 53 35 62 16 18 33 59 64 76 15 45 72 9 58 81 88 82 17 10 39 44 1

result:

ok 

Test #11:

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

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

result:

ok 

Test #12:

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

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

result:

ok 

Test #13:

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

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 4 27 52 19 64 23 31 59 37 54 67 44 88 20 13 70 41 53 93 86 32 49 94 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: 9248kb

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 6 27 20 53 96 5 15 61 48 3 33 7 41 2 34 4 83 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: 2ms
memory: 8504kb

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

result:

ok 

Test #16:

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

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

result:

ok 

Test #17:

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

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 15 27 65 47 37 76 66 10 21 75 28 97 87 99 2 53 14 50 90 64 94 5 3 46 34 85 4 41 72 54 81 92 52 7 13 61 69 45 29 74 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: 2ms
memory: 8848kb

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 7 85 8 23 71 21 77 34 39 15 78 86 33 59 52 44 18 5 73 99 19 9 96 10 60 24 65 29 62 49 40 42 31 97 69 4 76 56 12 64 28 94 95 13 46 32 1

result:

ok 

Test #19:

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

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

result:

ok 

Test #20:

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

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

result:

ok 

Test #21:

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

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

result:

ok 

Test #22:

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

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 2 35 29 10 95 77 9 94 70 3 6 24 89 38 42 16 71 92 85 25 4 40 37 84 51 67 68 27 28 63 83 87 75 43 74 62 12 50 7 53 23 64 56 61 1

result:

ok 

Test #23:

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

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

result:

ok 

Test #24:

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

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

result:

ok 

Test #25:

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

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 30 19 83 26 39 29 89 23 55 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 28 5 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 32 90 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: 8384kb

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 89 97 14 43 98 69 81 60 39 9 100 21 68 54 52 59 73 99 83 75 72 19 71 38 76 40 29 53 23 30 25 55 44 91 22 3 85 46 92 16 12 36 18 24 1

result:

ok 

Test #27:

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

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

result:

ok 

Test #28:

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

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

result:

ok 

Test #29:

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

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

result:

ok 

Test #30:

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

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 8 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 1 88 77 23 49 7 53 95 96 14 86 3 22 46 19 58 82 21 40 38 98 90 57 71 29 25 2 75 34 11 56 60 31 80 12 97 18 36 51 61 67 35 24 26 13 87 81 66 73 78 30 70 65 42 52 79 99 28 9 63 6 20

result:

ok 

Test #31:

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

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

result:

ok 

Test #32:

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

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

result:

ok 

Test #33:

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

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

result:

ok 

Test #34:

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

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 35 70 39 93 4 74 48 47 79 18 55 16 49 33 82 87 84 52 9 98 94 15 62 21 44 99 95 11 92 1 56 88 19 27 20 76 13 8 91 89 83 43

result:

ok 

Test #35:

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

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

result:

ok 

Test #36:

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

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

result:

ok 

Test #37:

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

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 10 31 61 11 75 82 84 62 16 4 95 57 67 36 96 94 12 69 32 78 97 20 27 42 83 33 5 64 72 23 44 29 8 60 70 89 2 46 79 86 47 14 39 68 63 13 98 45 71 30 17 91 80 74 37 58 28 49 43 21 55 56 76 81 35 6 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: 2ms
memory: 9500kb

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 23 54 4 76 84 45 2 81 57 12 6 33 88 37 59 67 58 52 49 65 8 71 96 91 92 100 13 68 34 97 77 27 25 18 99 61 55 39 44 78 26 87 40 80 22 17 14 64 69 89 86 5 11 21 3 72 19 28 93 50 10 1

result:

ok 

Test #39:

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

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

result:

ok 

Test #40:

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

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

result:

ok 

Test #41:

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

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

result:

ok 

Test #42:

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

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 23 56 61 93 66 75 98 94 1 35 50 71 53 2 86 82 9 40 15 55 52 37 58 12 78 59 33 51 89 7 18 73 48 77 76 54 5 74 29 62 17 60 99 83 28 30 36 11 79 70 16 3 13 68 97 20 22 14 19 6 34 85

result:

ok 

Test #43:

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

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

result:

ok 

Test #44:

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

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

result:

ok 

Test #45:

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

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 2 94 59 98 7 93 56 28 91 23 17 48 33 82 53 18 40 57 52 67 49 64 89 39 88 87 61 55 22 41 72 81 65 20 31 60 3 6 37 73 79 92 69 99 80 12 32 66 44 76 29 34 95 70 36 68 30 43 90 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: 8380kb

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 70 93 80 91 2 35 16 87 26 99 32 66 97 75 95 84 40 71 85 14 63 57 61 45 7 27 22 33 86 3 56 36 92 24 46 96 67 81 23 31 98 6 25 82 41 15 94 8 73 19 29 89 18 38 47 50 100 37 83 17 77 9 21 79 1

result:

ok 

Test #47:

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

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

result:

ok 

Test #48:

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

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

result:

ok 

Test #49:

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

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 31 73 4 28 38 8 50 36 47 89 11 81 55 61 19 99 35 20 24 18 16 23 58 27 98 72 79 37 97 15 21 40 33 46 82 96 10 95 3 71 49 69 42 77 43 87 30 85 62 80 51 2 75 56 22 91 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: 2ms
memory: 9484kb

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 92 17 58 53 66 41 49 70 35 18 13 93 95 65 68 8 27 21 22 85 81 71 75 7 19 37 96 2 29 50 46 62 86 6 99 34 84 87 83 69 44 61 72 54 76 12 51 11 98 60 14 43 52 55 38 40 64 78 10 25 20 82 30 47 1

result:

ok 

Test #51:

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

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

result:

ok 

Test #52:

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

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 45 67 80 79 35 97 92 55 63 86 46 11 87 75 16 44 2 77 65 22 6 73 59 13 50 41 24 10 39 98 21 72 81 40 15 83 42 68 17 37 49 33 53 99 48 74 62 3 28 51 78 43 36 12 61 1 95 66 14 18 100 4 54 70 25 7 19 27 60 90 57 26 30 93 9 76 88 52 32 56 58 5

result:

ok 

Test #53:

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

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 23 26 98 11 38 48 21 55 68 92 90 28 96 97 61 71 78 54 3 88 27 4 69 31 64 56 95 74 15 41 53 6 89 14 80 50 25 40 65 20 22 66 67 72 1 8 81 91 19 34 86 63 17 45 46 59 18 85 99 93 77 49 13 82 75 58 42 29 33 79 76 9 32 87 60 7 37 100 43 12 35 83 24 39 73 94

result:

ok 

Test #54:

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

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

result:

ok 

Test #55:

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

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 64 100 83 4 92 91 26 90 13 62 95 99 6 75 77 82 7 39 87 24 34 25 17 54 65 59 58 50 10 96 45 81 72 31 61 93 66 20 8 55 16 52 23 27 70 44 49 15 85 14 9 51 38 3 63 1 43 30 29 94 18 32 73 74 84 2 5 57 22 36 68

result:

ok 

Test #56:

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

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 58 60 97 57 40 98 4 38 2 46 18 24 42 39 63 6 66 70 50 31 84 16 90 25 30 55 19 72 88 17 1 96 48 91 61 45 11 54 51 93 5 85 80 62 81 67 23 27 13 15 92 53 71 21 29 89 100 10 3 68 35 12 34 56 33 65 49 69 78 14 75 28 77 73 94 82 64 74 76 41 32 8 7 59

result:

ok 

Test #57:

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

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

result:

ok 

Test #58:

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

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 68 56 20 12 83 30 80 43 15 4 86 28 81 60 40 79 39 65 99 59 77 32 49 33 27 37 69 95 31 50 8 92 84 89 70 53 29 66 54 13 47 14 76 45 96 44 88 1 78 73 5 85 9 64 41 90 52 48 57 3 67 34 24 91 63 19 62 46 82 35 72 51 38 97 6 11 18 10

result:

ok 

Test #59:

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

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 72 61 96 87 9 91 55 31 18 13 6 45 80 57 47 71 65 93 42 64 70 88 63 54 30 1 67 81 86 92 41 21 94 97 35 15 98 3 14 38 84 76 39 78 37 2 95 82 20 29 50 66 73 8 99 48 22 85 25 27 46 19 53 34 69 79 60 16 36 58 83 90 11

result:

ok 

Test #60:

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

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

result:

ok 

Test #61:

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

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

result:

ok 

Test #62:

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

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

result:

ok 

Test #63:

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

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

result:

ok 

Test #64:

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

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

result:

ok 

Test #65:

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

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

result:

ok 

Test #66:

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

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

result:

ok 

Test #67:

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

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

result:

ok 

Test #68:

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

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

result:

ok 

Test #69:

score: 0
Accepted
time: 262ms
memory: 19104kb

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:

No

result:

ok 

Test #70:

score: 0
Accepted
time: 259ms
memory: 18636kb

input:

10000
1985 1
6714 1985
3491 6714
8283 3491
3834 8283
428 3834
6210 428
3475 6210
4076 3475
2725 4076
3895 2725
789 3895
8096 789
219 8096
9077 219
672 9077
9958 672
7902 9958
1629 7902
9851 1629
4118 9851
8962 4118
1083 8962
7406 1083
6775 7406
8666 6775
1924 8666
8378 1924
3823 8378
3485 3823
6634 ...

output:

No

result:

ok 

Test #71:

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

input:

10000
5230 1
3501 1
186 1
534 1
6547 1
807 1
5407 1
6108 1
3005 1
7908 1
7694 1
410 1
4717 1
617 1
9745 1
7587 1
2657 1
3754 1
98 1
7150 1
7103 1
3002 1
8670 1
7882 1
5989 1
2462 1
3948 1
7396 1
9041 1
1449 1
2602 1
8688 1
7366 1
2193 1
6594 1
9830 1
9402 1
8094 1
7659 1
9635 1
1379 1
8722 1
2187 1
...

output:

Yes
5230 3501 186 534 6547 807 5407 6108 3005 7908 7694 410 4717 617 9745 7587 2657 3754 98 7150 7103 3002 8670 7882 5989 2462 3948 7396 9041 1449 2602 8688 7366 2193 6594 9830 9402 8094 7659 9635 1379 8722 2187 8637 7735 6187 588 3859 2615 511 9839 59 1900 4862 5157 6044 1412 1575 9385 112 8194 244...

result:

ok 

Test #72:

score: 0
Accepted
time: 9ms
memory: 12336kb

input:

10000
7754 1
3415 1
9786 1
3269 1
3938 1
4680 1
8676 1
7067 1
1079 1
8101 1
1490 1
6306 1
808 1
6003 1
2748 1
9129 1
8509 1
7081 1
7668 1
5179 1
4113 1
1411 1
3169 1
206 1
7234 1
9263 1
7877 1
5388 1
4764 1
637 1
7089 1
4357 1
3952 1
8067 1
6222 1
8652 1
7066 1
8475 1
5963 1
3496 1
6013 1
4206 1
793...

output:

Yes
7754 3415 9786 3269 3938 4680 8676 7067 1079 8101 1490 6306 808 6003 2748 9129 8509 7081 7668 5179 4113 1411 3169 206 7234 9263 7877 5388 4764 637 7089 4357 3952 8067 6222 8652 7066 8475 5963 3496 6013 4206 7932 4474 3866 7031 3262 9554 5476 2471 51 3742 6547 8223 1215 5171 4467 7189 3731 8264 5...

result:

ok 

Test #73:

score: 0
Accepted
time: 228ms
memory: 18332kb

input:

10000
1626 1
2160 1626
6051 2160
9515 6051
4912 9515
8661 4912
5657 8661
5109 5657
936 5109
3363 936
9242 3363
7877 9242
9374 7877
4128 9374
1441 4128
6657 1441
1583 6657
8601 1583
1759 8601
638 1759
7661 638
9377 7661
4039 9377
2557 4039
6912 2557
2019 6912
7965 2019
4662 7965
8310 4662
1579 8310
9...

output:

Yes
8940 3442 3155 1 3654 1241 4912 4768 7293 5657 4191 6886 1513 6828 3303 3962 5190 4128 6550 1235 574 6463 3363 7048 2346 1670 6081 7877 6912 6657 1579 8601 1329 3743 3159 6982 9636 8511 5902 7590 1543 7108 5085 1627 7057 6051 4315 9206 20 3422 1789 215 6123 3038 3870 9377 3639 8834 3700 2724 447...

result:

ok 

Test #74:

score: 0
Accepted
time: 215ms
memory: 17620kb

input:

10000
1063 1
7709 1063
9176 7709
8475 9176
8010 8475
6050 8010
2560 6050
8443 2560
7064 8443
4686 7064
2807 4686
255 2807
2714 255
428 2714
5129 428
2363 5129
2419 2363
9175 2419
8947 9175
823 8947
8532 823
5412 8532
140 5412
1794 140
2090 1794
4491 2090
9274 4491
3089 9274
6883 3089
1578 6883
6157 ...

output:

Yes
4419 2646 1063 798 7331 3104 8337 2610 3201 8010 4890 6204 3427 4491 4686 255 6937 4123 2419 2247 783 658 4646 722 3009 2560 9651 2331 8947 3873 5123 5203 8182 5076 2835 7499 9175 8390 4249 6123 7980 8052 2249 2090 3089 3404 982 6291 1683 2471 6743 7012 3890 3017 3024 6834 6058 7709 1605 489 853...

result:

ok 

Test #75:

score: 0
Accepted
time: 4ms
memory: 11364kb

input:

10000
52 1
1236 1
2612 1
4025 1
7647 1
8945 1
8005 1
3507 1
6149 1
1364 1
4277 1
7402 1
9669 1
734 1
6982 1
8804 1
5257 1
6146 1
5518 1
8259 1
1398 1
6550 1
1362 1
4109 1
6898 1
3529 1
6876 1
5087 1
5258 1
7682 1
5826 1
7925 1
7689 1
4496 1
8410 1
1404 1
743 1
3016 1
9269 1
2183 1
6584 1
2494 1
9314...

output:

Yes
52 1236 2612 4025 7647 8945 8005 3507 6149 1364 4277 7402 9669 734 6982 8804 5257 6146 5518 8259 1398 6550 1362 4109 6898 3529 6876 5087 5258 7682 5826 7925 7689 4496 8410 1404 743 3016 9269 2183 6584 2494 9314 954 8680 9692 5542 301 3668 5126 1800 7685 6891 8052 1713 7809 7994 1376 3424 5904 52...

result:

ok 

Test #76:

score: 0
Accepted
time: 9ms
memory: 12848kb

input:

10000
183 1
5107 1
9584 1
5745 1
1889 1
6282 1
8157 1
7251 1
3265 1
9800 1
3981 1
7570 1
992 1
6501 1
5620 1
1995 1
49 1
9267 1
7493 1
1514 1
8961 1
630 1
2289 1
4262 1
6147 1
8512 1
5241 1
1556 1
8273 1
2777 1
7319 1
4548 1
863 1
1044 1
180 1
5825 1
4726 1
4017 1
5897 1
5624 1
5475 1
391 1
637 1
54...

output:

Yes
183 5107 9584 5745 1889 6282 8157 7251 3265 9800 3981 7570 992 6501 5620 1995 49 9267 7493 1514 8961 630 2289 4262 6147 8512 5241 1556 8273 2777 7319 4548 863 1044 180 5825 4726 4017 5897 5624 5475 391 637 5484 1864 178 3450 2329 3615 6593 6585 9364 3923 4766 7195 9935 4795 2300 4868 7040 3079 6...

result:

ok 

Test #77:

score: 0
Accepted
time: 257ms
memory: 18332kb

input:

10000
5655 1
7163 5655
7130 7163
9895 7130
131 9895
6890 131
4212 6890
3056 4212
362 3056
1170 362
2491 1170
8377 2491
5830 8377
7164 5830
325 7164
9764 325
2095 9764
9101 2095
9182 9101
6740 9182
7011 6740
3989 7011
5996 3989
6677 5996
1604 6677
6705 1604
7119 6705
3530 7119
4675 3530
6995 4675
925...

output:

Yes
1 7865 5655 7163 1364 1021 7834 3294 6890 3184 8518 7802 8119 131 2291 5816 2491 2095 4963 9741 3278 7425 1745 2979 8377 6441 9469 9946 8479 5743 5540 945 1522 4722 3931 5596 2654 6874 2010 5492 1170 7164 9375 3534 3056 5312 7811 7266 7479 5350 9778 5830 2249 2987 8812 4318 6896 1374 4030 4675 2...

result:

ok 

Test #78:

score: 0
Accepted
time: 241ms
memory: 18824kb

input:

10000
262 1
4219 262
5287 4219
2093 5287
3553 2093
4075 3553
6456 4075
2468 6456
8490 2468
5491 8490
8342 5491
8976 8342
7644 8976
576 7644
2700 576
4839 2700
7965 4839
2169 7965
6105 2169
1173 6105
9016 1173
3162 9016
923 3162
1199 923
1691 1199
1367 1691
8158 1367
1957 8158
3470 1957
9937 3470
783...

output:

Yes
8750 2499 4219 5848 6580 262 4075 2575 2468 6398 6126 4657 3523 8262 5491 6140 2093 7633 3219 3788 8965 8544 97 9954 4289 3162 8705 7644 1375 2676 3267 2770 7653 6456 664 153 2960 7965 8919 4436 8696 1890 1691 4610 8342 2169 9127 5273 46 781 3097 4108 5123 9120 4457 669 8823 7799 5019 5438 6632 ...

result:

ok 

Test #79:

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

input:

10000
5693 1
8407 1
684 1
2937 1
4972 1
9264 1
6885 1
121 1
5814 1
7354 1
361 1
5377 1
5388 1
9161 1
473 1
1618 1
573 1
7902 1
5404 1
8223 1
6086 1
4937 1
3466 1
7729 1
5127 1
676 1
7192 1
4209 1
5522 1
3005 1
5533 1
131 1
3059 1
253 1
724 1
8006 1
8986 1
7036 1
5255 1
6495 1
6834 1
7056 1
840 1
60 ...

output:

Yes
5693 8407 684 2937 4972 9264 6885 121 5814 7354 361 5377 5388 9161 473 1618 573 7902 5404 8223 6086 4937 3466 7729 5127 676 7192 4209 5522 3005 5533 131 3059 253 724 8006 8986 4775 7036 5255 6495 6834 7056 840 60 2777 2716 8448 1113 5338 8763 9153 9621 5981 3732 1540 1048 4029 7510 6545 9444 832...

result:

ok 

Test #80:

score: 0
Accepted
time: 3ms
memory: 11508kb

input:

10000
8518 1
6511 1
5792 1
1024 1
8602 1
3999 1
3164 1
6473 1
460 1
5783 1
1406 1
602 1
4905 1
3669 1
6882 1
3190 1
7074 1
5220 1
4455 1
2362 1
3671 1
6869 1
9553 1
7035 1
1356 1
255 1
3047 1
6089 1
4304 1
5609 1
5736 1
2843 1
6803 1
4943 1
6040 1
7643 1
5654 1
5632 1
2612 1
4734 1
7519 1
9672 1
401...

output:

Yes
8518 6511 5792 1024 8602 3999 3164 6473 460 5783 1406 602 4905 3669 6882 3190 7074 5220 4455 2362 3671 6869 9553 7035 1356 255 3047 6089 4304 5609 5736 2843 6803 4943 6040 7643 5654 5632 2612 4734 7519 9672 4010 250 2372 9766 7113 5559 5768 1542 5649 9403 5447 8159 5808 7497 9913 349 9128 6176 7...

result:

ok 

Test #81:

score: 0
Accepted
time: 178ms
memory: 19436kb

input:

10000
9246 1
7433 1
64 9246
4654 7433
1898 64
2120 1898
3869 2120
4305 4654
6589 4305
3865 3869
6209 3865
7312 6589
2125 6209
7876 2125
3980 7876
7161 7312
5214 7161
3648 3980
3288 5214
9996 3288
8192 3648
9267 9996
7953 9267
5868 8192
1558 5868
3753 7953
7172 3753
8098 7172
7671 8098
3289 1558
8072...

output:

Yes
2953 2116 2575 1 4768 1359 8100 1068 6455 5817 9292 3855 3648 9212 2710 2891 6043 6209 5007 770 2735 2100 2119 4046 579 5937 9330 6073 9888 954 1577 1725 5118 9202 9469 880 7008 8357 8823 9336 1898 6774 3121 6999 3911 7903 7289 601 2732 2505 6230 1525 1428 6093 2155 4926 7067 8435 6452 8821 9002...

result:

ok 

Test #82:

score: 0
Accepted
time: 194ms
memory: 18440kb

input:

10000
9869 1
1294 1
1599 1294
9493 1599
7496 9493
1169 7496
2315 1169
7701 2315
2557 7701
5818 2557
1061 5818
9041 1061
6196 9041
7095 6196
1977 7095
2601 1977
5967 2601
1121 5967
283 1121
9173 9869
3977 283
4337 3977
1030 4337
4688 1030
4569 4688
2000 4569
9938 2000
6631 9173
4565 9938
3309 4565
24...

output:

Yes
1644 6044 2964 2535 807 573 5256 7611 4131 7499 9561 8449 7088 1166 6723 4860 3671 5624 7678 2649 6692 8572 6233 3547 8149 7029 5962 4797 4540 5269 5588 5672 4806 9255 7870 1539 5641 2576 663 7154 3535 5846 2217 7751 7416 4056 6145 1319 7556 9144 696 9173 8599 3025 7527 3893 5964 7841 6745 559 5...

result:

ok 

Test #83:

score: 0
Accepted
time: 10ms
memory: 12160kb

input:

10000
5386 1
5551 1
3526 1
4007 1
5312 1
6705 1
1244 1
1954 1
5605 1
7194 1
6840 1
3575 1
4713 1
8036 1
896 1
4940 1
1736 1
8000 1
6735 1
77 1
5188 1
4026 1
7144 1
448 1
4140 1
6949 1
7397 1
4764 1
2287 1
2826 1
4045 1
6455 1
3078 1
2303 1
6342 1
3914 1
3746 1
5859 1
3638 1
1687 1
9532 1
4923 1
6216...

output:

Yes
5386 5551 3526 4007 5312 6705 1244 1954 5605 7194 6840 3575 4713 8036 896 4940 1736 8000 6735 77 5188 4026 7144 448 4140 6949 7397 4764 2287 2826 4045 6455 3078 2303 6342 3914 3746 5859 3638 1687 9532 4923 6216 592 4213 2192 3023 5678 4216 43 3971 9773 4055 5848 8785 8025 3819 8090 1239 5293 894...

result:

ok 

Test #84:

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

input:

10000
4529 1
6877 1
7360 1
8666 1
219 1
6010 1
4996 1
4212 1
5390 1
4939 1
5847 1
5434 1
2688 1
2564 1
5901 1
1395 1
2871 1
1973 1
5470 1
6465 1
8594 1
2999 1
136 1
2772 1
6831 1
3192 1
5732 1
9093 1
3748 1
8832 1
6874 1
9108 1
7946 1
6165 1
5251 1
4971 1
2730 1
3964 1
2451 1
3336 1
671 1
6990 1
713...

output:

Yes
4529 6877 7360 8666 219 6010 4996 4212 5390 4939 5847 5434 2688 2564 5901 1395 2871 1973 5470 6465 8594 2999 136 2772 6831 3192 5732 9093 3748 8832 6874 9108 7946 6165 5251 4971 2730 3964 2451 3336 671 6990 7133 2920 7916 8717 3414 6253 1371 4676 7580 3826 4803 5107 4690 6139 8415 6812 7395 4743...

result:

ok 

Test #85:

score: 0
Accepted
time: 224ms
memory: 18724kb

input:

10000
9442 1
3365 1
5470 3365
1531 9442
2286 5470
3435 1531
6149 3435
8191 6149
5362 2286
4180 8191
4547 5362
5899 4547
58 5899
9468 58
8640 9468
6465 8640
3488 4180
6277 3488
9041 6277
812 6465
8024 812
9088 8024
9215 9041
4580 9088
1917 4580
7204 1917
3205 9215
3285 3205
7230 7204
9552 7230
6808 9...

output:

Yes
9586 7384 5606 8417 6488 5500 1667 2380 1688 916 9424 6078 2112 5452 3488 4245 9215 6571 302 1767 6342 3205 3758 3036 4771 4145 9893 2819 750 6408 4109 23 159 3345 6184 8879 7784 1557 1829 3940 3468 2906 593 8472 1531 295 9456 5433 9752 2787 7245 4613 5461 2382 2685 4215 6285 6245 9230 3285 2268...

result:

ok 

Test #86:

score: 0
Accepted
time: 221ms
memory: 20520kb

input:

10000
2368 1
7613 1
644 7613
521 2368
379 521
5149 644
2106 5149
8659 2106
4644 8659
5501 4644
1554 5501
4971 1554
6280 4971
7633 6280
7212 7633
9241 7212
7481 9241
5592 7481
5296 5592
7233 5296
2797 7233
4588 2797
4040 4588
2341 4040
5217 2341
6508 5217
9830 6508
1189 9830
2420 1189
6696 2420
3960 ...

output:

Yes
1 7040 8853 379 9219 128 7697 1711 8838 1368 5056 8027 6519 9940 2219 2048 9403 4035 2084 2673 6862 1170 4305 2126 8092 8680 3934 2750 2728 4226 6518 7010 1831 7398 2367 6453 1094 3018 6142 8361 8935 7325 6058 3789 6965 2465 7833 7640 9702 4174 8628 228 3663 8599 6527 9956 4055 9908 4767 1540 48...

result:

ok 

Test #87:

score: 0
Accepted
time: 4ms
memory: 11712kb

input:

10000
8415 1
5765 1
612 1
6876 1
6237 1
5401 1
9549 1
6178 1
180 1
5641 1
700 1
2846 1
6410 1
9540 1
302 1
556 1
9218 1
4686 1
963 1
2263 1
2897 1
296 1
8723 1
4892 1
9185 1
2586 1
8158 1
7749 1
5169 1
6685 1
8232 1
6132 1
3113 1
6049 1
483 1
1313 1
3166 1
949 1
5506 1
4219 1
1865 1
4771 1
4074 1
57...

output:

Yes
8415 5765 612 6876 6237 5401 9549 6178 180 5641 700 2846 6410 9540 302 556 9218 4686 963 2263 2897 296 8723 4892 9185 2586 8158 7749 5169 6685 8232 6132 3113 6049 483 1313 3166 949 5506 4219 1865 4771 4074 572 7159 9467 8992 7741 9436 8065 9013 2012 1029 1294 6995 6584 6383 7126 1153 2640 1018 1...

result:

ok 

Test #88:

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

input:

10000
3864 1
97 1
179 1
8024 1
1957 1
1799 1
66 1
7341 1
9831 1
6741 1
7245 1
5584 1
6414 1
7085 1
6735 1
883 1
5299 1
3145 1
9667 1
6519 1
8874 1
5496 1
3752 1
5685 1
5049 1
9658 1
4818 1
4345 1
5159 1
2548 1
8655 1
3798 1
7705 1
9574 1
2374 1
2670 1
6641 1
2052 1
6017 1
8400 1
30 1
2071 1
1433 1
5...

output:

Yes
3864 97 179 8024 1957 1799 66 7341 9831 6741 7245 5584 6414 7085 6735 883 5299 3145 9667 6519 8874 5496 3752 5685 5049 9658 4818 4345 5159 2548 8655 3798 7705 9574 2374 2670 6641 2052 6017 8400 30 2071 1433 5653 2421 8703 4474 5806 9865 7518 5914 5028 9977 3390 547 4054 4196 2867 2923 3886 1634 ...

result:

ok 

Test #89:

score: 0
Accepted
time: 251ms
memory: 17700kb

input:

10000
4442 1
4129 1
67 4129
7845 67
4027 7845
9829 4442
6594 4027
7960 6594
4697 7960
554 9829
672 554
6455 672
1272 6455
1300 1272
4352 1300
2120 4697
1078 4352
4144 1078
5752 2120
6550 4144
3079 6550
8209 5752
6710 8209
3041 6710
7171 3079
7115 3041
7443 7115
7551 7171
6359 7551
9634 7443
1961 635...

output:

Yes
1503 6361 8339 801 9829 4377 672 2658 1 33 1272 1078 3086 1430 5668 395 6359 2822 6615 5615 2795 2855 109 7270 6568 6455 8428 4592 4045 9430 745 7961 8223 3224 3587 8429 4083 8615 5432 7440 192 554 2913 2063 5586 8150 8655 6829 1341 3707 2593 5906 8471 6154 5658 4144 2894 8497 7360 7698 6550 134...

result:

ok 

Test #90:

score: 0
Accepted
time: 307ms
memory: 18112kb

input:

10000
3383 1
2580 1
7168 2580
6366 3383
3132 7168
2015 3132
6734 2015
7818 6734
9690 7818
2280 6366
3856 9690
200 3856
7842 200
7954 7842
5229 7954
2933 5229
5747 2933
1089 5747
5251 1089
1900 2280
4787 5251
4801 4787
374 1900
2148 374
6815 4801
9937 6815
4876 9937
9278 2148
1815 4876
3764 1815
4299...

output:

Yes
7704 7767 6366 9608 2280 2732 8237 9278 5833 1 9065 4900 3443 3722 7299 2148 1900 3310 2982 1170 493 4563 3949 9365 7774 6575 1258 8885 9455 8823 7112 7507 3185 3837 1112 1069 9725 5576 2709 2708 615 6089 2421 4078 4959 8659 1467 6441 4362 2829 374 983 2946 3626 5850 7840 8978 8935 9912 2245 482...

result:

ok 

Test #91:

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

input:

10000
3509 1
1968 1
1468 1
6194 1
8541 1
9091 1
2279 1
3250 1
9450 1
1717 1
6968 1
6845 1
4818 1
3351 1
4477 1
7153 1
7861 1
6643 1
7939 1
1439 1
6238 1
6370 1
6261 1
2159 1
9468 1
4963 1
8137 1
7027 1
9359 1
5666 1
9549 1
7401 1
1312 1
3850 1
3029 1
2690 1
1595 1
7831 1
1183 1
6902 1
9872 1
7549 1
...

output:

Yes
3509 1968 1468 6194 8541 9091 2279 3250 9450 1717 6968 6845 4818 3351 4477 7153 7861 6643 7939 1439 6238 6370 6261 2159 9468 4963 8137 7027 9359 5666 9549 7401 1312 3850 3029 2690 1595 7831 1183 6902 9872 7549 9123 7658 7228 3151 8264 6576 2823 4276 1400 6715 1059 3199 4704 7755 4637 2363 2557 9...

result:

ok 

Test #92:

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

input:

10000
3263 1
4405 1
7526 1
8767 1
1797 1
3838 1
7224 1
7143 1
8507 1
8814 1
6866 1
6872 1
7568 1
7336 1
1001 1
6327 1
2112 1
5357 1
49 1
7926 1
8293 1
4445 1
4338 1
657 1
4240 1
8939 1
2781 1
6936 1
3249 1
6486 1
4993 1
2532 1
310 1
4785 1
2548 1
8028 1
2481 1
3037 1
7066 1
2302 1
1370 1
7338 1
4728...

output:

Yes
3263 4405 7526 8767 1797 3838 7224 7143 8507 8814 6866 6872 7568 7336 1001 6327 2112 5357 49 7926 8293 4445 4338 657 4240 8939 2781 6936 3249 6486 4993 2532 310 4785 2548 8028 2481 3037 7066 2302 1370 7338 4728 7527 6010 1830 1689 3021 4930 9393 8119 4709 7471 8252 1412 522 1303 6986 6977 1270 6...

result:

ok 

Test #93:

score: 0
Accepted
time: 179ms
memory: 14872kb

input:

10000
220 1
3379 1
7226 1
9643 220
1928 3379
636 7226
5362 1928
3245 636
7717 9643
594 7717
7741 5362
2430 3245
5836 2430
8279 7741
4215 5836
4017 4215
3757 4017
7714 8279
5524 7714
5625 3757
3936 5524
9006 3936
7020 594
5732 9006
7892 5625
4893 7892
7125 5732
9525 4893
2670 7020
1989 2670
5097 1989...

output:

Yes
9435 3235 3891 4499 5332 9776 734 8774 2560 4754 7102 7160 6779 2471 5935 6682 9039 7717 9633 6035 3312 6182 6284 4876 2514 8990 7774 4823 7216 8107 490 675 828 594 1188 9552 5201 7257 6361 5435 62 2722 1980 361 9453 7530 7872 5626 6287 5387 8331 8465 6567 1627 8742 4220 5061 9900 6556 128 6336 ...

result:

ok 

Test #94:

score: 0
Accepted
time: 256ms
memory: 18088kb

input:

10000
4934 1
1016 1
6795 1
2033 6795
5542 2033
533 5542
471 533
4890 471
8718 4890
8830 1016
6799 8718
3770 6799
4902 3770
4302 4902
2173 4302
5160 2173
8216 5160
3589 8216
4918 3589
5432 4918
5727 8830
2164 5432
4510 2164
7554 4510
5133 7554
1193 5727
9568 5133
5620 9568
1505 1193
3585 5620
5831 15...

output:

Yes
7223 1451 8190 8874 4046 683 3017 7477 6893 4452 3508 6896 8522 1206 3434 8201 9779 91 7128 514 5736 4674 1284 3619 9350 4743 3337 2603 7988 9405 9994 7868 4140 3733 3343 3151 1643 7118 7154 7672 5616 315 7555 6704 2874 3766 574 9155 6716 5523 2747 40 834 8070 5979 439 9079 4789 8134 4917 3332 7...

result:

ok 

Test #95:

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

input:

10000
7689 1
6923 1
4332 1
47 1
5638 1
5513 1
4933 1
9969 1
9063 1
3381 1
9326 1
7499 1
6502 1
1829 1
7966 1
2776 1
3879 1
3085 1
2806 1
712 1
6 1
8776 1
8526 1
791 1
5684 1
973 1
7780 1
891 1
3363 1
8751 1
3978 1
7384 1
6363 1
2310 1
9392 1
1176 1
4148 1
5021 1
4999 1
4804 1
8307 1
1726 1
3742 1
87...

output:

Yes
7689 6923 4332 47 5638 5513 4933 9969 9063 3381 9326 7499 6502 1829 7966 2776 3879 3085 2806 712 6 8776 8526 791 5684 973 7780 891 3363 8751 3978 7384 6363 2310 9392 1176 4148 5021 4999 4804 8307 1726 3742 8756 6820 936 8538 9208 2788 8655 3241 3061 9304 2494 5099 7908 7411 7942 608 7478 964 640...

result:

ok 

Test #96:

score: 0
Accepted
time: 5ms
memory: 11964kb

input:

10000
2809 1
3327 1
6904 1
5098 1
7246 1
1906 1
5510 1
4095 1
3077 1
125 1
1171 1
5739 1
8148 1
9027 1
5742 1
3053 1
452 1
2632 1
6931 1
4015 1
8546 1
6096 1
9698 1
9629 1
2107 1
9169 1
4628 1
6847 1
2004 1
3613 1
4737 1
262 1
6595 1
7804 1
4924 1
5924 1
2775 1
8759 1
4482 1
4089 1
6117 1
9034 1
150...

output:

Yes
2809 3327 6904 5098 7246 1906 5510 4095 3077 125 1171 5739 8148 9027 5742 3053 452 2632 6931 4015 8546 6096 9698 9629 2107 9169 4628 6847 2004 3613 4737 262 6595 7804 4924 5924 2775 8759 4482 4089 6117 9034 1505 4802 6113 2761 441 8077 3751 4676 4041 9552 9470 9131 9951 1897 9053 3170 4723 8561 ...

result:

ok 

Test #97:

score: 0
Accepted
time: 282ms
memory: 16860kb

input:

10000
261 1
1448 1
3817 1
1333 261
9848 1333
2898 3817
2695 9848
4263 2898
8357 1448
2747 8357
2771 2747
1093 4263
3754 1093
6888 3754
8237 2695
3562 6888
7915 3562
2111 7915
8563 2771
7490 2111
9126 8563
2619 8237
1909 7490
8767 1909
2335 2619
5384 2335
3337 8767
1955 5384
2687 9126
8567 3337
5285 ...

output:

Yes
9240 4696 634 9691 1900 2683 9538 497 8670 3400 3245 957 6657 6969 1183 1 8237 8587 9980 8257 2039 7952 3793 7600 3099 8401 4562 9 5550 1271 8818 6737 3236 261 2758 9411 1162 2365 8313 1420 1333 4186 6244 274 3841 4074 3087 337 4934 3555 9167 2943 1894 9782 8755 2253 1099 5905 9072 4206 5205 483...

result:

ok 

Test #98:

score: 0
Accepted
time: 244ms
memory: 18688kb

input:

10000
8483 1
5301 1
3635 1
971 3635
6724 5301
1452 971
9921 1452
631 9921
5483 6724
4966 631
435 5483
6835 4966
7180 6835
5698 435
5920 7180
318 5920
7437 318
7225 7437
957 8483
702 5698
6591 7225
8076 6591
5621 8076
781 5621
799 702
9387 781
843 9387
4567 843
3368 4567
5007 3368
6415 5007
5263 6415...

output:

Yes
1 5868 6899 7121 8543 5572 5799 6056 6488 5113 5991 8483 7905 1627 6303 2134 4164 7061 9178 6398 5785 974 6565 958 2017 6073 527 208 5110 8310 1149 8285 1975 6590 1109 7530 5919 8159 4458 957 6575 5535 3813 8791 266 6519 7687 4918 6804 3650 9201 479 7780 8088 989 7861 9155 7607 4827 5719 7892 40...

result:

ok 

Test #99:

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

input:

10000
5441 1
557 1
4287 1
4863 1
9386 1
1260 1
8811 1
4889 1
8739 1
8882 1
963 1
9639 1
2773 1
6372 1
2502 1
561 1
4431 1
4908 1
1832 1
5650 1
6581 1
2900 1
6125 1
4225 1
4988 1
2308 1
7485 1
436 1
1515 1
3633 1
6333 1
2538 1
563 1
4915 1
2542 1
8279 1
2686 1
1987 1
2236 1
5602 1
6629 1
7957 1
3648 ...

output:

Yes
5441 557 4287 4863 9386 1260 8811 4889 8739 8882 963 9639 2773 6372 2502 561 4431 4908 1832 5650 6581 2900 6125 4225 4988 2308 7485 436 1515 3633 6333 2538 563 4915 2542 8279 2686 1987 2236 5602 6629 7957 3648 7271 8930 378 9144 2460 8372 4761 6337 1362 7791 2654 6144 8053 4439 7699 3146 4856 14...

result:

ok 

Test #100:

score: 0
Accepted
time: 7ms
memory: 11776kb

input:

10000
8039 1
5956 1
5668 1
5041 1
6162 1
2642 1
7555 1
7551 1
3532 1
5559 1
4812 1
9324 1
9546 1
4424 1
4281 1
6397 1
2833 1
4161 1
664 1
4487 1
7533 1
1692 1
9297 1
956 1
5139 1
4427 1
2158 1
7213 1
2346 1
7202 1
6094 1
2302 1
9620 1
2007 1
6607 1
6963 1
5439 1
2665 1
2502 1
7614 1
5578 1
6349 1
50...

output:

Yes
8039 5956 5668 5041 6162 2642 7555 7551 3532 5559 4812 9324 9546 4424 4281 6397 2833 4161 664 4487 7533 1692 9297 956 5139 4427 2158 7213 2346 7202 6094 2302 9620 2007 6607 6963 5439 2665 2502 7614 5578 6349 5084 7113 5198 6158 9963 6464 5540 5305 9464 2454 2464 3021 9950 1445 3994 1729 5826 839...

result:

ok 

Test #101:

score: 0
Accepted
time: 307ms
memory: 17860kb

input:

10000
1955 1
6121 1
5622 1
5594 1955
1701 5594
1009 5622
1279 1009
6670 6121
6695 6670
2072 1279
7315 1701
3143 2072
7341 3143
8809 7341
2081 7315
6245 2081
6872 8809
9327 6245
52 9327
1198 6695
6676 6872
707 1198
4401 707
9691 52
555 9691
4896 4401
852 6676
8877 555
6726 4896
8837 6726
3682 8837
78...

output:

Yes
9901 5365 297 6675 763 5594 5231 4570 52 3303 9278 3664 8628 6856 9235 9092 6245 9869 8788 341 9149 4836 7640 2820 9686 1887 78 7315 8168 9988 2691 9331 4458 6857 6355 7833 9554 5969 6022 7038 2686 2262 1547 9029 9025 7722 6469 9490 8812 9798 278 5074 4493 7564 7897 119 1772 3341 6964 6499 5514 ...

result:

ok 

Test #102:

score: 0
Accepted
time: 293ms
memory: 18588kb

input:

10000
7232 1
5225 1
4149 1
6424 4149
3117 6424
6367 3117
4620 5225
9755 6367
2618 9755
6800 4620
4311 6800
1121 2618
8133 1121
2792 8133
965 2792
6648 4311
7582 6648
4369 7582
5205 965
4408 5205
1173 4408
6247 1173
4597 4369
2049 6247
2510 2049
8474 2510
3974 8474
5767 3974
7794 5767
4976 7794
7513 ...

output:

Yes
7081 3863 2923 7232 2657 8442 4185 4652 4643 2745 7458 1710 9610 3908 4982 4664 5133 9593 5101 2228 1639 1826 1943 8484 4851 4129 3793 5751 3652 7035 8375 2984 2155 5623 8254 9475 2629 7302 8432 3945 6361 86 408 20 4174 9746 1251 7856 3539 9319 1295 1742 8455 2957 1465 1155 7283 491 4732 95 5504...

result:

ok 

Test #103:

score: 0
Accepted
time: 4ms
memory: 11984kb

input:

10000
3321 1
6009 1
2559 1
9925 1
9270 1
4822 1
7666 1
1848 1
1652 1
9697 1
7186 1
7437 1
68 1
2240 1
5650 1
6282 1
7250 1
334 1
1708 1
7523 1
2603 1
9855 1
5957 1
9164 1
2210 1
7632 1
9204 1
3934 1
9260 1
5826 1
1748 1
4076 1
4133 1
7179 1
2087 1
5284 1
5041 1
958 1
9676 1
2957 1
4172 1
4888 1
9003...

output:

Yes
3321 6009 2559 9925 9270 4822 7666 1848 1652 9697 7186 7437 68 2240 5650 6282 7250 334 1708 7523 2603 9855 5957 9164 2210 7632 9204 3934 9260 5826 1748 4076 4133 7179 2087 5284 5041 958 9676 2957 4172 4888 9003 5504 4950 5984 6289 309 3282 4522 3080 3117 9904 2647 2729 9117 4721 2078 4465 2725 7...

result:

ok 

Test #104:

score: 0
Accepted
time: 10ms
memory: 12692kb

input:

10000
1116 1
398 1
751 1
613 1
6946 1
5853 1
4101 1
6583 1
1261 1
120 1
3633 1
3109 1
4721 1
5123 1
1346 1
7753 1
2381 1
3347 1
3740 1
6370 1
9088 1
281 1
8339 1
838 1
7258 1
1520 1
1552 1
1443 1
7636 1
5465 1
8248 1
9829 1
2539 1
7519 1
7188 1
506 1
3534 1
9848 1
5937 1
2765 1
3756 1
7607 1
7914 1
...

output:

Yes
1116 398 751 613 6946 5853 4101 6583 1261 120 3633 3109 4721 5123 1346 7753 2381 3347 3740 6370 9088 281 8339 838 7258 1520 1552 1443 7636 5465 8248 9829 2539 7519 7188 506 3534 9848 5937 2765 3756 7607 7914 9440 4620 516 12 8259 5450 2971 8557 323 3557 5543 46 777 2591 5255 1904 3657 6603 3165 ...

result:

ok 

Test #105:

score: 0
Accepted
time: 153ms
memory: 14624kb

input:

10000
7237 1
2928 1
3881 1
3462 1
6432 3462
3679 6432
5041 3679
1934 5041
1275 2928
2694 1275
7956 3881
9746 2694
8073 1934
4567 7237
5699 9746
3795 4567
9302 7956
5349 8073
6163 9302
1296 5699
9410 5349
2938 9410
2266 1296
3259 2938
8915 6163
6140 2266
9412 3795
283 6140
3838 3259
2923 3838
6649 89...

output:

Yes
9163 3968 3355 6772 3692 4251 4703 1181 9505 4681 9264 7791 9061 8691 9013 8445 2174 7469 3247 3448 1989 6366 6508 7991 3170 3860 3790 7894 6031 9976 8617 9196 6462 7667 9209 6397 3940 3263 6425 1498 5769 7901 9776 7599 8222 907 4702 4633 488 8132 9998 3033 6362 4563 9628 2326 3426 5635 3645 171...

result:

ok 

Test #106:

score: 0
Accepted
time: 195ms
memory: 17424kb

input:

10000
6913 1
2847 1
6796 1
6252 1
9021 6252
980 6796
3309 9021
3631 980
5528 3309
3224 3631
5115 5528
7317 5115
5484 7317
2919 5484
2030 2919
2571 2030
7025 2571
2285 7025
1098 3224
5993 2285
7834 1098
2135 5993
767 2135
4347 767
7101 7834
6438 4347
9341 7101
1135 6438
7746 1135
758 7746
4369 758
96...

output:

Yes
7399 5904 9206 7699 1149 4614 5382 8778 1593 2793 945 6168 825 8058 4650 8793 8651 6125 4749 2457 9663 8052 9295 3019 9879 282 710 2580 5226 149 2796 9315 7397 3151 156 4352 1674 9581 4643 468 2540 617 7480 7885 7781 3960 4378 2880 8669 9904 7415 4598 7192 4342 5906 7600 9867 1993 2902 1347 1315...

result:

ok 

Test #107:

score: 0
Accepted
time: 10ms
memory: 12164kb

input:

10000
713 1
184 1
7426 1
9631 1
679 1
3543 1
1126 1
9312 1
8514 1
2573 1
8870 1
8510 1
3742 1
1651 1
8782 1
5352 1
8242 1
9955 1
1057 1
1767 1
6013 1
4441 1
3630 1
5531 1
341 1
7864 1
9897 1
2882 1
7255 1
9914 1
4959 1
9335 1
9206 1
9135 1
5691 1
8989 1
4342 1
1362 1
23 1
9853 1
2160 1
5795 1
7220 1...

output:

Yes
713 184 7426 9631 679 3543 1126 9312 8514 2573 8870 8510 3742 1651 8782 5352 8242 9955 1057 1767 6013 4441 3630 5531 341 7864 9897 2882 7255 9914 4959 9335 9206 9135 5691 8989 4342 1362 23 9853 2160 5795 7220 473 4364 8249 8987 8513 7481 3419 6566 3343 3727 876 8270 7544 5725 7800 3844 7843 1176...

result:

ok 

Test #108:

score: 0
Accepted
time: 10ms
memory: 12292kb

input:

10000
1986 1
5901 1
9689 1
3399 1
9214 1
6971 1
9114 1
6107 1
7259 1
5920 1
2895 1
2272 1
144 1
9557 1
6143 1
2584 1
7569 1
1698 1
6566 1
78 1
7731 1
9397 1
6178 1
2199 1
4412 1
9911 1
8560 1
9902 1
2585 1
2457 1
2142 1
3425 1
3564 1
4938 1
3093 1
1230 1
1990 1
1007 1
3787 1
3551 1
9360 1
7697 1
277...

output:

Yes
1986 5901 9689 3399 9214 6971 9114 6107 7259 5920 2895 2272 144 9557 6143 2584 7569 1698 6566 78 7731 9397 6178 2199 4412 9911 8560 9902 2585 2457 2142 3425 3564 4938 3093 1230 1990 1007 3787 3551 9360 7697 2775 5800 271 1120 833 8899 6295 6309 5834 5452 5774 4490 1119 7901 6614 3345 2366 298 34...

result:

ok 

Test #109:

score: 0
Accepted
time: 206ms
memory: 18284kb

input:

10000
7678 1
7085 1
1792 1
8374 1
1756 7085
4596 1756
6040 1792
2610 6040
5625 7678
3099 2610
6724 3099
6189 8374
2144 5625
4818 6189
11 4818
3444 4596
49 11
2961 49
4630 2961
9959 4630
9743 2144
6868 9959
3118 9743
5505 3444
6541 5505
147 6724
5958 6541
9352 5958
7602 3118
3005 7602
7089 9352
1172 ...

output:

Yes
6750 8815 2301 2107 9743 6957 5029 2144 3166 7678 937 9134 2831 205 2126 7031 1016 9045 5625 809 9719 6212 4055 6601 268 576 2059 9422 6083 7434 2950 2957 6605 7602 2315 292 6067 9473 8148 9011 2760 7099 3974 590 2667 2111 360 2408 5593 3249 8616 4147 2846 8858 8512 1970 4716 2215 9133 9939 6653...

result:

ok 

Test #110:

score: 0
Accepted
time: 211ms
memory: 19512kb

input:

10000
8195 1
7939 1
7134 1
9074 1
5015 7134
4421 9074
3044 5015
3322 4421
1111 3322
2894 1111
1533 2894
8536 1533
3617 8536
2909 3617
5163 2909
367 5163
8005 3044
2441 367
9645 2441
8433 9645
7551 8005
4049 8433
2463 7551
4193 4049
4385 4193
5529 4385
7176 5529
7338 7176
7092 7338
3603 7092
576 7939...

output:

Yes
1 9125 1497 2092 4575 6930 2821 9133 2766 7180 5557 9037 7413 6744 2782 5595 531 8195 5857 8986 4801 3691 814 7347 1138 6734 4751 7193 4642 2715 7732 7751 4653 9910 6459 7549 3829 6591 7536 3596 4224 2595 4873 5598 229 1244 8697 8233 5435 8374 5824 2204 5982 211 5960 4825 451 4012 4485 4170 9379...

result:

ok 

Test #111:

score: 0
Accepted
time: 9ms
memory: 11620kb

input:

10000
291 1
2731 1
4997 1
3640 1
9885 1
9303 1
2669 1
8517 1
2780 1
4307 1
1420 1
4913 1
4412 1
7096 1
7038 1
9891 1
4648 1
6523 1
7838 1
5027 1
1057 1
578 1
3748 1
9344 1
3866 1
8132 1
6906 1
233 1
3482 1
2362 1
599 1
2730 1
967 1
1418 1
7076 1
8908 1
325 1
2224 1
8375 1
6104 1
4610 1
248 1
8418 1
...

output:

Yes
291 2731 4997 3640 9885 9303 2669 8517 2780 4307 1420 4913 4412 7096 7038 9891 4648 6523 7838 5027 1057 578 3748 9344 3866 8132 6906 233 3482 2362 599 2730 967 1418 7076 8908 325 2224 8375 6104 4610 248 8418 6197 5669 8341 4661 4813 9758 5540 3554 4 5754 5964 2386 9991 5446 4084 2373 6761 2067 7...

result:

ok 

Test #112:

score: 0
Accepted
time: 7ms
memory: 12968kb

input:

10000
3736 1
2785 1
3204 1
6598 1
299 1
9264 1
2482 1
7411 1
7130 1
2169 1
4810 1
2249 1
7139 1
9844 1
2065 1
1354 1
275 1
4990 1
9927 1
4403 1
2731 1
2049 1
5523 1
5603 1
8149 1
7078 1
4661 1
6541 1
5390 1
8520 1
2489 1
5358 1
4540 1
4438 1
3091 1
6125 1
6696 1
63 1
45 1
9667 1
8150 1
577 1
1755 1
...

output:

Yes
3736 2785 3204 6598 299 9264 2482 7411 7130 2169 4810 2249 7139 9844 2065 1354 275 4990 9927 4403 2731 2049 5523 5603 8149 7078 4661 6541 5390 8520 2489 5358 4540 4438 3091 6125 6696 63 45 9667 8150 577 1755 1408 5207 4497 5220 7541 5653 7822 9165 5742 8505 3018 5808 1170 2613 3443 1129 1202 198...

result:

ok 

Test #113:

score: 0
Accepted
time: 245ms
memory: 17520kb

input:

10000
1595 1
902 1
8668 1
5274 1
8338 8668
5058 1595
3448 5058
3361 3448
1387 3361
7894 5274
4338 8338
7448 1387
6246 902
9742 6246
4697 4338
4956 4697
331 7448
9444 7894
8663 9444
260 331
940 9742
2456 8663
9335 2456
914 9335
3970 260
2430 914
6000 4956
2530 940
4957 2530
7696 3970
6363 4957
496 24...

output:

Yes
9407 9135 9187 4462 1 8649 8745 1290 260 2528 2091 4299 3041 1387 8458 7284 5281 331 4375 1212 3239 9992 6236 4955 6106 9911 332 306 3065 54 957 5587 1459 6218 8073 4436 6949 9258 2920 6359 4519 4734 924 2092 3330 9825 7699 3502 9921 5269 8547 8606 2492 7706 6298 7407 4236 4041 1180 1951 7579 56...

result:

ok 

Test #114:

score: 0
Accepted
time: 270ms
memory: 19824kb

input:

10000
8295 1
383 1
7294 1
7641 1
8771 7641
9196 8771
9664 9196
2162 9664
4701 7294
4624 2162
1978 4624
6429 1978
9579 6429
9698 9579
6639 9698
3142 6639
1229 3142
520 1229
63 520
3135 63
7529 3135
1200 7529
6050 1200
2785 6050
2814 2785
5202 2814
8259 5202
9142 8259
1814 9142
9222 1814
1780 9222
298...

output:

Yes
3045 3149 8295 8906 6137 5367 370 6493 515 3435 4388 8603 383 6390 1 7870 3445 4929 568 5077 6201 617 402 2778 6172 1270 1638 4856 4217 9648 1674 4414 7989 7594 7098 3954 7243 4822 7246 6442 2326 5244 713 5422 9037 9081 9050 5902 1397 9566 8293 9766 3687 1790 2732 1511 326 7526 916 8638 1009 875...

result:

ok 

Test #115:

score: 0
Accepted
time: 10ms
memory: 11644kb

input:

10000
6169 1
7863 1
7353 1
5743 1
7017 1
5267 1
6048 1
3218 1
2555 1
2117 1
7728 1
1246 1
1719 1
4444 1
5518 1
2975 1
222 1
9392 1
5305 1
3990 1
842 1
2093 1
1057 1
6405 1
3912 1
4017 1
3108 1
2647 1
49 1
1095 1
7429 1
1099 1
5747 1
2852 1
5114 1
7410 1
4439 1
6177 1
8834 1
449 1
3438 1
2534 1
8572 ...

output:

Yes
6169 7863 7353 5743 7017 5267 6048 3218 2555 2117 7728 1246 1719 4444 5518 2975 222 9392 5305 3990 842 2093 1057 6405 3912 4017 3108 2647 49 1095 7429 1099 5747 2852 5114 7410 4439 6177 8834 449 3438 2534 8572 9455 3100 8024 9057 3942 3962 1114 8131 423 1361 9450 8426 3189 4080 1161 9757 4211 85...

result:

ok 

Test #116:

score: 0
Accepted
time: 10ms
memory: 12292kb

input:

10000
9820 1
1674 1
2136 1
8319 1
6524 1
7153 1
8842 1
2902 1
3515 1
5316 1
5125 1
5763 1
6166 1
9855 1
1969 1
9034 1
7762 1
5097 1
3928 1
1413 1
3361 1
8967 1
7576 1
6129 1
5819 1
3441 1
7174 1
6485 1
4944 1
9208 1
8159 1
4685 1
8654 1
6362 1
8487 1
2597 1
2560 1
2228 1
5164 1
3778 1
9686 1
532 1
2...

output:

Yes
9820 1674 2136 8319 6524 7153 8842 2902 3515 5316 5125 5763 6166 9855 1969 9034 7762 5097 3928 1413 3361 8967 7576 6129 5819 3441 7174 6485 4944 9208 8159 4685 8654 6362 8487 2597 2560 2228 5164 3778 9686 532 287 6463 5944 1645 9118 9654 8362 5609 3412 6615 3936 1242 6980 7105 5917 1467 7569 659...

result:

ok 

Test #117:

score: 0
Accepted
time: 74ms
memory: 11996kb

input:

10000
3095 1
8263 1
8800 1
5568 1
2028 1
6819 1
3193 1
8610 1
6180 1
4481 1
2803 1
7405 1
4709 1
6829 1
3906 1
2090 1
2077 1
8068 1
7230 1
5089 1
4627 1
6815 1
9419 1
5360 1
1328 1
1022 1
9443 1
1893 1
5971 1
4654 1
7453 1
5645 1
635 1
9941 1
431 1
1458 1
6312 1
8859 1
2447 1
39 1
7853 1
4760 1
1351...

output:

Yes
5608 5246 4947 7440 1184 6638 7945 2398 1349 8263 8800 1152 5424 659 5184 5568 1756 7880 2070 1295 395 4560 6819 9 2570 6713 4471 6945 4644 2324 8565 58 8610 3823 9520 3762 2320 6024 8209 6377 6935 1727 2772 2803 4210 545 7600 6242 8328 4709 6829 3571 1165 5376 3906 2090 3740 1705 2077 3548 9440...

result:

ok 

Test #118:

score: 0
Accepted
time: 65ms
memory: 11840kb

input:

10000
1253 1
1252 1
3660 1
2286 1
7625 1
489 1
6234 1
6661 1
5583 1
3462 1
7100 1
2761 1
6263 1
3204 1
2513 1
8276 1
3129 1
9705 1
4324 1
3934 1
6342 1
6409 1
8902 1
4061 1
8964 1
4962 1
5221 1
4967 1
796 1
9375 1
4839 1
118 1
2306 1
7606 1
2847 1
7779 1
4454 1
1313 1
4665 1
8404 1
1047 1
142 1
7005...

output:

Yes
1253 1252 3660 2286 7625 489 6234 6661 5583 3462 7100 2761 6263 3204 2513 8276 3129 9705 4324 3934 6342 6409 8902 4061 8964 4962 5221 4967 796 9375 4839 118 2306 7606 2847 7779 4454 1313 4665 8404 1047 142 7005 3594 1819 311 288 6831 2537 6690 1217 2985 5670 5402 2057 7818 3076 2421 1955 5017 52...

result:

ok 

Test #119:

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

input:

10000
1929 1
8471 1
9365 1
8875 1
2194 1
2708 1
4742 1
4178 1
15 1
6747 1
4245 1
3935 1
531 1
3722 1
3079 1
5886 1
9316 1
6185 1
4906 1
6000 1
2953 1
4115 1
5295 1
3922 1
9564 1
6236 1
7542 1
1942 1
5468 1
9922 1
4116 1
8982 1
7269 1
5925 1
1204 1
1346 1
8882 1
7091 1
645 1
7380 1
1657 1
7073 1
5135...

output:

Yes
1929 8471 9365 8875 2194 2708 4742 4178 15 6747 4245 3935 531 3722 3079 5886 9316 6185 4906 6000 2953 4115 5295 3922 9564 6236 7542 1942 5468 9922 4116 8982 7269 5925 1204 1346 8882 7091 645 7380 1657 7073 5135 3495 8370 6873 1892 3089 5912 1370 6785 5092 1906 1583 8543 8748 8998 1090 6939 1197 ...

result:

ok 

Test #120:

score: 0
Accepted
time: 70ms
memory: 12888kb

input:

10000
6334 1
9851 1
2581 1
2364 1
2254 1
6560 1
20 1
8356 1
5907 1
9819 1
4953 1
3000 1
9272 1
425 1
8520 1
9152 1
3593 1
5294 1
1019 1
5702 1
3092 1
958 1
2320 1
7615 1
9409 1
5563 1
1858 1
9692 1
7227 1
6010 1
6175 1
8373 1
4912 1
1894 1
5849 1
4067 1
3919 1
1424 1
8385 1
2921 1
8132 1
4368 1
4729...

output:

Yes
6334 2424 7283 9851 3922 3763 6062 2581 7236 2392 9776 2364 4847 8592 1980 2254 714 9006 949 6560 5136 5217 20 8066 5362 4059 8356 3166 5907 2040 4442 9819 8737 4953 3000 9272 6814 9454 1713 425 4706 9325 7596 888 1700 973 7669 8520 4619 9152 9834 3593 3976 4161 1035 4334 9932 4040 5193 5294 668...

result:

ok 

Test #121:

score: 0
Accepted
time: 97ms
memory: 13112kb

input:

10000
8729 1
7933 1
9587 1
5677 1
5294 1
4290 1
8839 1
5027 1
423 1
3980 1
1750 1
9800 1
2584 1
7109 1
5922 1
9321 1
1686 1
9698 1
3636 1
795 1
2530 1
2737 1
2450 1
125 1
6928 1
6275 1
1785 1
6812 1
3573 1
1157 1
9392 1
1429 1
8171 1
2136 1
5253 1
8812 1
7767 1
1218 1
8455 1
9555 1
9966 1
5538 1
642...

output:

Yes
8729 7933 9587 5677 5294 4290 8839 5027 423 3980 1750 9800 2584 7109 5922 9321 1686 9698 3636 795 2530 2737 2450 125 6928 6275 1785 6812 3573 1157 9392 1429 8171 2136 5253 8812 7767 1218 8455 9555 9966 5538 6429 8591 8780 5959 7616 8606 3176 6488 6680 9577 1863 9730 648 2803 1452 5702 7168 5096 ...

result:

ok 

Test #122:

score: 0
Accepted
time: 95ms
memory: 12672kb

input:

10000
127 1
6545 1
7921 1
868 1
999 1
7877 1
6024 1
7692 1
2520 1
7145 1
7297 1
8899 1
9851 1
433 1
7678 1
9041 1
9091 1
9691 1
7689 1
8298 1
6611 1
6554 1
740 1
6664 1
4935 1
3562 1
8262 1
4713 1
9815 1
5456 1
6963 1
336 1
8317 1
7697 1
3576 1
6910 1
8286 1
4917 1
6839 1
4261 1
2736 1
8389 1
3420 1...

output:

Yes
127 6545 7921 868 999 7877 6024 7692 2520 7145 7297 8899 9851 433 7678 9041 9091 9691 7689 8298 6611 6554 740 6664 4935 3562 8262 4713 9815 5456 6963 336 8317 7697 3576 6910 8286 4917 6839 4261 2736 8389 3420 2631 2062 637 7919 8134 6574 4030 8780 6457 99 5915 1232 8129 8127 655 2923 4646 6776 9...

result:

ok 

Test #123:

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

input:

10000
5657 1
4450 1
6663 1
8811 1
3561 1
3087 1
979 1
3830 1
3071 1
2802 1
1527 1
9376 1
107 1
3482 1
7773 1
3572 1
4870 1
2572 1
6007 1
1188 1
19 1
3674 1
3364 1
3639 1
2377 1
796 1
961 1
5753 1
9606 1
5952 1
3478 1
8246 1
6215 1
3968 1
5727 1
9806 1
7983 1
8017 1
7094 1
664 1
3946 1
9308 1
1151 1
...

output:

Yes
8007 5312 5657 4450 7029 4154 9742 8334 6663 3875 9196 8811 58 7950 8986 792 3561 4271 4965 1565 1320 3087 3765 979 6065 3830 3071 9629 2802 9483 110 1527 7242 9376 107 1738 4984 3122 3482 8253 4836 7907 7773 4820 1802 2220 5831 3572 2736 4870 8500 7270 2572 6761 775 1669 2122 6007 4004 9005 176...

result:

ok 

Test #124:

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

input:

10000
1376 1
285 1
9485 1
9512 1
7228 1
6976 1
1418 1
5507 1
3768 1
2996 1
3639 1
8643 1
1952 1
6318 1
6658 1
6998 1
7278 1
9104 1
6601 1
6607 1
8601 1
1040 1
9174 1
5993 1
7919 1
9222 1
4087 1
9430 1
7994 1
9876 1
3493 1
2406 1
2792 1
5762 1
4777 1
2584 1
2257 1
8093 1
4695 1
1458 1
8464 1
718 1
93...

output:

Yes
1376 285 9485 9512 7228 6976 1418 5507 3768 2996 3639 8643 1952 6318 6658 6998 7278 9104 6601 6607 8601 1040 9174 5993 7919 9222 4087 9430 7994 9876 3493 2406 2792 5762 4777 2584 2257 8093 4695 1458 8464 718 9338 6895 3112 482 3754 856 3730 1417 434 6873 3003 6751 4127 6703 4425 1897 5673 5881 4...

result:

ok 

Test #125:

score: 0
Accepted
time: 47ms
memory: 12688kb

input:

10000
8931 1
6853 1
1298 1
4775 1
5976 1
855 1
2105 1
5720 1
268 1
4899 1
130 1
9188 1
7914 1
3757 1
2149 1
3639 1
1052 1
4242 1
9390 1
8976 1
8588 1
2765 1
8812 1
235 1
7326 1
5745 1
8488 1
909 1
8051 1
5433 1
4658 1
6671 1
3502 1
8611 1
8517 1
4607 1
8665 1
4053 1
6061 1
2345 1
2790 1
7433 1
9229 ...

output:

Yes
8931 6853 1298 4775 5976 855 2105 5720 268 4899 130 9188 7914 3757 2149 3639 1052 4242 9390 8976 8588 2765 8812 235 7326 5745 8488 909 8051 5433 4658 6671 3502 8611 8517 4607 8665 4053 6061 2345 2790 7433 9229 4240 2245 8209 8585 8502 1687 28 3852 3143 8902 9747 5423 8329 6498 4394 2170 5326 371...

result:

ok 

Test #126:

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

input:

10000
741 1
2406 1
5486 1
3120 1
7029 1
8346 1
2197 1
2584 1
8055 1
7862 1
1164 1
6312 1
7282 1
8150 1
2897 1
1569 1
3840 1
8700 1
8499 1
376 1
9085 1
5772 1
5236 1
7179 1
8878 1
3355 1
2664 1
7955 1
9454 1
2895 1
1709 1
9999 1
6954 1
4437 1
9460 1
1691 1
7516 1
3772 1
7445 1
325 1
3813 1
722 1
8550...

output:

Yes
3146 4524 6635 6981 6377 4995 3122 7951 8712 3544 1889 6602 7340 8668 2346 9198 3749 3896 6395 3333 6760 2784 2656 9603 3377 1677 8446 6437 3989 3988 5628 4027 183 7399 9957 1581 3900 8874 672 3814 3325 5591 6802 6301 754 523 5671 3242 4460 7029 7520 3970 8926 7775 8150 9229 4203 2795 8510 8857 ...

result:

ok 

Test #127:

score: 0
Accepted
time: 104ms
memory: 14032kb

input:

10000
8907 1
7692 1
2835 1
6568 1
8294 1
3413 1
7374 1
313 1
4212 1
4124 1
4423 1
4421 1
5855 1
758 1
3922 1
2767 1
2396 1
5215 1
6492 1
5657 1
8174 1
6015 1
2228 1
5125 1
3023 1
4401 1
7519 1
4740 1
5310 1
294 1
6364 1
7300 1
3914 1
5273 1
2657 1
3345 1
9584 1
4026 1
3568 1
469 1
6164 1
8157 1
1583...

output:

Yes
8907 7692 2835 6568 8294 3413 7374 313 4212 4124 4423 4421 5855 758 3922 2767 2396 5215 6492 5657 8174 6015 2228 5125 3023 4401 7519 4740 5310 294 6364 7300 3914 5273 2657 3345 9584 4026 3568 469 6164 8157 1583 7766 3607 9017 5064 4882 2972 6097 7725 9053 7580 7408 7687 8801 1339 6323 5323 3796 ...

result:

ok 

Test #128:

score: 0
Accepted
time: 115ms
memory: 12828kb

input:

10000
9146 1
7384 1
456 1
7524 1
648 1
4770 1
1309 1
5707 1
6487 1
8268 1
6151 1
6661 1
6933 1
9402 1
1237 1
1067 1
4858 1
9844 1
147 1
1895 1
1653 1
5884 1
2577 1
6949 1
5685 1
9278 1
6807 1
4777 1
1916 1
8251 1
1886 1
2167 1
5560 1
7772 1
494 1
7663 1
1582 1
1215 1
1835 1
1505 1
430 1
1639 1
7878 ...

output:

Yes
9146 7384 456 7524 648 4770 1309 5707 6487 8268 6151 6661 6933 9402 1237 1067 4858 9844 147 1895 1653 5884 2577 6949 5685 9278 6807 4777 1916 8251 1886 2167 5560 7772 494 7663 1582 1215 1835 1505 430 1639 7878 7122 9350 7664 6056 7550 3133 7422 5986 539 2878 2223 6425 3128 5172 7760 8949 2364 22...

result:

ok 

Test #129:

score: 0
Accepted
time: 147ms
memory: 12748kb

input:

10000
5739 1
5297 1
9357 1
2392 1
9544 1
6870 1
1732 1
8667 1
9212 1
3541 1
1351 1
4819 1
4182 1
6715 1
5740 1
8174 1
3656 1
4175 1
6229 1
8815 1
5817 1
3052 1
4310 1
8792 1
9693 1
6036 1
3665 1
2566 1
3531 1
5116 1
6114 1
4720 1
5995 1
6557 1
9793 1
4031 1
4822 1
8837 1
699 1
5354 1
4591 1
3114 1
4...

output:

Yes
5159 9746 2515 3400 5301 7003 4908 7214 3756 7255 3533 2480 8153 6301 3521 90 3595 8865 2055 6416 686 6234 3050 5761 4715 8810 5994 3286 9357 1942 1141 3429 718 2392 2859 9625 8598 11 4723 9544 7823 1088 9483 7361 5215 2420 2995 3399 5819 9856 8761 8666 4312 969 5951 5314 7903 9712 6008 6724 599...

result:

ok 

Test #130:

score: 0
Accepted
time: 143ms
memory: 12672kb

input:

10000
105 1
43 1
7986 1
1865 1
7343 1
7916 1
8412 1
6923 1
7742 1
738 1
9124 1
2799 1
5540 1
5619 1
9436 1
6258 1
7671 1
9949 1
6475 1
799 1
9477 1
3332 1
7587 1
8399 1
8671 1
2734 1
6803 1
4362 1
1312 1
4911 1
1785 1
4286 1
3486 1
4476 1
9889 1
7967 1
247 1
1962 1
6302 1
6366 1
3094 1
48 1
1115 1
6...

output:

Yes
105 43 7986 1865 7343 7916 8412 6923 7742 738 9124 2799 5540 5619 9436 6258 7671 9949 6475 799 9477 3332 7587 8399 8671 2734 6803 4362 1312 4911 1785 4286 3486 4476 9889 7967 247 1962 6302 6366 3094 48 1115 6938 8046 518 2626 1916 3137 9531 7532 1443 4357 2900 1320 315 7622 3009 1121 2622 4300 6...

result:

ok 

Test #131:

score: 0
Accepted
time: 143ms
memory: 13096kb

input:

10000
4515 1
8698 1
282 1
3565 1
25 1
2937 1
5712 1
9178 1
1374 1
4591 1
7888 1
3706 1
7141 1
1604 1
1195 1
9366 1
6356 1
2628 1
3907 1
1261 1
5690 1
8718 1
5162 1
6971 1
299 1
5831 1
4579 1
5160 1
7615 1
6838 1
6234 1
4144 1
7657 1
2842 1
4529 1
3122 1
4416 1
258 1
9167 1
6346 1
6016 1
9518 1
2708 ...

output:

Yes
4515 8698 282 3565 25 2937 5712 9178 1374 4591 7888 3706 7141 1604 1195 9366 6356 2628 3907 1261 5690 8718 5162 6971 299 5831 4579 5160 7615 6838 6234 4144 7657 2842 4529 3122 4416 258 9167 6346 6016 9518 2708 6634 9549 3522 3554 6829 2470 6514 7460 1494 7337 1934 5278 8507 3035 933 2788 6835 39...

result:

ok 

Test #132:

score: 0
Accepted
time: 92ms
memory: 13108kb

input:

10000
407 1
3996 1
4065 1
7087 1
5483 1
7148 1
5465 1
904 1
5018 1
6375 1
2363 1
5022 1
4630 1
7316 1
834 1
8959 1
861 1
4627 1
3859 1
976 1
3115 1
7160 1
5250 1
316 1
5057 1
3738 1
3661 1
4084 1
4983 1
7113 1
9188 1
1898 1
7693 1
8651 1
3454 1
548 1
5738 1
595 1
1748 1
2736 1
6735 1
3236 1
6155 1
3...

output:

Yes
407 1963 2193 7513 7549 9700 6944 1989 3938 3446 9364 1888 7848 8450 549 9238 5606 6124 3280 8423 6886 254 8497 7608 2483 3996 8367 3195 8602 4065 8888 7303 5046 2127 5574 840 8183 7175 3185 8702 7087 7584 6954 6815 5760 5409 4658 5483 4550 1044 6639 9938 9389 1869 7687 1905 7526 5747 524 5682 4...

result:

ok 

Test #133:

score: 0
Accepted
time: 153ms
memory: 12740kb

input:

10000
5550 1
7112 1
2155 1
2296 1
1378 1
1938 1
412 1
362 1
5132 1
7968 1
1400 1
7291 1
5853 1
6020 1
3720 1
3780 1
9236 1
7229 1
8890 1
8566 1
6308 1
1068 1
9109 1
9460 1
2241 1
8213 1
6056 1
2121 1
9987 1
9640 1
8771 1
7663 1
1063 1
3045 1
911 1
271 1
2166 1
2226 1
4854 1
1305 1
9472 1
5428 1
7225...

output:

Yes
5550 7112 2155 2296 1378 1938 412 362 5132 7968 1400 7291 5853 6020 3720 3780 9236 7229 8890 8566 6308 1068 9109 9460 2241 8213 6056 2121 9987 9640 8771 7663 1063 3045 911 271 2166 2226 4854 1305 9472 5428 7225 6485 8937 6153 2657 3375 5212 3181 4116 3019 1108 2801 3170 8407 4914 599 8503 1134 2...

result:

ok 

Test #134:

score: 0
Accepted
time: 150ms
memory: 12960kb

input:

10000
9397 1
9522 1
3069 1
846 1
8781 1
9508 1
8475 1
8332 1
5994 1
5372 1
4529 1
1670 1
1610 1
2208 1
682 1
5502 1
9254 1
9783 1
969 1
3322 1
4901 1
2993 1
866 1
4779 1
1685 1
8747 1
8260 1
1730 1
1964 1
3423 1
1710 1
1279 1
7708 1
6836 1
9718 1
428 1
1501 1
8266 1
1123 1
2899 1
4723 1
3757 1
4110 ...

output:

Yes
9397 9522 3069 846 8781 9508 8475 8332 5994 5372 4529 1670 1610 2208 682 5502 9254 9783 969 3322 4901 2993 866 4779 1685 8747 8260 1730 1964 3423 1710 1279 7708 6836 9718 428 1501 8266 1123 2899 4723 3757 4110 9777 6674 5571 2995 8235 2501 6399 9086 3640 8884 9224 272 2817 3691 2691 2150 6663 41...

result:

ok 

Extra Test:

score: -3
Extra Test Failed : Time Limit Exceeded on 3

input:

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

output:


result: