QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248589#7629. Make SYSU Great Again IIucup-team1191#AC ✓210ms86664kbC++2012.7kb2023-11-11 20:10:282023-11-11 20:10:28

Judging History

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

  • [2023-11-11 20:10:28]
  • 评测
  • 测评结果:AC
  • 用时:210ms
  • 内存:86664kb
  • [2023-11-11 20:10:28]
  • 提交

answer

/*
    author:  Maksim1744
    created: 11.11.2023 14:02:30
*/

#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;

#define mp   make_pair
#define pb   push_back
#define eb   emplace_back

#define sum(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a)    (*min_element((a).begin(), (a).end()))
#define maxe(a)    (*max_element((a).begin(), (a).end()))
#define mini(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi(a)    ( max_element((a).begin(), (a).end()) - (a).begin())
#define lowb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define uppb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())

template<typename T>             vector<T>& operator--            (vector<T> &v){for (auto& i : v) --i;            return  v;}
template<typename T>             vector<T>& operator++            (vector<T> &v){for (auto& i : v) ++i;            return  v;}
template<typename T>             istream& operator>>(istream& is,  vector<T> &v){for (auto& i : v) is >> i;        return is;}
template<typename T>             ostream& operator<<(ostream& os,  vector<T>  v){for (auto& i : v) os << i << ' '; return os;}
template<typename T, typename U> pair<T,U>& operator--           (pair<T, U> &p){--p.first; --p.second;            return  p;}
template<typename T, typename U> pair<T,U>& operator++           (pair<T, U> &p){++p.first; ++p.second;            return  p;}
template<typename T, typename U> istream& operator>>(istream& is, pair<T, U> &p){is >> p.first >> p.second;        return is;}
template<typename T, typename U> ostream& operator<<(ostream& os, pair<T, U>  p){os << p.first << ' ' << p.second; return os;}
template<typename T, typename U> pair<T,U> operator-(pair<T,U> a, pair<T,U> b){return mp(a.first-b.first, a.second-b.second);}
template<typename T, typename U> pair<T,U> operator+(pair<T,U> a, pair<T,U> b){return mp(a.first+b.first, a.second+b.second);}
template<typename T, typename U> void umin(T& a, U b){if (a > b) a = b;}
template<typename T, typename U> void umax(T& a, U b){if (a < b) a = b;}

#ifdef HOME
#define SHOW_COLORS
#include "/mnt/c/Libs/tools/print.cpp"
#else
#define show(...) void(0)
#define debugf(fun)   fun
#define debugv(var)   var
#define mclock    void(0)
#define shows     void(0)
#define debug  if (false)
#define OSTREAM(...)    ;
#define OSTREAM0(...)   ;
#endif

template<class Fun>
class y_combinator_result {
    Fun fun_;
public:
    template<class T>
    explicit y_combinator_result(T &&fun): fun_(std::forward<T>(fun)) {}

    template<class ...Args>
    decltype(auto) operator()(Args &&...args) {
        return fun_(std::ref(*this), std::forward<Args>(args)...);
    }
};
template<class Fun>
decltype(auto) y_combinator(Fun &&fun) {
    return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
}
// auto gcd = std::y_combinator([](auto gcd, int a, int b) -> int {
//     return b == 0 ? a : gcd(b, a % b);
// });

mt19937_64 rng;
ll rnd (ll l, ll r) { return (ll)(rng() % (r - l + 1)) + l; }
ll rnd (ll r)       { return rng() % r; }
ll rnd ()           { return rng(); }
ld rndf()           { return (ld)rng() / (ld)ULLONG_MAX; }
ld rndf(ld l, ld r) { return rndf() * (r - l) + l; }

namespace grid_iterator_ns {
const array<pair<int, int>, 8> dirs = {{{0, 1}, {1, 0}, {0, -1}, {-1, 0}, {1, 1}, {-1, -1}, {1, -1}, {-1, 1}}};
struct GridIterator {
    int n, m;
    GridIterator(int n, int m) : n(n), m(m) {}

    template<size_t N>
    struct NeighbourIteratorContainer {
        int i, j, n, m;
        NeighbourIteratorContainer(int i, int j, int n, int m) : i(i), j(j), n(n), m(m) {}

        struct NeighbourIterator {
            int cur;
            int i, j, n, m;
            NeighbourIterator(int cur, int i, int j, int n, int m) : cur(cur), i(i), j(j), n(n), m(m) {
                skip_to_first_allowed();
            }

