QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#871810#9985. Exploration BoundaryMax_s_xaMAC ✓222ms37712kbC++175.3kb2025-01-25 22:13:212025-01-25 22:13:32

Judging History

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

  • [2025-01-25 22:13:32]
  • 评测
  • 测评结果:AC
  • 用时:222ms
  • 内存:37712kb
  • [2025-01-25 22:13:21]
  • 提交

answer

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <random>
#include <ctime>
#include <chrono>
#include <numeric>
#include <iomanip>
#include <cassert>

typedef long long ll;
typedef double lf;
typedef unsigned long long ull;

// #define DEBUG 1
struct IO
{
    #define MAXSIZE (1 << 20)
    #define isdigit(x) (x >= '0' && x <= '9')
    char buf[MAXSIZE], *p1, *p2;
    char pbuf[MAXSIZE], *pp;
    #if DEBUG
    #else
    IO() : p1(buf), p2(buf), pp(pbuf) {}
    ~IO() {fwrite(pbuf, 1, pp - pbuf, stdout);}
    #endif
    #define gc() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin), p1 == p2) ? ' ' : *p1++)
    #define blank(x) (x == ' ' || x == '\n' || x == '\r' || x == '\t')

    template <typename T>
    void Read(T &x)
    {
        #if DEBUG
        std::cin >> x;
        #else
        bool sign = 0; char ch = gc(); x = 0;
        for (; !isdigit(ch); ch = gc())
            if (ch == '-') sign = 1;
        for (; isdigit(ch); ch = gc()) x = x * 10 + (ch ^ 48);
        if (sign) x = -x;
        #endif
    }
    void Read(char *s)
    {
        #if DEBUG
        std::cin >> s;
        #else
        char ch = gc();
        for (; blank(ch); ch = gc());
        for (; !blank(ch); ch = gc()) *s++ = ch;
        *s = 0;
        #endif
    }
    void Read(char &c) {for (c = gc(); blank(c); c = gc());}

    void Push(const char &c)
    {
        #if DEBUG
        putchar(c);
        #else
        if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
        *pp++ = c;
        #endif
    }
    template <typename T>
    void Write(T x)
    {
        if (x < 0) x = -x, Push('-');
        static T sta[35];
        int top = 0;
        do sta[top++] = x % 10, x /= 10; while (x);
        while (top) Push(sta[--top] ^ 48);
    }
    template <typename T>
    void Write(T x, char lst) {Write(x), Push(lst);}
} IO;
#define Read(x) IO.Read(x)
#define Write(x, y) IO.Write(x, y)
#define Put(x) IO.Push(x)

using namespace std;

const int MAXN = 2e5 + 10;

mt19937_64 Rand(chrono::steady_clock::now().time_since_epoch().count());

int n, m, q, ans[MAXN];
ull hsh[MAXN];
vector <pair <int, int>> e[MAXN];

struct pst
{
    int n; ull hsh;
    vector <int> d;
    bool operator < (const pst &u) const
    {
        if (n ^ u.n) return n < u.n;
        if (hsh ^ u.hsh) return hsh < u.hsh;
        for (int i = 0; i < n; i++)
            if (d[i] ^ u.d[i]) return d[i] < u.d[i];
        return 0;
    }
    bool operator == (const pst &u) const
    {
        if (n ^ u.n) return 0;
        if (hsh ^ u.hsh) return 0;
        for (int i = 0; i < n; i++)
            if (d[i] ^ u.d[i]) return 0;
        return 1;
    }
}a[MAXN];

int cnt[MAXN], idx[MAXN];
bool vis[MAXN], avl[MAXN];
void BFS()
{
    for (int i = 1; i <= n; i++) cnt[i] = 0, vis[i] = 0;
    for (int i = 1; i <= q; i++)
        for (auto x : a[i].d) cnt[x]++;
    queue <int> qu; vector <int> vec, tmp;
    qu.push(1), vis[1] = 1; int g = 0;
    for (int _ = 1; _ <= q + 1; _++)
    {
        while (!qu.empty())
        {
            int u = qu.front(); qu.pop();
            idx[u] = ++g;
            for (auto [v, id] : e[u])
            {
                if (vis[v]) continue;
                if (!cnt[v]) qu.push(v), vis[v] = 1;
                else vec.emplace_back(v);
            }
        }
        if (!vec.size()) continue;
        sort(vec.begin(), vec.end()), vec.resize(unique(vec.begin(), vec.end()) - vec.begin());
        pst cur = {(int)vec.size(), 0, vec};
        for (auto x : vec) cur.hsh ^= hsh[x];
        int pos = lower_bound(a + 1, a + q + 1, cur) - a, pp = pos;
        while (pos <= q && a[pos] == cur) avl[pos++] = 1;
        if (pos == pp) break;
        tmp.clear();
        for (auto x : vec)
            if (!--cnt[x]) qu.push(x), vis[x] = 1;
            else tmp.push_back(x);
        vec.swap(tmp);
    }
}

