QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#860397#9975. Hitoshizukuucup-team055#AC ✓172ms26140kbC++207.4kb2025-01-18 13:11:552025-01-18 13:12:43

Judging History

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

  • [2025-01-18 13:12:43]
  • 评测
  • 测评结果:AC
  • 用时:172ms
  • 内存:26140kb
  • [2025-01-18 13:11:55]
  • 提交

answer

#line 1 "e.cpp"
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
const ll ILL=2167167167167167167;
const int INF=2100000000;
#define rep(i,a,b) for (int i=(int)(a);i<(int)(b);i++)
#define all(p) p.begin(),p.end()
template<class T> using _pq = priority_queue<T, vector<T>, greater<T>>;
template<class T> int LB(vector<T> &v,T a){return lower_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> int UB(vector<T> &v,T a){return upper_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> bool chmin(T &a,T b){if(b<a){a=b;return 1;}else return 0;}
template<class T> bool chmax(T &a,T b){if(a<b){a=b;return 1;}else return 0;}
template<class T> void So(vector<T> &v) {sort(v.begin(),v.end());}
template<class T> void Sore(vector<T> &v) {sort(v.begin(),v.end(),[](T x,T y){return x>y;});}
bool yneos(bool a,bool upp=false){if(a){cout<<(upp?"YES\n":"Yes\n");}else{cout<<(upp?"NO\n":"No\n");}return a;}
template<class T> void vec_out(vector<T> &p,int ty=0){
    if(ty==2){cout<<'{';for(int i=0;i<(int)p.size();i++){if(i){cout<<",";}cout<<'"'<<p[i]<<'"';}cout<<"}\n";}
    else{if(ty==1){cout<<p.size()<<"\n";}for(int i=0;i<(int)(p.size());i++){if(i) cout<<" ";cout<<p[i];}cout<<"\n";}}
template<class T> T vec_min(vector<T> &a){assert(!a.empty());T ans=a[0];for(auto &x:a) chmin(ans,x);return ans;}
template<class T> T vec_max(vector<T> &a){assert(!a.empty());T ans=a[0];for(auto &x:a) chmax(ans,x);return ans;}
template<class T> T vec_sum(vector<T> &a){T ans=T(0);for(auto &x:a) ans+=x;return ans;}
int pop_count(long long a){int res=0;while(a){res+=(a&1),a>>=1;}return res;}


#include <algorithm>
#include <cassert>
#include <functional>
#include <vector>


#ifdef _MSC_VER
#include <intrin.h>
#endif

#if __cplusplus >= 202002L
#include <bit>
#endif

namespace atcoder {

namespace internal {

#if __cplusplus >= 202002L

using std::bit_ceil;

#else

// @return same with std::bit::bit_ceil
unsigned int bit_ceil(unsigned int n) {
    unsigned int x = 1;
    while (x < (unsigned int)(n)) x *= 2;
    return x;
}

#endif

// @param n `1 <= n`
// @return same with std::bit::countr_zero
int countr_zero(unsigned int n) {
#ifdef _MSC_VER
    unsigned long index;
    _BitScanForward(&index, n);
    return index;
#else
    return __builtin_ctz(n);
#endif
}

// @param n `1 <= n`
// @return same with std::bit::countr_zero
constexpr int countr_zero_constexpr(unsigned int n) {
    int x = 0;
    while (!(n & (1 << x))) x++;
    return x;
}

}  // namespace internal

}  // namespace atcoder


namespace atcoder {

#if __cplusplus >= 201703L

template <class S, auto op, auto e> struct segtree {
    static_assert(std::is_convertible_v<decltype(op), std::function<S(S, S)>>,
                  "op must work as S(S, S)");
    static_assert(std::is_convertible_v<decltype(e), std::function<S()>>,
                  "e must work as S()");

#else

template <class S, S (*op)(S, S), S (*e)()> struct segtree {

#endif

  public:
    segtree() : segtree(0) {}
    explicit segtree(int n) : segtree(std::vector<S>(n, e())) {}
    explicit segtree(const std::vector<S>& v) : _n(int(v.size())) {
        size = (int)internal::bit_ceil((unsigned int)(_n));
        log = internal::countr_zero((unsigned int)size);
        d = std::vector<S>(2 * size, e());
        for (int i = 0; i < _n; i++) d[size + i] = v[i];
        for (int i = size - 1; i >= 1; i--) {
            update(i);
        }
    }

    void set(int p, S x) {
        assert(0 <= p && p < _n);
        p += size;
        d[p] = x;
        for (int i = 1; i <= log; i++) update(p >> i);
    }

    S get(int p) const {
        assert(0 <= p && p < _n);
        return d[p + size];
    }

    S prod(int l, int r) const {
        assert(0 <= l && l <= r && r <= _n);
        S sml = e(), smr = e();
        l += size;
        r += size;

        while (l < r) {
            if (l & 1) sml = op(sml, d[l++]);
            if (r & 1) smr = op(d[--r], smr);
            l >>= 1;
            r >>= 1;
        }
        return op(sml, smr);
    }

    S all_prod() const { return d[1]; }

    template <bool (*f)(S)> int max_right(int l) const {
        return max_right(l, [](S x) { return f(x); });
    }
    template <class F> int max_right(int l, F f) const {
        assert(0 <= l && l <= _n);
        assert(f(e()));
        if (l == _n) return _n;
        l += size;
        S sm = e();
        do {
            while (l % 2 == 0) l >>= 1;
            if (!f(op(sm, d[l]))) {
                while (l < size) {
                    l = (2 * l);
                    if (f(op(sm, d[l]))) {
                        sm = op(sm, d[l]);
                        l++;
                    }
                }
                return l - size;
            }
            sm = op(sm, d[l]);
            l++;
        } while ((l & -l) != l);
        return _n;
    }

    template <bool (*f)(S)> int min_left(int r) const {
        return min_left(r, [](S x) { return f(x); });
    }
    template <class F> int min_left(int r, F f) const {
        assert(0 <= r && r <= _n);
        assert(f(e()));
        if (r == 0) return 0;
        r += size;
        S sm = e();
        do {
            r--;
            while (r > 1 && (r % 2)) r >>= 1;
            if (!f(op(d[r], sm))) {
                while (r < size) {
                    r = (2 * r + 1);
                    if (f(op(d[r], sm))) {
                        sm = op(d[r], sm);
                        r--;
                    }
                }
                return r + 1 - size;
            }
            sm = op(d[r], sm);
        } while ((r & -r) != r);
        return 0;
    }

  private:
    int _n, size, log;
    std::vector<S> d;

    void update(int k) { d[k] = op(d[2 * k], d[2 * k + 1]); }
};

}  // namespace atcoder

struct F{
    int a = -1;
    int b = -1;
    int ind = -1;
};
F op(F l, F r){
    if (l.a > r.a) return l;
    return r;
}
F e() {
    return F{};
}

void solve();
// CITRUS CURIO CITY / FREDERIC
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
    cin >> t;
    rep(i, 0, t) solve();
}

void solve(){
    int N;
    cin >> N;
    vector<pair<int, int>> p(N * 3);
    rep(i, 0, N * 3) cin >> p[i].first >> p[i].second;
    vector<int> order(N * 3);
    rep(i, 0, N * 3) order[i] = i;
    sort(all(order), [&](int l, int r){
        if (p[l].second != p[r].second) return p[l].second < p[r].second;
        return p[l].first < p[r].first;
    });
    vector<int> inv(N * 3);
    vector<vector<int>> ans(N);
    atcoder::segtree<F, op, e> seg(N * 3);
    rep(i, 0, N * 3){
        int a = order[i];
        inv[a] = i;
        seg.set(i, {p[a].first, p[a].second, a});
    }
    rep(rp, 0, N){
        auto tmp = seg.all_prod();
        seg.set(inv[tmp.ind], e());
        int L = -1, R = N * 3;
        while (R - L > 1){
            int M = (L + R) / 2;
            if (p[order[M]].second < tmp.a) L = M;
            else R = M;
        }
        rep(pp, 0, 2){
            auto tmp2 = seg.prod(R, N * 3);
            if (tmp2.ind == -1){
                cout << "No\n";
                return;
            }
            ans[rp].push_back(tmp2.ind + 1);
            seg.set(inv[tmp2.ind], e());
        }
        ans[rp].push_back(tmp.ind + 1);
    }
    cout << "Yes\n";
    for (auto x : ans) vec_out(x);
}

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

詳細信息

Test #1:

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

input:

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

output:

Yes
5 4 6
2 1 3
No

result:

ok >_< (2 test cases)

Test #2:

score: 0
Accepted
time: 60ms
memory: 3712kb

input:

100000
1
164154503 167959139
178382610 336470888
12298535 642802746
1
165064830 773386884
353585658 396628655
792066242 971207868
1
1607946 2087506
21674839 46761498
9518201 16843338
1
262361007 691952768
190585553 787375312
637191526 693319712
1
41970708 45277106
197619816 762263554
308360206 40724...

output:

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

result:

ok >_< (100000 test cases)

Test #3:

score: 0
Accepted
time: 53ms
memory: 3712kb

input:

50000
2
36364670 641009859
15071436 75475634
20446080 476927808
357784519 503158867
206641725 322595515
268011721 645468307
2
247717926 939887597
808609669 973764525
496738491 710156469
463547010 860350786
757388873 784695957
29903136 208427221
2
26681139 67590963
458238185 475357775
80127817 135993...

output:

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

result:

ok >_< (50000 test cases)

Test #4:

score: 0
Accepted
time: 55ms
memory: 3712kb

input:

33333
3
405068225 524125987
162463453 374288891
493199993 751244358
111234434 232930851
71448581 543529670
158749276 319728747
238956600 582720391
320275833 490702144
111160223 138628383
3
23006185 733781508
636477523 931759705
585852932 723534730
388969099 794937524
153929016 188451996
7487968 1448...

output:

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

result:

ok >_< (33333 test cases)

Test #5:

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

input:

25000
4
387784488 702209411
329025563 673102149
394641352 730593611
244761087 812959730
198875143 469496529
425799311 699021890
715498963 815487777
765027712 857896659
160339866 421876106
477145912 902179526
264824816 783856158
26239891 238642240
4
588094643 962475573
90297216 196513513
234289482 33...

output:

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

result:

ok >_< (25000 test cases)

Test #6:

score: 0
Accepted
time: 60ms
memory: 3712kb

input:

20000
5
255424772 585325539
298257969 412106895
366545795 564718673
426199147 837699009
609084202 690430685
367932561 373282330
488491851 753287868
18693151 79866982
629564684 850348020
7594098 480642952
376090136 930919906
592321264 903492853
345689007 984789430
895853014 909607734
122083425 211655...

output:

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

result:

ok >_< (20000 test cases)

Test #7:

score: 0
Accepted
time: 64ms
memory: 3584kb

input:

16666
6
26845100 58376259
4489038 5887448
307580079 544067926
473165155 712695184
842055718 911364840
851679243 902318577
17646538 250896470
562282480 742028793
60193924 133595743
573222241 649040970
189379234 223207847
301595726 418600362
105036855 417168695
446368438 622701955
89667978 235369723
2...

output:

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

result:

ok >_< (16666 test cases)

Test #8:

score: 0
Accepted
time: 66ms
memory: 3584kb

input:

14285
7
498283426 941492387
435838088 449924898
60069608 378192988
2943111 147499872
449114197 837331700
157821356 576579017
175187302 188696560
119961285 669031820
613970072 826908873
631375408 817438988
79062948 370271596
137867063 638740575
161249104 439482552
40882880 335796176
97823227 25908403...

output:

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

result:

ok >_< (14285 test cases)

Test #9:

score: 0
Accepted
time: 68ms
memory: 3584kb

input:

12500
8
109970553 824608515
38308643 43705451
617662368 652509537
56888590 317463343
17277529 58265855
96899941 250839457
10202459 126496650
221863474 331193631
98584951 255380788
66986639 690869710
118913405 222368048
3832128 8623893
411234159 461796409
101768229 194114590
63466173 137574156
159144...

output:

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

result:

ok >_< (12500 test cases)

Test #10:

score: 0
Accepted
time: 69ms
memory: 3712kb

input:

11111
9
1107549 2691939
298974391 782710197
175975837 631858791
80573957 752268030
44807884 279200011
318005100 630132600
130445116 769329445
230959195 258196658
67434329 538628510
126840838 859267729
426717264 514655989
280881449 523731402
150265596 189142970
138881978 907208811
12171267 161288468
...

output:

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

result:

ok >_< (11111 test cases)

Test #11:

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

input:

10000
10
419583132 802030518
503473132 640274071
29114694 71550121
266502879 799843967
519878600 796619138
109163155 223219513
173801057 312183499
295274161 673542337
569813861 879397647
566104761 631413076
40006012 579868000
45494915 126195703
211345072 535526356
507966667 653535984
868289731 87922...

output:

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

result:

ok >_< (10000 test cases)

Test #12:

score: 0
Accepted
time: 84ms
memory: 3712kb

input:

5000
20
248930144 452405440
28850950 509061481
11675144 16115810
46552920 66743034
250304676 677780684
13100349 208050516
401412088 954478790
27263447 387546138
341164513 641889899
343680066 717802881
119096072 661699500
675285710 759454419
90875780 255743179
294553111 694729965
146519548 862937826
...

output:

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

result:

ok >_< (5000 test cases)

Test #13:

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

input:

2500
40
30078839 43603670
585409830 661220621
47019446 315312595
195376102 450798063
12047273 30038366
6365574 32488330
44528676 63719100
45395244 370843342
42359492 166874404
189032198 330773980
229782995 560521283
338711259 466163339
486437793 995663034
47493303 362533606
574415501 975584927
63051...

output:

Yes
15 13 101
98 111 94
119 59 83
76 87 82
72 2 99
28 97 54
44 39 23
40 26 105
118 112 25
56 89 113
47 62 81
79 33 48
43 46 93
12 90 38
84 50 17
20 85 24
37 110 106
86 58 32
19 104 67
53 115 117
77 52 11
109 78 34
120 4 27
10 71 91
57 70 41
95 69 61
88 55 51
29 49 63
22 35 36
108 64 96
114 16 74
103...

result:

ok >_< (2500 test cases)

Test #14:

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

input:

2000
50
167005 134170081
119263013 235040736
359376356 405102476
368254760 567954026
142560899 351391400
52465572 872095141
5895182 116079799
503946453 935104039
624910603 779623552
407602577 857355273
104834774 642352783
377070248 394389351
7487217 10847154
78697148 403727586
19118138 104520573
302...

output:

No
Yes
93 128 64
41 104 14
61 99 73
120 28 131
29 65 107
35 141 13
50 125 122
30 16 57
97 7 36
126 22 60
87 55 140
48 132 21
31 11 63
17 84 69
40 95 43
8 19 5
83 103 113
25 111 118
89 146 15
108 26 3
123 52 4
1 38 49
116 102 10
136 85 81
53 33 135
75 119 23
51 76 144
6 56 80
91 46 44
34 32 58
47 78 ...

result:

ok >_< (2000 test cases)

Test #15:

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

input:

200
500
240044454 570226789
326748706 906240738
59915230 229227123
25870484 122983289
308323481 491439677
331521117 542348836
79780138 236140577
37215732 400441450
491421004 505626478
41928148 79419397
196402648 681911017
108323645 778854244
168295325 331859787
204653768 764539434
3525633 67848640
2...

output:

Yes
131 724 1088
1440 1297 309
924 944 542
1319 34 1019
1490 313 20
1026 782 1362
194 639 223
1075 1091 177
556 939 1230
387 976 1498
602 861 77
347 244 998
1018 462 787
1104 877 344
312 158 61
100 261 680
900 275 993
28 516 1455
1313 1479 1293
746 211 553
1316 759 440
297 1393 463
711 825 1059
1259...

result:

ok >_< (200 test cases)

Test #16:

score: 0
Accepted
time: 138ms
memory: 4620kb

input:

20
5000
239015031 756662829
107482861 164615679
141286392 176745065
711024070 930641599
203753862 992714840
535460189 890646201
120990575 828015603
80241903 245741385
71064502 937343509
255954224 804090603
241085164 265947390
573467935 767999938
9086606 20283091
44079769 135162900
195630455 72443138...

output:

Yes
2082 12264 7914
13428 461 13621
10482 7229 8470
4971 5958 8165
13898 221 14509
13306 4979 2214
3888 4630 14363
12097 4226 4503
14366 10371 4798
11861 1716 13022
13758 2306 2286
4120 12701 8755
89 2939 1936
1078 3703 4034
2750 7695 4918
13636 5864 6076
12156 6315 9965
5502 14069 14501
11917 10850...

result:

ok >_< (20 test cases)

Test #17:

score: 0
Accepted
time: 155ms
memory: 15188kb

input:

2
50000
134099372 138717692
88497176 203623137
28400878 531963161
491599270 508595246
656123949 690513632
506593350 840717696
75151479 190312317
138082662 708771391
441148125 893057843
452806396 741239078
42068396 78667991
585159549 926735558
695533088 854308946
676238139 709752322
416586658 6449615...

output:

No
No

result:

ok >_< (2 test cases)

Test #18:

score: 0
Accepted
time: 172ms
memory: 26136kb

input:

1
100000
168698075 217141764
51605261 710454586
17380477 789075415
570367 24849107
469495633 685675008
559954719 839804815
332883788 638763480
12087643 327755609
8406881 43827967
108436258 390187172
266381263 301370841
563550486 622696676
204362703 598237196
218501304 232099091
198720699 211987715
7...

output:

Yes
43136 88776 97113
43411 217839 103793
8527 71221 282066
115488 240628 290119
170475 262106 267061
31532 71717 48502
261452 242893 35124
226371 7257 82282
162877 189373 9538
188957 14249 235411
65535 82459 262542
92455 201633 61418
115415 104039 58661
69462 295503 234462
229077 158252 176746
2879...

result:

ok >_< (1 test case)

Test #19:

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

input:

333
300
499999940 500000540
499999880 500000480
499999882 500000482
500000108 500000110
499999706 500000306
500000286 500000288
499999742 500000342
500000500 500000502
499999773 500000373
500000184 500000186
500000090 500000092
500000010 500000012
499999640 500000240
499999830 500000430
499999945 50...

output:

Yes
329 391 769
638 760 303
327 127 83
773 586 458
584 716 16
120 173 828
157 65 452
189 164 693
378 134 896
692 737 881
358 56 214
758 110 118
621 330 224
268 573 489
619 604 699
886 551 85
305 632 236
250 271 474
641 191 708
242 48 545
194 763 531
612 755 704
37 24 225
390 212 300
8 364 269
812 28...

result:

ok >_< (333 test cases)

Test #20:

score: 0
Accepted
time: 133ms
memory: 4620kb

input:

20
5000
500004916 500004918
499994554 500004554
499994653 500004653
500008346 500008348
499990052 500000052
499998337 500008337
499991225 500001225
500008078 500008080
500001210 500001212
500008800 500008802
499992103 500002103
500007998 500008000
500006906 500006908
499994207 500004207
500009454 50...

output:

Yes
8109 8483 843
10730 14720 11137
6445 5305 11435
10137 14768 13424
2926 8407 9992
1920 12126 7740
7776 14089 9490
2136 14434 4846
11107 11824 14274
8884 13711 6414
4278 4024 4175
6412 6295 1851
8010 8649 1644
604 4732 2317
3603 12611 14716
1777 10548 5177
2509 13495 13274
8197 2741 5753
840 7309 ...

result:

ok >_< (20 test cases)

Test #21:

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

input:

10
10000
499997582 500017582
499994226 500014226
499999146 500019146
499986192 500006192
500006688 500006690
500005454 500005456
500012694 500012696
499994423 500014423
500018252 500018254
499984238 500004238
500019624 500019626
500002666 500002668
499981309 500001309
499984412 500004412
499989582 5...

output:

Yes
14571 1040 19658
8414 5333 26210
4305 17034 1123
3660 3919 15983
9154 12496 7729
11146 14366 18752
25959 17784 24324
24018 6126 15487
29393 26218 21634
19344 11089 9856
11474 25171 24292
3640 23995 3635
992 22389 399
376 15957 3715
24658 5792 4362
9834 1182 5590
15491 19812 15115
24386 16273 573...

result:

ok >_< (10 test cases)

Test #22:

score: 0
Accepted
time: 160ms
memory: 26132kb

input:

1
100000
500195974 500195976
499821737 500021737
500032078 500032080
499844833 500044833
500004644 500004646
499896575 500096575
499837203 500037203
500162180 500162182
499803443 500003443
499903390 500103390
499997619 500197619
499983152 500183152
499851444 500051444
500124540 500124542
500090666 5...

output:

Yes
57772 169664 264370
219707 118569 251923
151393 279839 24610
298845 155446 29852
220574 130526 198493
66641 138571 240210
255977 92898 22289
180744 160386 259581
214331 231856 15941
101998 43509 183092
283502 200322 58483
244096 273989 109270
76076 130128 137304
1869 281667 31979
199908 255110 2...

result:

ok >_< (1 test case)

Test #23:

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

input:

333
300
499999677 500000277
499999937 500000537
499999927 500000527
500000186 500000187
500000577 500000580
499999970 500000570
499999688 500000288
499999779 500000379
499999825 500000425
500000503 500000506
499999429 500000029
499999795 500000395
500000251 500000254
499999853 500000453
499999792 50...

output:

No
Yes
28 492 626
652 690 671
313 114 578
353 75 195
158 302 317
260 546 810
31 616 170
275 624 44
663 339 235
874 394 327
886 326 22
778 554 167
622 505 785
701 12 46
820 206 461
746 310 115
633 589 364
93 832 835
35 670 541
243 729 871
248 178 623
184 561 96
144 105 735
299 383 143
739 88 173
355 ...

result:

ok >_< (333 test cases)

Test #24:

score: 0
Accepted
time: 160ms
memory: 26140kb

input:

1
100000
500191010 500191012
499836328 500036328
499951243 500151243
499935598 500135598
499898653 500098653
499956171 500156171
500101528 500101529
499800616 500000616
500107541 500107543
500158180 500158181
499825597 500025597
500175739 500175742
500076543 500076545
499970418 500170418
500014716 5...

output:

Yes
248627 242348 97294
237294 201431 71248
123904 133674 174616
149097 242096 153991
117725 240259 16067
220754 108573 156081
222813 14748 277047
90222 114319 41475
174862 177347 75758
298221 74397 256252
96550 292924 215778
67888 72648 29986
173982 245235 154406
67736 159782 184686
271735 49437 23...

result:

ok >_< (1 test case)

Extra Test:

score: 0
Extra Test Passed