            void skip_to_first_allowed() {
                while (cur < N &&
                    (i + dirs[cur].first  < 0 || i + dirs[cur].first  >= n ||
                     j + dirs[cur].second < 0 || j + dirs[cur].second >= m)) {
                    ++cur;
                }
            }

            NeighbourIterator& operator ++ () {
                ++cur;
                skip_to_first_allowed();
                return *this;
            }

            pair<int, int> operator * () const { return {i + dirs[cur].first, j + dirs[cur].second}; }

            bool operator == (const NeighbourIterator& other) const { return cur == other.cur; }
        };

        auto begin() const { return NeighbourIterator(0, i, j, n, m); }
        auto end()   const { return NeighbourIterator(N, i, j, n, m); }

        auto collect() const {
            vector<pair<int, int>> result;
            for (auto it = begin(); it != end(); ++it) result.push_back(*it);
            return result;
        }
    };

    template<size_t N>
    auto iterate(int i, int j) const {
        static_assert(N == 4 || N == 8, "you can remove this, but make sure you understand what you are doing");
        return NeighbourIteratorContainer<N>(i, j, n, m);
    }
};
}
using grid_iterator_ns::GridIterator;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    uint64_t seed = chrono::steady_clock::now().time_since_epoch().count();
    seed = 13905694550644;
    // cerr << "seed: " << seed << endl;
    // 13905694550644
    rng.seed(seed);

    int n = 2000;
    cin >> n;
    if (n <= 2) {
        cout << "Yes\n";
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                cout << 0 << " \n"[j + 1 == n];
            }
        }
        return 0;
    }
    auto trans = [&](const vector<vector<int>>& v) {
        vector<vector<int>> res(v[0].size(), vector<int>(v.size()));
        for (int i = 0; i < v.size(); ++i) {
            for (int j = 0; j < v[i].size(); ++j) {
                res[j][i] = v[i][j];
            }
        }
        return res;
    };
    int best = 0;
    vector<vector<pair<int, int>>> seq;
    vector<vector<int>> st;
    auto gen = y_combinator([&](auto gen, vector<vector<int>> cur, int bit) -> bool {
        if (cur.size() > cur[0].size()) {
            cur = trans(cur);
        }
        for (int i = 0; i < cur.size(); ++i) {
            for (int j = 0; j < cur[i].size(); ++j) {
                if (i && (cur[i][j] & cur[i - 1][j])) return false;
                if (j && (cur[i][j] & cur[i][j - 1])) return false;
            }
        }
        int mx = 0;
        for (auto& a : cur)
            for (auto b : a)
                mx = max(mx, b);
        if (cur.size() == cur[0].size() && mx >= (cur.size() / 2 + 2) * (cur.size() / 2 + 2) * 4) return false;
        vector<int> cnt(mx + 1, 0);
        for (auto& a : cur)
            for (auto b : a)
                cnt[b]++;
        if (maxe(cnt) > 5) return false;
        if (cur.size() == cur[0].size()) {
            if (cur.size() > best) {
                best = cur.size();
                // cout << "found new best: " << best << endl;
                // cout << "st: " << st << endl;
                // cout << "seq: " << seq << endl;
                // cerr << "found new best: " << best << " with max " << mx << endl;
                show(cur);
                if (best >= n) {
                    cout << "Yes\n";
                    for (int i = 0; i < n; ++i) {
                        for (int j = 0; j < n; ++j) {
                            if (cur[i][j] >= n * n * 4) {
                                cerr << endl;
                                cerr << cur[i][j] << ' ' << n * n * 4 << endl;
                                assert(false);
                            }
                            cout << cur[i][j] << " \n"[j + 1 == n];
                        }
                    }
                    exit(0);
                    return true;
                }
            }
        }
        int sz = cur.size();
        for (int i = sz - 2; i >= 0; --i)
            cur.pb(cur[i]);
        vector<pair<int, int>> other;
        for (int i = 0; i < cur[0].size(); ++i) {
            other.eb(sz, i);
            other.eb(sz - 1, i);
            other.eb(sz - 2, i);
        }
        for (int i = 0; i < 3; ++i) {
            auto nx = cur;
            int b = rnd(2);
            shuffle(other.begin(), other.end(), rng);
            for (int i = 0; i + 2 < sz; ++i) {
                for (int j = 0; j < nx[i].size(); ++j) {
                    if ((i + j) % 2 == b) nx[i][j] |= bit;
                }
            }
            for (int i = sz + 1; i < nx.size(); ++i) {
                for (int j = 0; j < nx[i].size(); ++j) {
                    if ((i + j) % 2 != b) nx[i][j] |= bit;
                }
            }
            bool ok = true;
            GridIterator gi(nx.size(), nx[0].size());
            for (auto [u, v] : other) {
                int ne = 0;
                for (auto [x, y] : gi.iterate<4>(u, v)) {
                    ne |= nx[x][y];
                }
                if (nx[u][v] & ne) {
                    ok = false;
                    break;
                }
                if ((nx[u][v] | bit) & ne) continue;
                nx[u][v] |= bit;
            }
            if (!ok) continue;
            seq.pb(other);
            seq.back().eb(-1, b);
            bool res = gen(std::move(nx), bit * 2);
            seq.pop_back();
            if (res) return true;
        }
        return false;

        // vector<int> rots(cur.size());
        // iota(rots.begin(), rots.end(), 0);
        // shuffle(rots.begin(), rots.end(), rng);
        // int totsz = cur.size() * cur[0].size();
        // assert((totsz & (totsz - 1)) == 0);
        // for (int r : rots) {
        //     for (int b = 0; b <= 2; ++b) {
        //         auto nx = cur;
        //         rotate(nx.begin(), nx.begin() + r, nx.end());
        //         int sz = nx.size();
        //         for (int i = 0; i < sz; ++i) {
        //             nx.pb(nx[i]);
        //         }
        //         if (b >= 2) {
        //             for (int i = 0; i < nx.size(); ++i) {
        //                 for (int j = 0; j < nx[i].size(); ++j) {
        //                     if ((i + j) % 2 != b % 2) {
        //                         nx[i][j] += totsz;
        //                     }
        //                 }
        //             }
        //         } else {
        //             for (int i = 1; i + 1 < sz; ++i) {
        //                 for (int j = 0; j < nx[i].size(); ++j) {
        //                     if ((i + j) % 2 == b % 2) {
        //                         nx[i][j] += totsz;
        //                     }
        //                 }
        //             }
        //             for (int i = sz; i < nx.size(); ++i) {
        //                 for (int j = 0; j < nx[i].size(); ++j) {
        //                     if ((i + j) % 2 != b % 2) {
        //                         nx[i][j] += totsz;
        //                     }
        //                 }
        //             }
        //         }
        //         vector<int> cnt(totsz * 2);
        //         for (auto& a : nx)
        //             for (int b : a)
        //                 cnt[b]++;
        //         // show(nx);
        //         if (maxe(cnt) > 5) {
        //             continue;
        //         }
        //         seq.pb(r * 100000 + b);
        //         bool res = gen(std::move(nx));
        //         seq.pop_back();
        //         if (res) return true;
        //     }
        // }
        // return false;
    });

    int it = 0;
    while (true) {
        ++it;
        if (it % 10000000 == 0)
            cerr << "it: " << it << endl;
        int sz = rnd(2) ? 3 : 5;
        vector<vector<int>> v(sz, vector<int>(sz));
        int lim = sz * sz;
        while ((lim & (lim - 1))) --lim;
        int x = __lg(lim);
        lim = (1 << rnd(0, x + 1));
        for (int i = 0; i < sz; ++i) {
            for (int j = 0; j < sz; ++j) {
                v[i][j] = rnd(lim);
            }
        }
        st = v;
        if (gen(st, lim)) break;
    }

    // for (int i = 0; i < (1 << 8); ++i) {
    //     vector<vector<int>> s(2, vector<int>(2));
    //     for (int k = 0; k < 2; ++k) {
    //         for (int j = 0; j < 2; ++j) {
    //             s[k][j] = ((i >> ((k * 2 + j) * 2)) & 3);
    //         }
    //     }
    //     if (s[0][0] & s[0][1]) continue;
    //     if (s[1][0] & s[1][1]) continue;
    //     if (s[0][0] & s[1][0]) continue;
    //     if (s[0][1] & s[1][1]) continue;
    //     show(s);
    //     gen(s);
    // }

    return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4