int main()
{
    #if DEBUG
    #else
    ios::sync_with_stdio(0), cin.tie(0);
    #endif
    int T;
    Read(T);
    while (T--)
    {
        Read(n), Read(m);
        for (int i = 1; i <= n; i++) hsh[i] = Rand(), e[i].clear();
        for (int i = 1, u, v; i <= m; i++) Read(u), Read(v), e[u].emplace_back(v, i), e[v].emplace_back(u, i);
        Read(q);
        bool flag = 0;
        for (int i = 1; i <= q; i++)
        {
            Read(a[i].n);
            a[i].d.resize(a[i].n), a[i].hsh = 0;
            for (int j = 0; j < a[i].n; j++) Read(a[i].d[j]), a[i].hsh ^= hsh[a[i].d[j]];
            sort(a[i].d.begin(), a[i].d.end());
            if (a[i].n == 1 && a[i].d[0] == 1) { i--, q--; continue; }
            if (a[i].d[0] == 1) flag = 1;
        }
        if (flag) { cout << "No\n"; continue; }
        sort(a + 1, a + q + 1);
        for (int i = 1; i <= q; i++) avl[i] = 0;
        BFS();
        for (int i = 1; i <= q; i++) flag |= (avl[i] == 0);
        if (flag) { cout << "No\n"; continue; }
        for (int i = 1; i <= n; i++)
            for (auto [v, id] : e[i])
                ans[id] = abs(idx[i] - idx[v]);
        cout << "Yes\n";
        for (int i = 1; i <= m; i++) cout << ans[i] << ' '; cout << '\n';
    }
    return 0;
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 20232kb

input:

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

output:

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

result:

ok 2 cases (2 test cases)

Test #2:

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

input:

129
2 1
1 2
1
1 1
2 1
1 2
2
1 1
1 2
3 2
1 2
1 3
1
1 1
3 2
1 2
1 3
1
1 2
3 2
1 2
1 3
1
1 3
3 2
1 2
1 3
1
2 1 2
3 2
1 2
1 3
1
2 1 3
3 2
1 2
1 3
1
2 2 3
3 2
1 2
1 3
1
3 1 2 3
3 2
1 2
1 3
2
1 1
1 2
3 2
1 2
1 3
2
1 1
1 3
3 2
1 2
1 3
2
1 1
2 1 2
3 2
1 2
1 3
2
1 1
2 1 3
3 2
1 2
1 3
2
1 1
2 2 3
3 2
1 2
1 3
...

output:

Yes
1 
Yes
1 
Yes
1 2 
Yes
2 1 
Yes
1 2 
No
No
Yes
1 2 
No
Yes
2 1 
Yes
1 2 
No
No
Yes
1 2 
No
No
No
No
Yes
2 1 
No
No
No
Yes
1 2 
No
No
No
No
No
No
No
No
No
No
Yes
2 1 
No
No
No
Yes
1 2 
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
N...

result:

ok 129 cases (129 test cases)

Test #3:

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

input:

127
3 3
1 2
1 3
2 3
1
1 1
3 3
1 2
1 3
2 3
1
1 2
3 3
1 2
1 3
2 3
1
1 3
3 3
1 2
1 3
2 3
1
2 1 2
3 3
1 2
1 3
2 3
1
2 1 3
3 3
1 2
1 3
2 3
1
2 2 3
3 3
1 2
1 3
2 3
1
3 1 2 3
3 3
1 2
1 3
2 3
2
1 1
1 2
3 3
1 2
1 3
2 3
2
1 1
1 3
3 3
1 2
1 3
2 3
2
1 1
2 1 2
3 3
1 2
1 3
2 3
2
1 1
2 1 3
3 3
1 2
1 3
2 3
2
1 1
2 ...

output:

Yes
1 2 1 
Yes
2 1 1 
Yes
1 2 1 
No
No
Yes
1 2 1 
No
Yes
2 1 1 
Yes
1 2 1 
No
No
Yes
1 2 1 
No
No
No
No
Yes
2 1 1 
No
No
No
Yes
1 2 1 
No
No
No
No
No
No
No
No
No
No
Yes
2 1 1 
No
No
No
Yes
1 2 1 
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 127 cases (127 test cases)

Test #4:

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

input:

32767
4 3
1 2
1 3
1 4
1
1 1
4 3
1 2
1 3
1 4
1
1 2
4 3
1 2
1 3
1 4
1
1 3
4 3
1 2
1 3
1 4
1
1 4
4 3
1 2
1 3
1 4
1
2 1 2
4 3
1 2
1 3
1 4
1
2 1 3
4 3
1 2
1 3
1 4
1
2 1 4
4 3
1 2
1 3
1 4
1
2 2 3
4 3
1 2
1 3
1 4
1
2 2 4
4 3
1 2
1 3
1 4
1
2 3 4
4 3
1 2
1 3
1 4
1
3 1 2 3
4 3
1 2
1 3
1 4
1
3 1 2 4
4 3
1 2
1 ...

output:

Yes
1 2 3 
Yes
3 1 2 
Yes
1 3 2 
Yes
1 2 3 
No
No
No
Yes
2 3 1 
Yes
2 1 3 
Yes
1 2 3 
No
No
No
Yes
1 2 3 
No
Yes
3 1 2 
Yes
1 3 2 
Yes
1 2 3 
No
No
No
Yes
2 3 1 
Yes
2 1 3 
Yes
1 2 3 
No
No
No
Yes
1 2 3 
No
No
No
No
No
No
Yes
3 2 1 
Yes
3 1 2 
No
No
No
No
Yes
3 1 2 
No
No
No
No
No
Yes
2 3 1 
No
Yes
...

result:

ok 32767 cases (32767 test cases)

Test #5:

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

input:

32767
4 4
1 2
1 3
1 4
2 4
1
1 1
4 4
1 2
1 3
1 4
2 4
1
1 2
4 4
1 2
1 3
1 4
2 4
1
1 3
4 4
1 2
1 3
1 4
2 4
1
1 4
4 4
1 2
1 3
1 4
2 4
1
2 1 2
4 4
1 2
1 3
1 4
2 4
1
2 1 3
4 4
1 2
1 3
1 4
2 4
1
2 1 4
4 4
1 2
1 3
1 4
2 4
1
2 2 3
4 4
1 2
1 3
1 4
2 4
1
2 2 4
4 4
1 2
1 3
1 4
2 4
1
2 3 4
4 4
1 2
1 3
1 4
2 4
1
...

output:

Yes
1 2 3 2 
Yes
3 1 2 1 
Yes
1 3 2 1 
Yes
1 2 3 2 
No
No
No
Yes
2 3 1 1 
Yes
2 1 3 1 
Yes
1 2 3 2 
No
No
No
Yes
1 2 3 2 
No
Yes
3 1 2 1 
Yes
1 3 2 1 
Yes
1 2 3 2 
No
No
No
Yes
2 3 1 1 
Yes
2 1 3 1 
Yes
1 2 3 2 
No
No
No
Yes
1 2 3 2 
No
No
No
No
No
No
Yes
3 2 1 2 
Yes
3 1 2 1 
No
No
No
No
Yes
3 1 2 ...

result:

ok 32767 cases (32767 test cases)

Test #6:

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

input:

32767
4 5
1 2
1 3
1 4
2 3
2 4
1
1 1
4 5
1 2
1 3
1 4
2 3
2 4
1
1 2
4 5
1 2
1 3
1 4
2 3
2 4
1
1 3
4 5
1 2
1 3
1 4
2 3
2 4
1
1 4
4 5
1 2
1 3
1 4
2 3
2 4
1
2 1 2
4 5
1 2
1 3
1 4
2 3
2 4
1
2 1 3
4 5
1 2
1 3
1 4
2 3
2 4
1
2 1 4
4 5
1 2
1 3
1 4
2 3
2 4
1
2 2 3
4 5
1 2
1 3
1 4
2 3
2 4
1
2 2 4
4 5
1 2
1 3
1 ...

output:

Yes
1 2 3 1 2 
Yes
3 1 2 2 1 
Yes
1 3 2 2 1 
Yes
1 2 3 1 2 
No
No
No
Yes
2 3 1 1 1 
Yes
2 1 3 1 1 
Yes
1 2 3 1 2 
No
No
No
Yes
1 2 3 1 2 
No
Yes
3 1 2 2 1 
Yes
1 3 2 2 1 
Yes
1 2 3 1 2 
No
No
No
Yes
2 3 1 1 1 
Yes
2 1 3 1 1 
Yes
1 2 3 1 2 
No
No
No
Yes
1 2 3 1 2 
No
No
No
No
No
No
Yes
3 2 1 1 2 
Yes...

result:

ok 32767 cases (32767 test cases)

Test #7:

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

input:

32767
4 5
1 2
1 3
3 4
2 3
2 4
1
1 1
4 5
1 2
1 3
3 4
2 3
2 4
1
1 2
4 5
1 2
1 3
3 4
2 3
2 4
1
1 3
4 5
1 2
1 3
3 4
2 3
2 4
1
1 4
4 5
1 2
1 3
3 4
2 3
2 4
1
2 1 2
4 5
1 2
1 3
3 4
2 3
2 4
1
2 1 3
4 5
1 2
1 3
3 4
2 3
2 4
1
2 1 4
4 5
1 2
1 3
3 4
2 3
2 4
1
2 2 3
4 5
1 2
1 3
3 4
2 3
2 4
1
2 2 4
4 5
1 2
1 3
3 ...

output:

Yes
1 2 1 1 2 
Yes
3 1 1 2 1 
Yes
1 3 1 2 1 
Yes
1 2 1 1 2 
No
No
No
Yes
1 2 1 1 2 
Yes
2 1 2 1 1 
Yes
1 2 1 1 2 
No
No
No
No
No
Yes
3 1 1 2 1 
Yes
1 3 1 2 1 
Yes
1 2 1 1 2 
No
No
No
Yes
1 2 1 1 2 
Yes
2 1 2 1 1 
Yes
1 2 1 1 2 
No
No
No
No
No
No
No
No
No
No
Yes
3 1 1 2 1 
Yes
3 1 1 2 1 
No
No
No
No
...

result:

ok 32767 cases (32767 test cases)

Test #8:

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

input:

32767
4 4
1 2
2 3
3 4
2 4
1
1 1
4 4
1 2
2 3
3 4
2 4
1
1 2
4 4
1 2
2 3
3 4
2 4
1
1 3
4 4
1 2
2 3
3 4
2 4
1
1 4
4 4
1 2
2 3
3 4
2 4
1
2 1 2
4 4
1 2
2 3
3 4
2 4
1
2 1 3
4 4
1 2
2 3
3 4
2 4
1
2 1 4
4 4
1 2
2 3
3 4
2 4
1
2 2 3
4 4
1 2
2 3
3 4
2 4
1
2 2 4
4 4
1 2
2 3
3 4
2 4
1
2 3 4
4 4
1 2
2 3
3 4
2 4
1
...

output:

Yes
1 1 1 2 
Yes
1 1 1 2 
Yes
1 2 1 1 
Yes
1 1 1 2 
No
No
No
No
No
Yes
1 1 1 2 
No
No
No
No
No
Yes
1 1 1 2 
Yes
1 2 1 1 
Yes
1 1 1 2 
No
No
No
No
No
Yes
1 1 1 2 
No
No
No
No
No
Yes
1 2 1 1 
Yes
1 1 1 2 
No
No
No
No
No
Yes
1 1 1 2 
No
No
No
No
No
No
No
No
No
No
No
Yes
1 2 1 1 
No
No
No
No
No
No
No
No...

result:

ok 32767 cases (32767 test cases)

Test #9:

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

input:

32767
4 6
1 2
1 3
1 4
2 3
2 4
3 4
1
1 1
4 6
1 2
1 3
1 4
2 3
2 4
3 4
1
1 2
4 6
1 2
1 3
1 4
2 3
2 4
3 4
1
1 3
4 6
1 2
1 3
1 4
2 3
2 4
3 4
1
1 4
4 6
1 2
1 3
1 4
2 3
2 4
3 4
1
2 1 2
4 6
1 2
1 3
1 4
2 3
2 4
3 4
1
2 1 3
4 6
1 2
1 3
1 4
2 3
2 4
3 4
1
2 1 4
4 6
1 2
1 3
1 4
2 3
2 4
3 4
1
2 2 3
4 6
1 2
1 3
1 ...

output:

Yes
1 2 3 1 2 1 
Yes
3 1 2 2 1 1 
Yes
1 3 2 2 1 1 
Yes
1 2 3 1 2 1 
No
No
No
Yes
2 3 1 1 1 2 
Yes
2 1 3 1 1 2 
Yes
1 2 3 1 2 1 
No
No
No
Yes
1 2 3 1 2 1 
No
Yes
3 1 2 2 1 1 
Yes
1 3 2 2 1 1 
Yes
1 2 3 1 2 1 
No
No
No
Yes
2 3 1 1 1 2 
Yes
2 1 3 1 1 2 
Yes
1 2 3 1 2 1 
No
No
No
Yes
1 2 3 1 2 1 
No
No
...

result:

ok 32767 cases (32767 test cases)

Test #10:

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

input:

32767
4 3
1 4
4 3
3 2
1
1 1
4 3
1 4
4 3
3 2
1
1 2
4 3
1 4
4 3
3 2
1
1 3
4 3
1 4
4 3
3 2
1
1 4
4 3
1 4
4 3
3 2
1
2 1 2
4 3
1 4
4 3
3 2
1
2 1 3
4 3
1 4
4 3
3 2
1
2 1 4
4 3
1 4
4 3
3 2
1
2 2 3
4 3
1 4
4 3
3 2
1
2 2 4
4 3
1 4
4 3
3 2
1
2 3 4
4 3
1 4
4 3
3 2
1
3 1 2 3
4 3
1 4
4 3
3 2
1
3 1 2 4
4 3
1 4
4 ...

output:

Yes
1 1 1 
Yes
1 1 1 
Yes
1 1 1 
Yes
1 1 1 
No
No
No
No
No
No
No
No
No
No
No
Yes
1 1 1 
Yes
1 1 1 
Yes
1 1 1 
No
No
No
No
No
No
No
No
No
No
No
Yes
1 1 1 
Yes
1 1 1 
No
No
No
No
No
No
No
No
No
No
No
Yes
1 1 1 
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
N...

result:

ok 32767 cases (32767 test cases)

Test #11:

score: 0
Accepted
time: 114ms
memory: 31396kb

input:

1
133819 200000
72234 62052
62052 125262
72072 62052
105495 62052
62052 31315
131581 62052
62052 122581
62052 79285
62052 60214
26697 62052
88097 62052
72234 121102
54367 72234
89776 72234
72010 72234
72234 124266
72234 64221
92679 72234
70101 72234
72234 93634
72234 83241
72234 78329
121102 31381
1...

output:

Yes
26 799 148 3303 928 190 28 2704 285 192 2898 122 179 2967 2577 3721 1 80 2539 84 470 975 1650 810 2721 3408 412 2854 3563 415 137 885 1378 4010 4011 4012 4013 4014 4015 4016 1060 1 567 167 1359 35 259 583 354 3048 453 1764 2975 2957 2958 2959 2960 2961 2962 870 2963 2964 2965 2966 10900 4686 109...

result:

ok 1 cases (1 test case)

Test #12:

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

input:

2
197804 200000
9113 81956
173293 81956
25620 81956
187287 81956
81956 119734
104627 81956
81956 180317
81956 102709
81956 67714
81956 184795
9620 81956
13190 9113
9113 136411
137957 9113
178436 9113
9113 121335
3488 9113
61022 9113
9113 108705
150555 9113
9113 55544
86147 9113
113001 9113
37860 911...

output:

Yes
1570 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 1571 537 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 3879 3880 3881 3882 3883 3884 3885 3325 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 336 6025 602...

result:

ok 2 cases (2 test cases)

Test #13:

score: 0
Accepted
time: 141ms
memory: 33228kb

input:

3
11753 62701
908 10104
3999 10104
10104 4350
10104 1596
10104 2708
7767 10104
1245 10104
3668 10104
10104 1974
10104 5515
2110 10104
5661 10104
10104 9160
2125 10104
10104 3866
8188 10104
10104 1757
7615 10104
9450 10104
10104 952
10104 7682
908 10698
908 1865
908 10296
4395 908
5421 908
11034 908
...

output:

Yes
2261 1504 4736 2105 1821 559 987 2675 3835 2856 7390 814 4097 6730 7678 2673 6154 2765 153 6296 6695 2411 4211 4212 4213 4214 4215 4216 365 4217 4218 210 4219 186 4220 753 409 225 1511 2715 3548 1053 4221 4222 4223 1185 3553 2528 938 8007 3938 338 5565 40 3060 4021 1998 2444 2693 7334 2104 3728 ...

result:

ok 3 cases (3 test cases)

Test #14:

score: 0
Accepted
time: 161ms
memory: 35280kb

input:

4
2808 3346
867 2365
2736 867
867 2108
1646 867
63 867
867 1680
1795 867
338 867
2528 867
596 2365
352 2365
2365 2291
633 2365
2365 1565
1555 2365
1637 2365
2189 2365
2365 712
333 2365
2183 2365
2209 2365
2365 353
596 1004
596 876
2147 596
596 933
596 336
596 1855
1946 596
352 2020
352 541
176 352
1...

output:

Yes
54 22 437 110 240 267 100 438 439 352 384 385 386 148 387 57 388 389 390 391 392 393 7 146 336 37 192 75 137 334 548 260 186 549 550 551 148 30 22 175 57 121 9 35 237 435 436 395 600 374 601 426 191 131 178 64 9 130 39 64 60 253 179 262 452 453 454 33 374 375 376 377 378 379 380 381 382 383 302 ...

result:

ok 4 cases (4 test cases)

Test #15:

score: 0
Accepted
time: 152ms
memory: 24404kb

input:

100
2064 6124
1934 591
1150 591
16 591
591 1161
591 384
591 1016
591 1274
942 591
20 591
1070 591
1754 591
1040 591
591 1845
2007 591
1961 591
591 1916
591 257
591 1923
591 2003
1934 1239
1934 1140
650 1934
1934 1273
1633 1934
1934 1331
1934 559
708 1934
1934 1570
498 1934
1328 1934
1934 205
347 193...

output:

Yes
372 731 914 915 540 122 916 894 888 137 481 556 917 272 796 918 93 371 844 185 1107 623 176 312 160 581 1048 790 397 502 634 1108 197 411 442 798 308 439 128 932 309 493 316 434 65 122 102 138 95 125 267 514 90 464 1103 2 460 151 3 511 422 188 314 657 11 609 246 472 101 314 533 87 3 233 100 482 ...

result:

ok 100 cases (100 test cases)

Test #16:

score: 0
Accepted
time: 145ms
memory: 25236kb

input:

200
372 5023
95 240
240 72
277 240
335 240
240 50
240 274
240 57
327 240
29 240
253 240
240 35
240 53
275 240
135 240
228 240
82 240
93 240
240 196
240 188
104 240
68 240
240 209
240 345
200 240
88 240
340 240
174 240
369 240
240 226
270 240
95 8
95 115
103 95
214 95
28 95
181 95
154 95
371 95
95 33...

output:

Yes
49 12 2 168 19 1 32 161 17 122 116 63 136 132 165 156 180 51 93 73 38 100 41 97 175 35 87 136 78 37 41 10 203 236 33 220 28 215 139 214 81 52 69 216 94 61 154 30 217 101 17 179 57 20 157 40 32 15 121 104 2 71 132 13 91 64 164 72 137 120 173 121 175 17 53 93 135 152 189 146 136 4 167 88 101 73 12...

result:

ok 200 cases (200 test cases)

Test #17:

score: 0
Accepted
time: 136ms
memory: 22060kb

input:

300
951 1030
679 372
372 576
259 372
372 310
372 854
409 372
372 839
372 778
372 641
634 372
261 372
372 414
729 372
679 71
876 679
679 318
491 679
679 198
900 679
679 10
71 830
504 71
244 71
394 71
71 761
256 576
133 576
576 694
256 910
256 277
256 623
737 256
910 874
910 646
420 910
234 910
910 4
...

output:

Yes
46 24 3 151 12 8 66 211 194 193 145 31 11 72 8 9 16 24 176 46 120 121 122 123 124 120 102 23 148 149 150 151 175 176 177 178 179 10 4 9 81 2 54 49 158 76 179 180 5 181 153 154 155 5 6 15 164 165 166 167 70 91 99 95 183 184 35 185 29 6 13 200 18 18 16 174 39 151 49 109 136 187 4 62 106 188 23 38 ...

result:

ok 300 cases (300 test cases)

Test #18:

score: 0
Accepted
time: 135ms
memory: 23884kb

input:

400
519 2465
313 122
344 122
356 122
478 122
122 105
56 122
405 122
443 122
184 122
277 122
122 204
122 266
37 122
122 403
313 469
5 313
313 233
313 337
313 359
74 313
313 319
313 431
313 457
313 68
65 313
58 313
313 493
313 251
313 7
476 313
344 5
344 494
344 233
76 344
344 224
344 236
344 188
344 ...

output:

Yes
21 271 277 15 1 80 310 19 169 38 183 217 24 309 368 18 223 17 301 113 273 350 365 109 107 28 387 8 61 374 274 96 69 133 294 177 179 251 57 84 217 155 208 62 292 82 71 2 323 69 20 164 35 164 46 332 141 217 209 93 191 229 356 17 158 88 15 6 91 351 30 133 45 26 212 274 398 250 203 341 322 263 152 1...

result:

ok 400 cases (400 test cases)

Test #19:

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

input:

91747
5 5
1 2
1 3
3 4
4 5
3 5
1
1 1
5 5
1 2
1 3
3 4
4 5
3 5
1
1 2
5 5
1 2
1 3
3 4
4 5
3 5
1
1 3
5 5
1 2
1 3
3 4
4 5
3 5
1
1 4
5 5
1 2
1 3
3 4
4 5
3 5
1
1 5
5 5
1 2
1 3
3 4
4 5
3 5
1
2 1 2
5 5
1 2
1 3
3 4
4 5
3 5
1
2 1 3
5 5
1 2
1 3
3 4
4 5
3 5
1
2 1 4
5 5
1 2
1 3
3 4
4 5
3 5
1
2 1 5
5 5
1 2
1 3
3 4
...

output:

Yes
1 2 1 1 2 
Yes
4 1 1 1 2 
Yes
1 2 1 1 2 
Yes
1 2 2 1 1 
Yes
1 2 1 1 2 
No
No
No
No
Yes
1 2 1 1 2 
Yes
3 1 3 2 1 
Yes
3 1 1 2 3 
No
No
Yes
1 2 1 1 2 
No
No
No
No
No
No
No
No
Yes
2 1 2 1 3 
No
No
No
No
No
No
No
Yes
4 1 1 1 2 
Yes
1 2 1 1 2 
Yes
1 2 2 1 1 
Yes
1 2 1 1 2 
No
No
No
No
Yes
1 2 1 1 2 
...

result:

ok 91747 cases (91747 test cases)

Test #20:

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

input:

100000
6 10
1 2
2 4
2 5
2 6
3 4
3 5
3 6
4 5
4 6
5 6
1
1 1
6 10
1 2
2 4
2 5
2 6
3 4
3 5
3 6
4 5
4 6
5 6
1
1 2
6 10
1 2
2 4
2 5
2 6
3 4
3 5
3 6
4 5
4 6
5 6
1
1 3
6 10
1 2
2 4
2 5
2 6
3 4
3 5
3 6
4 5
4 6
5 6
1
1 4
6 10
1 2
2 4
2 5
2 6
3 4
3 5
3 6
4 5
4 6
5 6
1
1 5
6 10
1 2
2 4
2 5
2 6
3 4
3 5
3 6
4 5
4...

output:

Yes
1 1 2 3 3 2 1 1 2 1 
Yes
1 1 2 3 3 2 1 1 2 1 
Yes
1 1 2 3 3 2 1 1 2 1 
Yes
1 4 1 2 1 2 1 3 2 1 
Yes
1 1 4 2 2 1 1 3 1 2 
Yes
1 1 2 4 2 1 1 1 3 2 
No
No
No
No
No
No
No
No
No
Yes
1 4 1 2 1 2 1 3 2 1 
Yes
1 1 4 2 2 1 1 3 1 2 
Yes
1 1 2 4 2 1 1 1 3 2 
Yes
1 3 4 1 1 2 1 1 2 3 
Yes
1 3 1 4 1 1 2 2 1 3...

result:

ok 100000 cases (100000 test cases)

Test #21:

score: 0
Accepted
time: 16ms
memory: 22256kb

input:

91747
5 4
1 5
5 2
2 4
4 3
1
1 1
5 4
1 5
5 2
2 4
4 3
1
1 2
5 4
1 5
5 2
2 4
4 3
1
1 3
5 4
1 5
5 2
2 4
4 3
1
1 4
5 4
1 5
5 2
2 4
4 3
1
1 5
5 4
1 5
5 2
2 4
4 3
1
2 1 2
5 4
1 5
5 2
2 4
4 3
1
2 1 3
5 4
1 5
5 2
2 4
4 3
1
2 1 4
5 4
1 5
5 2
2 4
4 3
1
2 1 5
5 4
1 5
5 2
2 4
4 3
1
2 2 3
5 4
1 5
5 2
2 4
4 3
1
2 ...

output:

Yes
1 1 1 1 
Yes
1 1 1 1 
Yes
1 1 1 1 
Yes
1 1 1 1 
Yes
1 1 1 1 
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
1 1 1 1 
Yes
1 1 1 1 
Yes
1 1 1 1 
Yes
1 1 1 1 
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
1 1 1 1 
Yes
1 1 1 1 
Y...

result:

ok 91747 cases (91747 test cases)

Test #22:

score: 0
Accepted
time: 71ms
memory: 30928kb

input:

1
133819 200000
72234 62052
62052 125262
72072 62052
105495 62052
62052 31315
131581 62052
62052 122581
62052 79285
62052 60214
26697 62052
88097 62052
72234 121102
54367 72234
89776 72234
72010 72234
72234 124266
72234 64221
92679 72234
70101 72234
72234 93634
72234 83241
72234 78329
121102 31381
1...

output:

No

result:

ok 1 cases (1 test case)

Test #23:

score: 0
Accepted
time: 96ms
memory: 35656kb

input:

2
197804 200000
9113 81956
173293 81956
25620 81956
187287 81956
81956 119734
104627 81956
81956 180317
81956 102709
81956 67714
81956 184795
9620 81956
13190 9113
9113 136411
137957 9113
178436 9113
9113 121335
3488 9113
61022 9113
9113 108705
150555 9113
9113 55544
86147 9113
113001 9113
37860 911...

output:

No
No

result:

ok 2 cases (2 test cases)

Test #24:

score: 0
Accepted
time: 81ms
memory: 30292kb

input:

3
11753 62701
908 10104
3999 10104
10104 4350
10104 1596
10104 2708
7767 10104
1245 10104
3668 10104
10104 1974
10104 5515
2110 10104
5661 10104
10104 9160
2125 10104
10104 3866
8188 10104
10104 1757
7615 10104
9450 10104
10104 952
10104 7682
908 10698
908 1865
908 10296
4395 908
5421 908
11034 908
...

output:

No
No
No

result:

ok 3 cases (3 test cases)

Test #25:

score: 0
Accepted
time: 109ms
memory: 34640kb

input:

4
2808 3346
867 2365
2736 867
867 2108
1646 867
63 867
867 1680
1795 867
338 867
2528 867
596 2365
352 2365
2365 2291
633 2365
2365 1565
1555 2365
1637 2365
2189 2365
2365 712
333 2365
2183 2365
2209 2365
2365 353
596 1004
596 876
2147 596
596 933
596 336
596 1855
1946 596
352 2020
352 541
176 352
1...

output:

No
No
No
No

result:

ok 4 cases (4 test cases)

Test #26:

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

input:

100
2064 6124
1934 591
1150 591
16 591
591 1161
591 384
591 1016
591 1274
942 591
20 591
1070 591
1754 591
1040 591
591 1845
2007 591
1961 591
591 1916
591 257
591 1923
591 2003
1934 1239
1934 1140
650 1934
1934 1273
1633 1934
1934 1331
1934 559
708 1934
1934 1570
498 1934
1328 1934
1934 205
347 193...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No

result:

ok 100 cases (100 test cases)

Test #27:

score: 0
Accepted
time: 61ms
memory: 23380kb

input:

200
372 5023
95 240
240 72
277 240
335 240
240 50
240 274
240 57
327 240
29 240
253 240
240 35
240 53
275 240
135 240
228 240
82 240
93 240
240 196
240 188
104 240
68 240
240 209
240 345
200 240
88 240
340 240
174 240
369 240
240 226
270 240
95 8
95 115
103 95
214 95
28 95
181 95
154 95
371 95
95 33...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 200 cases (200 test cases)

Test #28:

score: 0
Accepted
time: 63ms
memory: 24040kb

input:

300
951 1030
679 372
372 576
259 372
372 310
372 854
409 372
372 839
372 778
372 641
634 372
261 372
372 414
729 372
679 71
876 679
679 318
491 679
679 198
900 679
679 10
71 830
504 71
244 71
394 71
71 761
256 576
133 576
576 694
256 910
256 277
256 623
737 256
910 874
910 646
420 910
234 910
910 4
...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
17 4 29 8 9 10 77 79 15 78 61 52 9 7 10 27 25 3 10 11 23 6 7 80 42 63 9 29 36 33 37 3 1 2 10 3 7 9 45 64 51 35 11 4 45 51 66 34 11 10 1 2 10...

result:

ok 300 cases (300 test cases)

Test #29:

score: 0
Accepted
time: 58ms
memory: 23788kb

input:

400
519 2465
313 122
344 122
356 122
478 122
122 105
56 122
405 122
443 122
184 122
277 122
122 204
122 266
37 122
122 403
313 469
5 313
313 233
313 337
313 359
74 313
313 319
313 431
313 457
313 68
65 313
58 313
313 493
313 251
313 7
476 313
344 5
344 494
344 233
76 344
344 224
344 236
344 188
344 ...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 400 cases (400 test cases)

Test #30:

score: 0
Accepted
time: 120ms
memory: 20812kb

input:

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

output:

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

result:

ok 100000 cases (100000 test cases)

Test #31:

score: 0
Accepted
time: 98ms
memory: 20560kb

input:

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

output:

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

result:

ok 50000 cases (50000 test cases)

Test #32:

score: 0
Accepted
time: 130ms
memory: 35532kb

input:

5
200000 200000
85681 60541
116116 60541
60541 166258
131760 60541
165485 60541
192880 60541
60541 119555
131728 60541
32350 60541
69289 60541
146760 60541
60541 11128
60541 178801
60541 22128
60541 55775
60541 93864
57164 85681
85681 131653
173687 85681
85681 35103
85681 5313
80956 85681
123041 856...

output:

No
No
No
No
No

result:

ok 5 cases (5 test cases)

Test #33:

score: 0
Accepted
time: 156ms
memory: 20944kb

input:

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

output:

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

result:

ok 100000 cases (100000 test cases)

Test #34:

score: 0
Accepted
time: 151ms
memory: 21068kb

input:

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

output:

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

result:

ok 50000 cases (50000 test cases)

Test #35:

score: 0
Accepted
time: 222ms
memory: 36316kb

input:

5
200000 200000
85681 60541
116116 60541
60541 166258
131760 60541
165485 60541
192880 60541
60541 119555
131728 60541
32350 60541
69289 60541
146760 60541
60541 11128
60541 178801
60541 22128
60541 55775
60541 93864
57164 85681
85681 131653
173687 85681
85681 35103
85681 5313
80956 85681
123041 856...

output:

Yes
746 3737 611 73 676 1137 875 267 1198 189 83 52 569 254 702 691 352 181 491 144 85 119 3080 1255 239 96 828 217 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 2598 478 1513 3185 840 183 120 12 71 514 200 4250 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303...

result:

ok 5 cases (5 test cases)

Test #36:

score: 0
Accepted
time: 139ms
memory: 21504kb

input:

100
10000 10000
3266 9184
9184 1054
3229 9184
9184 9141
9184 653
8924 9184
9184 7613
4498 9184
9184 4636
8077 9184
9184 8214
2152 3266
3648 3266
3266 4190
4733 3266
3266 376
2806 3266
3266 5885
3266 8225
5161 3266
1323 2152
2152 5549
3666 2152
2152 6725
7719 2152
461 2152
4854 2152
5126 2152
3185 21...

output:

Yes
98 49 183 242 36 236 196 122 127 206 210 235 236 237 238 239 240 241 242 243 337 338 339 340 341 342 343 344 345 346 347 348 349 234 235 236 237 238 239 240 241 242 622 41 39 413 288 94 188 368 297 511 512 513 514 515 516 517 518 795 796 797 798 97 7 71 25 70 26 181 120 946 118 27 373 143 229 20...

result:

ok 100 cases (100 test cases)

Test #37:

score: 0
Accepted
time: 77ms
memory: 30796kb

input:

1
200000 200000
73430 94157
94157 101092
101092 45602
45602 130824
130824 113959
113959 85732
85732 116162
116162 152244
152244 184122
184122 189330
189330 89252
89252 165061
165061 55280
55280 169960
169960 55259
55259 87970
87970 21982
21982 105896
105896 150536
150536 95248
95248 177673
177673 10...

output:

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

result:

ok 1 cases (1 test case)

Test #38:

score: 0
Accepted
time: 86ms
memory: 30672kb

input:

1
199999 200000
174065 145980
145980 96651
96651 140772
140772 20428
20428 189277
189277 102889
102889 74229
74229 45968
45968 135277
135277 50552
50552 66888
66888 9771
9771 68599
68599 91485
91485 193574
193574 155557
155557 92561
92561 102920
102920 76168
76168 14999
14999 47109
47109 136479
1364...

output:

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

result:

ok 1 cases (1 test case)

Test #39:

score: 0
Accepted
time: 106ms
memory: 33260kb

input:

1
199997 200000
50736 33591
33591 8671
8671 132320
132320 190357
190357 158099
158099 46826
46826 30397
30397 176649
176649 34339
34339 25756
25756 40319
40319 146351
146351 168140
168140 54911
54911 115215
115215 43647
43647 117053
117053 164914
164914 154300
154300 66678
66678 70987
70987 20968
20...

output:

Yes
2 17 6 2 2 5 3 2 10 12 19 8 22 12 8 2 4 13 8 4 1 2 38 7 4 11 2 1 9 2 3 22 1 1 5 4 10 2 5 7 8 24 7 10 14 3 8 2 9 2 4 25 12 23 19 5 9 3 15 1 1 1 2 8 2 5 8 6 14 1 14 7 5 30 16 20 10 3 6 30 1 15 9 12 2 7 2 1 2 3 17 11 1 8 9 1 5 8 23 5 10 4 16 2 39 2 5 6 4 8 1 1 6 8 7 4 2 2 8 5 11 5 3 1 3 2 2 28 5 3 ...

result:

ok 1 cases (1 test case)

Test #40:

score: 0
Accepted
time: 93ms
memory: 33224kb

input:

1
199991 200000
63650 119357
119357 780
780 31061
31061 84731
84731 3391
3391 1403
1403 70956
70956 177661
177661 79067
79067 4157
4157 82102
82102 95995
95995 167044
167044 109461
109461 131170
131170 24178
24178 88534
88534 78947
78947 40126
40126 103455
103455 154890
154890 137983
137983 89761
89...

output:

Yes
10 3 47 9 10 43 28 16 2 11 82 6 11 31 25 9 22 35 11 34 13 63 3 57 18 41 9 19 7 22 25 1 32 3 37 3 32 3 10 30 28 6 25 2 46 6 13 18 8 1 47 4 32 2 42 8 6 11 18 13 15 7 12 13 18 63 7 49 18 6 36 26 2 8 78 62 16 1 15 3 18 9 14 70 15 54 12 5 4 8 21 30 97 5 4 6 7 10 5 3 27 15 7 55 6 5 5 2 28 37 20 44 38 ...

result:

ok 1 cases (1 test case)

Test #41:

score: 0
Accepted
time: 91ms
memory: 31968kb

input:

1
199901 200000
76324 135017
135017 179738
179738 50652
50652 154261
154261 11415
11415 64361
64361 111164
111164 25467
25467 191137
191137 167456
167456 185182
185182 3915
3915 168115
168115 119442
119442 117322
117322 123615
123615 162622
162622 126029
126029 158554
158554 150075
150075 93776
9377...

output:

Yes
680 498 68 79 6 278 213 176 105 163 143 435 110 40 84 139 255 1 473 300 199 81 531 273 184 20 488 304 170 116 151 88 168 29 334 51 127 179 66 224 325 148 70 18 24 42 806 793 269 6 117 189 226 441 522 200 295 76 132 100 161 179 1 175 26 716 127 156 108 343 89 38 29 212 188 291 200 200 200 200 200...

result:

ok 1 cases (1 test case)

Test #42:

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

input:

1
199801 200000
24827 18470
18470 39815
39815 199236
199236 50827
50827 6662
6662 195671
195671 168602
168602 136919
136919 3932
3932 146070
146070 180118
180118 43755
43755 18833
18833 17582
17582 64346
64346 185377
185377 76426
76426 164900
164900 158321
158321 35504
35504 8045
8045 83504
83504 44...

output:

Yes
460 1028 1062 192 1377 666 292 740 235 743 668 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 400 4...

result:

ok 1 cases (1 test case)

Test #43:

score: 0
Accepted
time: 128ms
memory: 31436kb

input:

1
190001 200000
46057 74035
74035 48844
48844 69478
69478 127318
127318 81556
81556 60621
60621 14425
14425 150533
150533 171228
171228 188346
188346 158190
158190 1311
1311 108551
108551 102653
102653 145556
145556 86805
86805 105356
105356 19894
46057 1
19894 1
122226 143891
143891 165132
165132 1...

output:

Yes
20000 20000 20000 20000 20000 20000 20000 20000 17138 19859 20000 20000 20000 20000 20000 20000 20000 20000 4961 2240 20000 20000 20000 20000 20000 20000 20000 20000 11800 19200 20000 20000 20000 20000 20000 20000 20000 20000 12954 5554 20000 20000 20000 20000 20000 20000 20000 20000 17241 19737...

result:

ok 1 cases (1 test case)

Test #44:

score: 0
Accepted
time: 127ms
memory: 32032kb

input:

1
180001 200000
17000 132825
132825 47303
47303 113653
113653 39540
39540 18369
18369 108769
108769 54899
54899 82964
17000 1
82964 1
31739 57409
57409 58696
58696 69730
69730 79482
79482 77715
77715 69559
69559 134750
134750 19083
31739 1
19083 1
29825 117252
117252 77929
77929 38940
38940 63157
63...

output:

Yes
40000 40000 40000 39822 25227 40000 40000 40000 3834 18429 40000 40000 40000 36955 39763 40000 40000 40000 7094 4286 40000 40000 40000 33499 40000 40000 40000 40000 6665 164 40000 40000 40000 12362 38869 40000 40000 40000 35899 9392 40000 40000 40000 39983 19897 40000 40000 40000 1317 21403 4000...

result:

ok 1 cases (1 test case)

Test #45:

score: 0
Accepted
time: 112ms
memory: 34252kb

input:

1
200000 199999
1 171541
171541 66536
66536 9759
176664 9759
176664 84213
84213 83489
83489 129396
86199 129396
172364 86199
142986 172364
93420 142986
93420 146579
96161 146579
96161 191703
191703 83518
196083 83518
196083 37112
37112 105353
105353 165142
54541 165142
54541 124571
124571 187179
187...

output:

Yes
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok 1 cases (1 test case)

Extra Test:

score: 0
Extra Test Passed