output:

Yes
7 8 7 8
8 5 8 1
7 8 3 4
0 5 0 9

result:

ok 1

Test #2:

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

input:

1

output:

Yes
0

result:

ok 1

Test #3:

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

input:

2

output:

Yes
0 0
0 0

result:

ok 1

Test #4:

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

input:

3

output:

Yes
3 0 3
0 1 0
3 0 3

result:

ok 1

Test #5:

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

input:

5

output:

Yes
7 8 7 8 3
8 5 8 1 4
7 8 3 4 11
0 5 0 9 4
15 0 15 0 11

result:

ok 1

Test #6:

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

input:

8

output:

Yes
7 56 7 48 15 32 23 40
56 5 56 5 32 21 40 21
7 56 3 48 15 32 19 40
56 1 52 9 0 25 36 17
3 20 11 4 59 4 27 4
24 33 20 41 0 57 4 49
39 24 35 16 47 0 51 8
24 37 24 37 0 53 8 53

result:

ok 1

Test #7:

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

input:

13

output:

Yes
71 184 71 184 67 152 103 152 39 216 39 216 3
184 69 184 65 148 97 152 37 216 37 216 33 212
71 184 67 180 75 148 99 152 39 216 35 212 11
176 69 176 73 132 105 144 37 208 37 208 41 196
79 160 79 128 123 128 111 128 47 192 47 192 59
160 85 160 89 132 121 128 53 192 53 192 57 196
87 168 83 164 91 13...

result:

ok 1

Test #8:

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

input:

21

output:

Yes
639 384 639 384 631 384 623 272 751 272 751 256 759 256 767 256 767 0 1023 0 1015
384 633 384 625 392 609 400 617 272 745 272 737 264 753 256 761 0 1017 0 1009 8
635 388 627 396 611 412 611 404 619 276 739 284 739 268 755 4 1019 4 1011 12 995
388 625 396 609 412 609 412 609 404 609 284 737 284 7...

result:

ok 1

Test #9:

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

input:

34

output:

Yes
2614 1481 2612 1481 2578 1513 2580 1449 2646 1449 2644 1449 2642 1417 2676 1417 2678 1417 2164 1929 2130 1961 2132 1961 2134 1961 2068 2025 2066 1993 2100 1993 2102 969
1481 2612 1474 2608 1477 2576 1506 2580 1449 2644 1442 2640 1413 2672 1410 2676 1417 2164 1922 2160 1925 2128 1954 2132 1961 20...

result:

ok 1

Test #10:

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

input:

55

output:

Yes
2614 1481 2612 1481 2578 1513 2580 1449 2646 1449 2644 1449 2642 1417 2676 1417 2678 1417 2164 1929 2130 1961 2132 1961 2134 1961 2068 2025 2066 1993 2100 1993 2102 969 3124 969 3090 1001 3092 937 3158 937 3156 937 3154 905 3188 393 3702 393 3700 393 3666 425 3668
1481 2612 1474 2608 1477 2576 1...

result:

ok 1

Test #11:

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

input:

89

output:

Yes
14230 2153 14230 2145 14222 2161 14214 2169 14086 2297 14086 2289 14094 2273 14102 2281 14102 2281 13846 2529 13838 2545 13830 2553 13830 2425 13958 2417 13966 2401 13974 361 16022 361 16022 353 16014 369 16006 377 15878 505 15878 497 15886 481 15894 233 16150 233 16150 225 16142 241 16134 249 1...

result:

ok 1

Test #12:

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

input:

100

output:

Yes
14230 2153 14230 2145 14222 2161 14214 2169 14086 2297 14086 2289 14094 2273 14102 2281 14102 2281 13846 2529 13838 2545 13830 2553 13830 2425 13958 2417 13966 2401 13974 361 16022 361 16022 353 16014 369 16006 377 15878 505 15878 497 15886 481 15894 233 16150 233 16150 225 16142 241 16134 249 1...

result:

ok 1

Test #13:

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

input:

200

output:

Yes
30614 34921 30612 34921 30610 34889 30644 34889 30646 34825 30708 34825 30674 34857 30676 34857 30166 35369 30164 35369 30162 35337 30196 35337 30134 35401 30132 35401 30098 35433 30100 35433 29078 36457 29076 36457 29074 36425 29108 36425 29110 36361 29172 36361 29138 36393 29140 36393 29142 35...

result:

ok 1

Test #14:

score: 0
Accepted
time: 12ms
memory: 9036kb

input:

300

output:

Yes
227222 34921 227222 34913 227214 34929 227206 34937 227078 35065 227078 35057 227086 35041 227094 35049 227094 35049 226838 35297 226830 35313 226822 35321 226822 35193 226950 35185 226958 35169 226966 33129 229014 33129 229014 33121 229006 33137 228998 33145 228870 33273 228870 33265 228878 332...

result:

ok 1

Test #15:

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

input:

400

output:

Yes
227222 34921 227222 34913 227214 34929 227206 34937 227078 35065 227078 35057 227086 35041 227094 35049 227094 35049 226838 35297 226830 35313 226822 35321 226822 35193 226950 35185 226958 35169 226966 33129 229014 33129 229014 33121 229006 33137 228998 33145 228870 33273 228870 33265 228878 332...

result:

ok 1

Test #16:

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

input:

500

output:

Yes
227222 34921 227222 34913 227214 34929 227206 34937 227078 35065 227078 35057 227086 35041 227094 35049 227094 35049 226838 35297 226830 35313 226822 35321 226822 35193 226950 35185 226958 35169 226966 33129 229014 33129 229014 33121 229006 33137 228998 33145 228870 33273 228870 33265 228878 332...

result:

ok 1

Test #17:

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

input:

600

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #18:

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

input:

700

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #19:

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

input:

800

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #20:

score: 0
Accepted
time: 45ms
memory: 24676kb

input:

900

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #21:

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

input:

1000

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #22:

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

input:

1200

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Test #23:

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

input:

1400

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Test #24:

score: 0
Accepted
time: 140ms
memory: 86472kb

input:

1600

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Test #25:

score: 0
Accepted
time: 173ms
memory: 86548kb

input:

1800

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Test #26:

score: 0
Accepted
time: 162ms
memory: 86664kb

input:

1900

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Test #27:

score: 0
Accepted
time: 189ms
memory: 86472kb

input:

1920

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Test #28:

score: 0
Accepted
time: 210ms
memory: 86540kb

input:

2000

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Test #29:

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

input:

62

output:

Yes
2614 1481 2612 1481 2578 1513 2580 1449 2646 1449 2644 1449 2642 1417 2676 1417 2678 1417 2164 1929 2130 1961 2132 1961 2134 1961 2068 2025 2066 1993 2100 1993 2102 969 3124 969 3090 1001 3092 937 3158 937 3156 937 3154 905 3188 393 3702 393 3700 393 3666 425 3668 425 3670 425 3604 489 3602 457
...

result:

ok 1

Test #30:

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

input:

130

output:

Yes
30614 34921 30612 34921 30610 34889 30644 34889 30646 34825 30708 34825 30674 34857 30676 34857 30166 35369 30164 35369 30162 35337 30196 35337 30134 35401 30132 35401 30098 35433 30100 35433 29078 36457 29076 36457 29074 36425 29108 36425 29110 36361 29172 36361 29138 36393 29140 36393 29142 35...

result:

ok 1

Test #31:

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

input:

126

output:

Yes
14230 2153 14230 2145 14222 2161 14214 2169 14086 2297 14086 2289 14094 2273 14102 2281 14102 2281 13846 2529 13838 2545 13830 2553 13830 2425 13958 2417 13966 2401 13974 361 16022 361 16022 353 16014 369 16006 377 15878 505 15878 497 15886 481 15894 233 16150 233 16150 225 16142 241 16134 249 1...

result:

ok 1

Test #32:

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

input:

66

output:

Yes
14230 2153 14230 2145 14222 2161 14214 2169 14086 2297 14086 2289 14094 2273 14102 2281 14102 2281 13846 2529 13838 2545 13830 2553 13830 2425 13958 2417 13966 2401 13974 361 16022 361 16022 353 16014 369 16006 377 15878 505 15878 497 15886 481 15894 233 16150 233 16150 225 16142 241 16134 249 1...

result:

ok 1

Test #33:

score: 0
Accepted
time: 56ms
memory: 24536kb

input:

1021

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #34:

score: 0
Accepted
time: 51ms
memory: 24536kb

input:

1022

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #35:

score: 0
Accepted
time: 45ms
memory: 24624kb

input:

1023

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #36:

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

input:

1024

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #37:

score: 0
Accepted
time: 57ms
memory: 24780kb

input:

1025

output:

Yes
227222 821353 227220 821353 227218 821321 227252 821321 227254 821257 227316 821257 227282 821289 227284 821289 226774 821801 226772 821801 226770 821769 226804 821769 226742 821833 226740 821833 226706 821865 226708 821865 225686 822889 225684 822889 225682 822857 225716 822857 225718 822793 22...

result:

ok 1

Test #38:

score: 0
Accepted
time: 88ms
memory: 86432kb

input:

1026

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Test #39:

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

input:

1027

output:

Yes
227222 3967081 227222 3967073 227214 3967089 227206 3967097 227078 3967225 227078 3967217 227086 3967201 227094 3967209 227094 3967209 226838 3967457 226830 3967473 226822 3967481 226822 3967353 226950 3967345 226958 3967329 226966 3965289 229014 3965289 229014 3965281 229006 3965297 228998 3965...

result:

ok 1

Extra Test:

score: 0
Extra Test Passed