QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#180036#6416. Classical Scheduling ProblemjackwasAC ✓5824ms19336kbC++145.8kb2023-09-15 14:52:282023-09-15 14:52:29

Judging History

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

  • [2023-09-15 14:52:29]
  • 评测
  • 测评结果:AC
  • 用时:5824ms
  • 内存:19336kb
  • [2023-09-15 14:52:28]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define pb push_back
#define el << '\n'
#define spe << ' '
#define sp spe <<
#define umap unordered_map
#define uset unordered_set
#define prqu priority_queue
#define fornr(i, j, n) for (int i = j; i < n; i++)
#define forn(i, n) for (int i = 0; i < n; i++)
#define forn1(i, n) for (int i = 1; i <= n; i++)
#define fornrb(i, j, n) for (int i = n - 1; i >= j; i--)
#define fornb(i, n) for (int i = n - 1; i >= 0; i--)
#define forn1b(i, n) for (i = n; i > 0; i--)
#define fornn(i, n) for (int i = 1; i <= n; i++)
#define rety cout << "YES\n"; return 0;
#define retn cout << "NO\n"; return 0;
#define conty cout << "YES\n"; continue;
#define contn cout << "NO\n"; continue;
#define all(x) x.begin(), x.end()
#define mp make_pair
#define pb push_back
const int IMX = 2e9 + 5;
const ll LMX = 4e18 + 10, MOD = 1e9 + 7, MOD2 = 998244353;

const int MAXN = 2e5 + 5;

int n, b[MAXN];
ll t, a[MAXN];

int sorted[MAXN];

struct cmp {
    bool operator() (int _a, int _b) {
        if (a[_a] != a[_b]) return a[_a] > a[_b];
        return _a > _b;
        // return b[_a] > b[_b];
    }
};

struct rev {
    bool operator() (int _a, int _b) {
        if (a[_a] != a[_b]) return a[_a] < a[_b];
        return _a > _b;
        // return b[_a] > b[_b];
    }
};

int test(int k) {
    set<int, cmp> sk, sm;
    set<int, rev> st;
    ll sum = 0;
    for (int i = 0; i < n; i++) st.insert(i);
    //forn(i, n) st.insert(i);  // put everything into st;
    int idx = 0;

    assert(st.size() == n);
    assert(sk.empty());
    assert(sm.empty());
    //assert((sm.size() + st.size() + sk.size() == n) && "someting wrong");
    for (int m = k; m <= n; m++) {

        if (idx == n) break;
        for (; idx < n && b[sorted[idx]] <= m; idx++) {
            ll cur = sorted[idx];
            sk.insert(cur);
            sum += a[cur];
            
            set<int, cmp>::iterator it = sm.find(cur);
            if (it != sm.end()) {
                sm.erase(cur); // sm.erase(it);
                sum -= a[cur];
            } else {
                st.erase(cur);
            }
        }

        while (sk.size() > k) {
            int cur = *(sk.begin());
            sk.erase(cur); // sk.erase(sk.begin());
            st.insert(cur);
            sum -= a[cur];
        }
        while (sm.size() < (m - k)) {
            if (st.empty()) {
                //cout << k sp m sp sm.size() sp sk.size() sp n el;
                break;
            }
            // assert(!st.empty() && "st.empty() expectedly");
            int cur = *(st.begin());
            sum += a[cur];  // SEGTERM
            sm.insert(cur); // sm.insert(*(st.begin()));
            st.erase(cur);
        }

        // while (sk.size() > k) {
        //     int cur = *(sk.begin());
        //     sk.erase(cur); // sk.erase(sk.begin());
        //     sm.insert(cur);
        // }
        // while (sm.size() > (m - k)) {
        //     int cur = *(sm.begin());
        //     sum -= a[cur];
        //     sm.erase(cur); // sm.erase(sm.begin());
        //     st.insert(cur);
        // }

        // while (sm.size() < (m - k)) {
        //     if (st.empty()) {
        //         //cout << k sp m sp sm.size() sp sk.size() sp n el;
        //         break;
        //     }
        //     // assert(!st.empty() && "st.empty() expectedly");
        //     int cur = *(st.begin());
        //     sum += a[cur];  // SEGTERM
        //     sm.insert(cur); // sm.insert(*(st.begin()));
        //     st.erase(cur);
        // }

        while (!st.empty() && !sm.empty() && a[*st.begin()] < a[*sm.begin()]) {
            // swap
            int sm1 = *(sm.begin());
            int st1 = *(st.begin());
            sum -= a[sm1];
            sum += a[st1];
            sm.erase(sm1); // sm.erase(sm.begin());
            st.erase(st1); // st.erase(st.begin());
            sm.insert(st1);
            st.insert(sm1);
        }
        if (sk.size() == k && sum <= t) {
            assert(sm.size() == (m - k) && "sm.size() wrong");
            return m;
        }
    }
    return 0;
}

vector<ll> ret;

void getSolution(ll k, ll m) {
    set<int, cmp> sk, sm;
    forn(i, n) {
        if (b[i] <= m) sk.insert(i);
        else sm.insert(i);
    }
    while (sk.size() > k) {
        int cur = *sk.begin();
        sk.erase(sk.begin());
        sm.insert(cur);
    }
    while (sm.size() > (m - k)) {
        sm.erase(sm.begin());
    }
    while (!sm.empty()) {
        ret.pb((*sm.begin()) + 1);
        sm.erase(sm.begin());
    }
    while (!sk.empty()) {
        ret.pb((*sk.begin()) + 1);
        sk.erase(sk.begin());
    }
}

bool comp(ll _a, ll _b) {
    if (b[_a] != b[_b]) return b[_a] < b[_b];
    return a[_a] < a[_b];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int q;
    cin >> q;
    while(q--) {
        cin >> n >> t;
        forn(i, n) {
            cin >> a[i] >> b[i];
            sorted[i] = i;
        }
        sort(sorted, sorted + n, comp);
        int l = 0, r = n;
        vector<ll> vsaved(n + 1);
        while (l < r) {
            ll k = (l + r + 1) / 2, m = test(k);
            if (m) {
                l = k;
                vsaved[k] = m;
            }
            else r = k - 1;
        }
        cout << l el << vsaved[l] el;
        ret.clear();
        if (vsaved[l] > 0) {
            getSolution(l, vsaved[l]);
            assert(ret.size() == vsaved[l] && "getSolution wrong");
            sort(ret.begin(), ret.end());
            forn(i, vsaved[l] - 1) cout << ret[i] spe;
            cout << ret[vsaved[l] - 1] el;
        }
    }
    return 0;
}

详细

Test #1:

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

input:

2
4 100
20 1
40 4
60 3
30 3
1 5
10 1

output:

2
3
1 2 4
0
0

result:

ok ok, 2 test cases (2 test cases)

Test #2:

score: 0
Accepted
time: 234ms
memory: 5548kb

input:

10000
21 1892
174 13
604 15
170 2
413 11
899 2
531 12
651 17
553 9
429 8
837 14
937 12
577 7
532 11
19 2
173 10
165 6
762 15
221 6
945 13
302 19
7 3
54 26066
812 31
432 24
240 37
171 39
204 47
174 30
569 1
467 5
624 42
734 35
907 3
568 23
802 40
991 32
119 13
187 27
739 42
891 14
550 44
374 16
483 1...

output:

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

result:

ok ok, 10000 test cases (10000 test cases)

Test #3:

score: 0
Accepted
time: 237ms
memory: 5648kb

input:

10000
31 13863446
88657 7
999554 9
118529 26
847277 28
370661 19
261018 28
635679 10
228483 3
645280 9
476021 13
778546 23
325779 9
833392 1
328146 30
873417 6
327100 31
9792 26
327533 31
361518 30
74201 17
220223 12
395716 28
92721 14
296968 27
177176 14
698707 6
130653 14
639654 14
883578 27
94779...

output:

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

result:

ok ok, 10000 test cases (10000 test cases)

Test #4:

score: 0
Accepted
time: 229ms
memory: 3508kb

input:

10000
1 148649924
152343597 1
23 2873231053
341227727 2
97244309 22
382344096 18
92079917 18
716353906 4
963429195 14
131618841 1
637584871 10
210001357 11
578579097 4
246465963 6
968391199 2
950133297 8
509339869 18
427327942 11
542440792 6
451945776 11
62800058 4
275583515 14
347078482 12
49062133...

output:

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

result:

ok ok, 10000 test cases (10000 test cases)

Test #5:

score: 0
Accepted
time: 489ms
memory: 5676kb

input:

1000
82 7692098567
820091633 60
355742811 58
33274857 31
608429291 33
997797811 20
467502732 30
853286378 8
652795874 46
342018780 22
758395270 23
273397259 44
363579524 49
911951022 78
19637469 55
648691248 73
289596934 53
538807472 31
612554087 13
925583232 12
934115550 2
348467623 19
793103161 30...

output:

22
31
3 6 9 14 17 18 21 23 24 30 33 36 38 39 41 44 46 48 50 55 56 59 65 69 70 72 73 76 78 79 81
333
336
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 34 35 36 37 38 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 7...

result:

ok ok, 1000 test cases (1000 test cases)

Test #6:

score: 0
Accepted
time: 995ms
memory: 4284kb

input:

100
1903 595649261976
242016788 1493
744829262 608
858593044 1816
156659209 1534
114991300 737
762579703 695
727190226 706
259042985 1281
43413203 314
845442517 462
566008000 1873
396423639 557
642518388 234
224641323 1517
952294191 985
706509300 1598
600896534 1474
40659577 676
385404080 236
626269...

output:

1277
1425
1 2 4 5 6 7 8 9 10 12 13 14 18 19 20 21 22 23 24 25 27 28 30 31 32 33 34 35 36 37 38 39 42 43 45 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 66 67 68 70 71 72 74 78 79 80 81 82 83 84 85 89 90 91 92 93 94 95 98 100 101 102 103 104 106 109 110 111 112 113 114 115 116 118 119 121...

result:

ok ok, 100 test cases (100 test cases)

Test #7:

score: 0
Accepted
time: 2150ms
memory: 7132kb

input:

10
44263 8178145065835
144776695 4988
633784692 681
124897155 10140
486257408 37126
851769386 39526
842969054 41273
255566344 35680
453250390 22330
451088941 12204
619362016 38143
532744479 19473
674895021 28375
9336149 42718
66645534 4600
788583869 43466
74789962 44203
394416695 18040
400692349 209...

output:

18932
24297
1 2 3 7 8 9 11 13 14 16 17 18 22 24 26 28 30 35 36 38 39 41 42 44 45 51 54 56 58 61 63 65 71 73 74 76 77 78 79 80 81 82 83 85 87 90 91 92 94 96 101 102 107 109 111 112 113 114 115 117 121 122 123 125 127 129 132 134 135 137 138 142 144 145 147 148 149 150 152 153 154 155 159 160 164 165 ...

result:

ok ok, 10 test cases (10 test cases)

Test #8:

score: 0
Accepted
time: 4784ms
memory: 19292kb

input:

1
200000 57702603292869
895088145 19931
718152698 145634
769081244 195129
55087510 17432
215103308 38922
856865039 8045
427652731 169525
293884192 171894
21414244 46946
623839144 178383
12560296 182397
24930343 41111
35462858 35129
835318852 151986
599094451 25610
510310473 182086
13017134 125354
31...

output:

125582
143872
4 5 6 8 9 11 12 13 15 17 18 19 20 22 23 24 26 28 29 30 31 32 33 34 36 37 38 39 40 41 42 43 44 47 48 49 51 52 58 60 61 62 66 67 69 70 71 72 73 74 76 77 79 80 81 83 84 85 87 88 89 90 92 93 94 95 96 97 98 99 100 102 103 104 105 107 108 110 111 113 114 115 116 117 118 120 121 122 123 125 1...

result:

ok ok, 1 test cases (1 test case)

Test #9:

score: 0
Accepted
time: 4651ms
memory: 17872kb

input:

1
200000 12588150171192
697033205 186664
970477791 19327
89605019 14812
737206044 50478
873649284 20706
932998866 56365
904409119 123817
622032436 43875
690673101 87090
321866772 190284
480046085 18004
398840764 188598
65227144 174007
747187240 89799
347289225 42777
525044511 113973
443965741 85452
...

output:

35303
58673
3 11 13 15 18 21 23 25 29 31 32 35 45 49 56 60 66 70 74 75 77 81 88 89 91 94 95 100 101 102 103 104 105 114 115 116 117 123 126 133 135 140 142 146 148 149 150 159 161 163 164 169 171 172 176 177 179 182 186 199 201 203 204 205 210 216 217 218 220 223 225 226 228 233 234 235 237 238 240 ...

result:

ok ok, 1 test cases (1 test case)

Test #10:

score: 0
Accepted
time: 4551ms
memory: 17856kb

input:

1
200000 10006366792128
443157143 37820
891603781 189849
777301083 136035
751373772 66490
129295230 83820
856462092 153518
90933608 121576
985421539 171766
894499409 15340
504842122 150235
220633943 37522
599038908 146919
95632289 63799
846784841 64938
366209521 142907
786525536 3703
811575655 14202...

output:

29564
51591
1 5 7 11 13 22 24 27 29 31 42 43 52 54 58 60 67 68 74 75 76 77 89 96 99 100 102 104 114 124 125 130 142 146 148 151 159 160 162 163 164 165 167 168 175 182 190 194 195 199 201 203 207 208 209 210 212 213 215 218 219 221 223 240 245 254 256 258 262 263 271 274 276 285 288 298 299 300 303 ...

result:

ok ok, 1 test cases (1 test case)

Test #11:

score: 0
Accepted
time: 5021ms
memory: 19260kb

input:

1
200000 59325562957383
597693992 88976
705975556 136180
769285809 57258
925484458 82502
934515757 179637
34493116 193774
292497126 127847
927349507 123849
421832595 135078
86561264 85994
324999063 89744
343030484 72536
478691338 120886
821844439 48589
559996659 43036
315388256 117624
403103475 1985...

output:

128371
145900
1 2 3 6 7 9 10 11 12 13 14 15 16 18 19 21 22 23 24 25 26 27 28 30 31 32 33 35 36 37 38 40 41 44 46 47 48 50 51 52 53 54 55 57 58 59 60 61 64 65 67 68 69 70 72 73 74 75 76 78 79 81 82 83 84 87 88 89 90 91 92 93 94 97 98 101 105 106 108 109 110 111 112 115 116 117 118 120 121 122 123 125...

result:

ok ok, 1 test cases (1 test case)

Test #12:

score: 0
Accepted
time: 4602ms
memory: 18320kb

input:

1
200000 31416577732624
340512981 172835
292213892 73998
597003807 154289
318028093 98514
699376263 108159
718827833 34030
170900966 125605
621404415 43228
741228044 63328
772056878 189049
376794916 166159
867292793 30857
509371589 34870
262300647 191024
885419246 143166
285220760 7354
455026503 551...

output:

75413
101049
2 4 6 7 8 9 13 16 17 20 23 24 27 28 29 37 39 41 42 44 45 54 56 57 58 59 61 62 64 65 68 70 74 77 80 81 85 88 89 92 94 96 100 101 102 103 104 105 106 107 108 112 114 116 121 122 125 127 128 131 132 135 136 138 139 140 141 142 149 152 154 157 159 161 162 163 164 165 166 167 168 169 171 173...

result:

ok ok, 1 test cases (1 test case)

Test #13:

score: 0
Accepted
time: 4779ms
memory: 19332kb

input:

1
200000 77196200005652
81679500 15479
628507583 44521
548869801 108216
202160806 81822
13811372 171273
182622346 74287
999301204 131876
340742380 195311
535907253 183066
856296272 149001
972508704 18381
165273242 132281
159309262 124662
873186151 141971
205568022 108704
407608325 121275
550726777 7...

output:

160837
171651
1 2 3 4 5 6 8 10 12 13 14 15 16 17 18 19 20 21 23 25 27 28 29 30 31 33 34 35 36 37 38 39 40 41 42 43 44 45 47 49 50 51 53 54 55 56 58 59 60 61 62 64 65 67 68 69 70 71 73 74 77 78 79 81 82 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 111 112 11...

result:

ok ok, 1 test cases (1 test case)

Test #14:

score: 0
Accepted
time: 3491ms
memory: 17556kb

input:

1
200000 1429350937284
526226223 66634
289923614 182339
134908142 29440
973080309 130538
582853772 67091
195951976 147247
137707811 162339
365463069 147394
380937199 144019
634246766 52056
307148783 70603
942004511 57898
3571365 14454
359533636 117110
505575330 33026
877559277 43709
315326693 135586...

output:

6240
16911
13 20 33 36 46 47 56 64 75 78 83 87 96 97 135 140 160 163 166 179 204 220 246 255 258 276 279 285 286 304 320 351 352 361 369 371 392 425 426 437 482 500 502 505 508 528 544 573 589 623 640 667 679 683 687 692 697 699 701 723 766 785 805 826 842 857 868 872 879 885 886 924 925 931 941 976...

result:

ok ok, 1 test cases (1 test case)

Test #15:

score: 0
Accepted
time: 5357ms
memory: 18244kb

input:

1
200000 39468068349617
969120466 150494
24726062 152861
521763411 159175
558919972 113846
111536151 195612
168882091 11695
701218828 135906
443830562 75285
737929800 63757
515973716 179303
214070560 147017
369040750 16219
495454680 95733
311277733 92249
952085762 133155
118363682 124927
505405455 1...

output:

91018
113879
2 4 5 6 8 9 11 12 13 14 16 18 19 24 25 28 29 30 31 34 35 36 37 38 39 40 45 46 50 51 52 54 55 56 58 60 63 64 66 67 69 70 71 72 73 74 75 76 77 80 81 86 87 91 92 93 95 96 99 100 101 102 104 105 106 108 109 110 111 112 114 115 116 120 121 122 126 129 131 132 135 137 138 142 144 151 153 154 ...

result:

ok ok, 1 test cases (1 test case)

Test #16:

score: 0
Accepted
time: 5329ms
memory: 18240kb

input:

1
200000 31680217124307
410362237 1650
769634917 66488
96046721 80398
716530488 129858
253073129 58726
691347343 84656
984801589 166368
217597531 27368
698528858 192007
386379101 82358
959877570 199240
764803504 141836
339991881 152821
433451122 43196
931710433 33285
806690407 14656
444294191 16018
...

output:

75884
100960
1 3 5 6 8 10 14 17 20 21 24 27 33 35 36 39 40 41 42 43 52 53 58 62 63 64 66 69 71 72 73 75 77 79 80 84 87 88 89 90 93 95 96 97 98 103 104 108 115 118 119 121 123 124 125 127 128 130 131 135 138 139 141 143 144 145 146 147 148 149 150 151 153 158 161 162 165 166 167 168 172 174 175 179 1...

result:

ok ok, 1 test cases (1 test case)

Test #17:

score: 0
Accepted
time: 5539ms
memory: 19280kb

input:

1
200000 50189655538839
144918862 85509
874582319 37010
622923939 1621
680745970 178574
362565239 154544
173413093 124912
283423444 107231
626630752 179450
162775379 111745
65593607 18117
954635150 51462
934284433 100157
127117617 42613
431086468 185631
504582560 166119
807664334 161282
542058258 39...

output:

111328
132020
1 3 6 7 9 10 13 17 18 19 20 22 23 25 26 27 28 31 35 36 39 40 41 42 45 48 49 51 52 53 54 55 56 57 59 60 61 62 64 66 69 70 73 74 75 76 78 79 81 83 85 87 88 89 90 91 92 93 95 96 97 102 103 104 105 106 107 109 110 111 112 114 115 116 117 120 121 122 124 126 128 131 133 134 135 138 139 140 ...

result:

ok ok, 1 test cases (1 test case)

Test #18:

score: 0
Accepted
time: 4379ms
memory: 18236kb

input:

1
200000 27981446446585
582855670 103961
141413192 7533
273949246 131356
958444006 161882
431697304 83066
615079319 165168
918652616 113502
177807831 98829
514133749 7290
232048977 178069
876775045 127876
877483551 168877
266897215 132405
894118428 160771
163824546 66248
614407879 51011
300135242 96...

output:

68351
93640
2 5 8 9 10 15 16 19 20 22 23 24 25 26 28 29 30 36 45 46 47 48 49 50 51 52 53 55 56 57 58 60 61 65 66 68 69 72 77 82 84 85 87 88 89 90 91 93 94 99 101 103 105 107 108 109 111 112 113 116 117 118 124 125 126 127 128 129 134 135 136 138 139 143 144 148 153 154 156 162 163 164 165 166 167 16...

result:

ok ok, 1 test cases (1 test case)

Test #19:

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

input:

1
1 1
1 1

output:

1
1
1

result:

ok ok, 1 test cases (1 test case)

Test #20:

score: 0
Accepted
time: 1777ms
memory: 17268kb

input:

1
200000 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...

output:

1
1
1

result:

ok ok, 1 test cases (1 test case)

Test #21:

score: 0
Accepted
time: 2770ms
memory: 17180kb

input:

1
200000 1
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #22:

score: 0
Accepted
time: 1644ms
memory: 17240kb

input:

1
200000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
100...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #23:

score: 0
Accepted
time: 2785ms
memory: 17232kb

input:

1
200000 1
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #24:

score: 0
Accepted
time: 1316ms
memory: 19316kb

input:

1
200000 200000000000000
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...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #25:

score: 0
Accepted
time: 1416ms
memory: 19292kb

input:

1
200000 200000000000000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200000
1 200...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #26:

score: 0
Accepted
time: 1293ms
memory: 19280kb

input:

1
200000 200000000000000
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
1000000000 1
10...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #27:

score: 0
Accepted
time: 1414ms
memory: 19296kb

input:

1
200000 200000000000000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
10000...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #28:

score: 0
Accepted
time: 2791ms
memory: 17256kb

input:

1
200000 100000000000000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
1000000000 200000
10000...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #29:

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

input:

1
10 299
10 2
53 7
83 9
15 3
28 4
47 9
75 2
62 9
23 5
8 4

output:

7
7
1 2 4 5 7 9 10

result:

ok ok, 1 test cases (1 test case)

Test #30:

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

input:

1
1000 1841609
5209 422
7129 618
893 700
8231 647
9844 314
6789 347
3968 711
5864 416
9564 190
7357 874
530 87
7935 754
3475 772
2898 206
9252 717
6604 686
7451 188
9366 977
6294 618
3919 454
8164 232
8617 403
5257 191
8554 626
1727 952
205 759
3312 453
4798 387
7005 774
3570 892
3034 45
5101 466
59...

output:

447
546
1 3 6 8 11 14 17 20 23 25 26 27 28 31 32 33 34 35 37 38 41 43 48 49 50 52 55 56 59 60 61 62 64 66 67 69 70 71 72 73 78 80 82 83 86 87 89 91 93 94 95 96 98 99 102 103 106 107 110 113 114 116 117 118 119 120 121 122 124 126 128 130 131 134 135 136 137 139 140 145 151 153 155 156 158 161 162 16...

result:

ok ok, 1 test cases (1 test case)

Test #31:

score: 0
Accepted
time: 4191ms
memory: 18228kb

input:

1
200000 24577580970703
656715015 199803
956780431 189922
293564365 139627
914941210 61288
941205521 178624
674601481 87247
173334239 146057
362284792 31141
248508805 184184
947672840 51295
400265751 140002
24148576 188821
351568365 57409
787832999 113156
743686688 21173
841349516 186123
902806032 1...

output:

61504
87275
6 7 8 12 13 19 20 22 24 31 33 36 37 39 41 42 43 46 47 48 51 54 57 61 62 64 66 67 68 69 72 73 74 75 80 84 85 89 94 95 96 97 100 102 103 105 106 110 114 116 118 123 124 125 127 128 129 130 132 134 136 138 148 153 156 158 161 163 165 166 167 169 170 171 172 173 178 181 182 183 188 191 193 1...

result:

ok ok, 1 test cases (1 test case)

Test #32:

score: 0
Accepted
time: 5108ms
memory: 17180kb

input:

1
200000 1623
691944610 133408
244110549 35622
820275739 179459
22018946 195637
22760475 51629
637640711 69587
123326171 136444
892528944 106021
356879446 183488
912241290 119398
275436827 84437
453945181 70240
947197540 100566
283979992 64330
473324390 69248
312572302 43326
652302826 107367
1211581...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #33:

score: 0
Accepted
time: 4262ms
memory: 18256kb

input:

1
200000 33514678169931
121677529 31920
777971499 187969
617049720 137098
419390184 75721
955778107 128696
17132807 165192
553423875 166900
689515597 177311
658315212 123015
948476705 37132
651978953 125843
605923663 59539
199020236 165777
475699208 189135
559018475 136876
469474861 91887
376859744 ...

output:

52536
108148
1 4 6 12 13 16 17 19 20 21 24 26 27 29 31 34 37 38 39 40 45 46 47 48 50 51 53 55 65 70 71 72 73 74 75 76 77 79 80 81 82 85 87 88 89 92 93 94 95 97 98 99 101 102 106 108 110 113 114 117 118 120 122 123 124 126 129 130 131 132 133 134 135 137 138 139 140 141 142 145 148 149 152 153 154 15...

result:

ok ok, 1 test cases (1 test case)

Test #34:

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

input:

1
5 455
70 2
90 5
69 3
93 1
98 3

output:

5
5
1 2 3 4 5

result:

ok ok, 1 test cases (1 test case)

Test #35:

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

input:

1
100 23591
888 17
792 51
685 47
182 3
102 61
555 48
771 56
712 1
580 78
342 31
285 33
525 99
537 25
929 18
84 53
104 88
624 55
253 3
201 53
536 95
65 84
540 5
549 52
248 77
677 5
431 50
600 80
328 46
134 29
526 83
500 3
400 63
276 23
570 4
410 57
507 58
984 20
486 44
802 54
985 11
635 3
96 83
855 9...

output:

54
63
2 3 4 5 6 7 8 10 11 13 15 16 17 18 19 21 22 23 25 26 28 29 31 32 33 34 35 36 38 41 42 44 46 49 50 51 52 54 55 58 59 60 61 62 63 67 69 71 74 78 79 80 81 82 85 87 88 90 92 94 95 96 98

result:

ok ok, 1 test cases (1 test case)

Test #36:

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

input:

1
10000 60845880
2292 5988
3420 4026
5243 3246
4223 41
682 468
1497 5008
1573 584
5848 7049
5555 4129
9311 9957
6065 7225
3569 9498
717 1695
9690 1968
8700 7557
5142 9427
8788 371
9576 2260
4322 2674
5829 7448
982 9123
438 7591
9459 1590
5002 5982
4144 243
9585 4254
6745 9988
9602 3691
9518 2297
981...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #37:

score: 0
Accepted
time: 2555ms
memory: 19336kb

input:

1
200000 196479508615078
28295282 200000
911267508 200000
236024810 200000
513346768 200000
741720858 200000
685888445 200000
495085242 200000
953023631 200000
348674792 200000
523272031 200000
459044409 200000
210045061 200000
88248849 200000
259363079 200000
418405428 200000
100223051 200000
93933...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #38:

score: 0
Accepted
time: 5358ms
memory: 19316kb

input:

1
200000 135707572511546
494679362 71529
380066098 40582
143567817 95803
319571661 41447
140442890 109991
585350811 68216
440239975 61921
37969390 100431
367093317 172161
544275807 38054
156617869 107523
391904071 32538
621381932 113096
385142855 166446
176514963 101396
26497984 84041
930946615 1459...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #39:

score: 0
Accepted
time: 5530ms
memory: 19280kb

input:

1
200000 161950750594970
793492620 20373
359415351 102763
18563992 141876
540505816 25435
519736034 181469
228183605 27960
807434490 121058
171474009 172540
535491335 19719
691339555 102294
376758082 22597
119250632 74217
629443449 23304
263632975 158603
944034189 1266
870807571 2823
341748724 89430...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #40:

score: 0
Accepted
time: 5090ms
memory: 19320kb

input:

1
200000 188193928678394
532497366 169218
193540413 99537
748335976 20653
171505380 42127
193996474 85651
165983695 155000
324372109 90595
159754435 20457
408922057 124173
838403304 199239
746641400 3079
141564489 148600
342537670 133513
582314583 40360
856777607 101136
569892967 113094
752550833 65...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #41:

score: 0
Accepted
time: 4138ms
memory: 17880kb

input:

1
200000 14432811794522
126277919 118062
172889666 129014
623332151 123621
392439535 193411
868256913 22538
958559593 90551
691566624 117029
443002158 68374
577320075 171732
130691244 39288
261748909 126665
163878346 190280
55631891 52233
165837408 65221
329329537 1006
119235258 23364
308577134 1762...

output:

39637
64015
1 2 10 12 13 14 15 16 20 24 27 28 30 31 32 33 44 45 48 55 56 59 61 63 64 66 70 71 78 85 89 98 99 101 102 103 106 107 115 116 121 122 124 127 129 130 132 133 139 143 146 152 153 154 160 161 164 167 173 175 176 178 179 182 184 187 191 192 195 197 198 202 209 210 213 216 224 225 235 241 247...

result:

ok ok, 1 test cases (1 test case)

Test #42:

score: 0
Accepted
time: 4396ms
memory: 18168kb

input:

1
200000 40671694910650
865282665 66906
152238920 15388
58136838 169694
613373691 177399
542517353 94016
601392388 17591
913536947 86566
871474072 148996
745718094 51994
982787697 136233
776856418 74442
891224907 88855
63693408 162441
189551720 81570
391816059 11277
963544845 76738
424411946 152431
...

output:

93719
116281
2 3 5 6 9 11 13 14 15 21 22 26 33 36 37 39 41 42 43 45 46 47 48 53 54 55 59 61 62 63 64 67 71 72 73 74 75 76 77 80 82 83 84 85 86 88 89 90 91 92 96 97 99 101 102 103 104 105 106 109 110 115 116 117 118 121 123 124 125 128 130 132 134 135 136 139 144 146 147 148 149 151 153 154 157 158 1...

result:

ok ok, 1 test cases (1 test case)

Test #43:

score: 0
Accepted
time: 4710ms
memory: 19284kb

input:

1
200000 66919167961370
164095923 183047
281331278 44866
82876118 48471
539340550 194091
216777792 198198
539192478 10039
135507270 112999
154721794 196913
619148816 123744
129851445 33178
586931224 22220
913538764 130534
776787630 72649
363009136 139135
304559478 111147
807854432 19713
540246759 95...

output:

142487
157397
1 2 3 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 23 24 25 26 27 28 29 30 31 32 34 37 38 40 41 42 44 45 46 47 48 49 50 51 52 53 55 56 58 60 61 62 63 64 65 66 67 68 70 73 76 77 78 79 80 81 82 83 84 85 86 87 88 90 91 93 94 96 97 99 100 101 102 103 104 105 106 108 109 110 111 112 113 114 1...

result:

ok ok, 1 test cases (1 test case)

Test #44:

score: 0
Accepted
time: 4045ms
memory: 19280kb

input:

1
200000 93158051077498
462909180 107699
260680531 107047
662904997 118736
760274706 145375
596070936 135084
771959864 137078
502701786 82536
288226413 69022
492579538 171302
422139386 105930
956814541 145806
935852621 37621
194914555 191370
386723449 163996
72078704 11017
917005235 105791
96273060 ...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #45:

score: 0
Accepted
time: 4535ms
memory: 19304kb

input:

1
200000 119401229160922
201913926 56544
94805593 136525
392676980 30217
981208861 162067
125107184 6563
414792658 72630
724672109 108970
276506839 116939
660977556 75757
569203134 170171
471922050 126288
368231886 79301
202976072 134282
410437761 13049
839597930 110888
761314822 183358
507075169 15...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #46:

score: 0
Accepted
time: 4857ms
memory: 19300kb

input:

1
200000 145644407244346
795694480 5388
74154846 198707
562640451 108993
907175721 146055
799367623 110745
352592749 199670
91866624 111211
704978754 164856
534408278 123315
716266883 10220
987029559 41361
535769935 153684
916070293 44490
288927881 37910
752341348 178054
310657113 69436
622909981 19...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #47:

score: 0
Accepted
time: 4352ms
memory: 19296kb

input:

1
200000 70911083548450
803317251 75107
716223859 91630
836314626 44291
950150561 11320
159203924 64308
417716260 8836
730647129 115695
30845928 90055
195585834 108993
899509967 67400
485422609 168141
703377963 82018
186329868 39752
538996040 28550
549807438 31612
111637472 136119
686751167 145605
2...

output:

149582
162664
1 2 3 5 6 7 8 9 10 12 13 14 15 16 17 18 21 22 24 25 27 28 30 31 32 33 34 36 37 38 39 40 41 42 44 45 46 48 50 51 52 53 54 55 56 58 59 60 61 62 63 64 65 66 67 68 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 94 95 97 98 99 100 101 102 103 105 106 107 108 109 110 11...

result:

ok ok, 1 test cases (1 test case)

Test #48:

score: 0
Accepted
time: 5044ms
memory: 17272kb

input:

1
200000 11360
913315249 43565
482085213 37293
624340207 36798
745451871 183459
676955650 133760
364482503 43870
969041965 117574
679238595 95441
151880822 56729
548261894 140810
849277252 170062
755114771 116498
89493571 78714
574692282 88032
221846155 195147
806241251 109535
594765056 2956
4951136...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #49:

score: 0
Accepted
time: 5523ms
memory: 17044kb

input:

1
200000 22057
817744879 522
279910080 20466
720059878 51052
578147780 126966
614108988 3870
771342312 5819
241067400 173391
814757759 176733
320724054 18903
506690710 73674
744091010 23797
277893485 65103
351251657 147112
526756898 140587
305596060 50683
380433327 66459
744620599 61420
832194582 11...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #50:

score: 0
Accepted
time: 5351ms
memory: 17272kb

input:

1
200000 41991
185376951 32853
525753515 139495
714258535 160467
32235492 22387
736714032 129895
579085796 93386
238420038 52863
594584767 143769
868407430 29936
97019056 10203
100734210 26736
726872636 166566
986851260 91051
968537240 196451
700028592 182836
127512647 145357
647382295 47550
2624619...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #51:

score: 0
Accepted
time: 5426ms
memory: 17240kb

input:

1
200000 278761
270401298 116411
803977226 82172
925001500 117672
771348781 120446
445917696 41946
906589065 166103
877658779 2490
451343889 142015
897365148 38230
367773917 133006
908215418 150765
933052481 172079
957470887 100667
100844316 92515
685491717 115743
568787565 172881
392298393 150629
3...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #52:

score: 0
Accepted
time: 5327ms
memory: 17236kb

input:

1
200000 875961
477330789 143280
566368964 197380
409118948 104462
602792093 179489
67207345 199011
412135470 99361
664050053 158528
117732825 192271
220877150 164719
900923064 53370
426114744 93801
368468210 98293
306700026 111404
353883983 133878
547444275 46604
600050701 199862
288884741 155793
2...

output:

0
0

result:

ok ok, 1 test cases (1 test case)

Test #53:

score: 0
Accepted
time: 5824ms
memory: 17316kb

input:

1
200000 26989091
142491241 192440
133740164 91209
140503616 64618
624125392 3911
570737552 64257
358765959 49878
973592203 67220
434759007 57616
688893781 32485
342883108 191785
761605150 20824
398726892 73615
933133938 168688
660201614 66145
664162255 35715
957044820 24229
856874359 52925
21445707...

output:

2
71
3874 4447 16401 17212 18984 19566 22273 29495 29563 33508 36830 37074 39245 39467 52816 53809 60168 69433 73184 78040 78418 78575 79027 81878 82591 88688 90076 91914 92082 92507 96962 99317 99477 101051 102329 102471 104368 104628 107175 108081 110831 112816 117944 120823 121203 122165 128135 1...

result:

ok ok, 1 test cases (1 test case)

Test #54:

score: 0
Accepted
time: 5487ms
memory: 17008kb

input:

1
200000 2307468389
368690769 79954
301310184 62051
799462027 128213
666250281 127024
204339284 108604
432905504 36943
98301318 81947
255928495 80585
936711119 86165
166997880 45889
949890962 172040
59538778 29696
837571343 96453
491176763 79720
299019200 17687
982845704 121709
547159046 179950
7833...

output:

51
658
185 373 501 875 972 1036 1232 1349 2147 2871 4402 4500 4593 4734 4935 5124 5386 5420 6754 6969 8313 9707 9820 10242 10446 11418 11692 11757 11845 11871 12148 12588 12883 13333 13822 14493 14732 14820 14913 14991 15094 15159 15221 15427 15600 16020 16270 16280 16295 16658 16804 17124 17323 176...

result:

ok ok, 1 test cases (1 test case)

Test #55:

score: 0
Accepted
time: 4604ms
memory: 17316kb

input:

1
200000 1114224814709
346611495 35774
763677620 44175
107970730 121372
592886991 116342
89606402 175383
247300880 128149
785251923 14933
352476948 127625
87806404 59621
798814088 28830
796402602 157465
758904303 68951
804510694 92819
488083874 25744
896820362 169155
646066968 178846
202555586 18456...

output:

4863
14586
22 30 54 58 61 67 74 80 124 136 138 147 152 160 162 166 178 185 217 219 230 243 271 273 279 291 295 301 323 325 332 347 363 372 379 393 407 408 409 452 469 471 485 506 512 528 531 543 547 549 604 620 627 628 631 640 652 658 668 689 701 703 715 722 749 761 762 766 834 838 842 859 863 868 8...

result:

ok ok, 1 test cases (1 test case)

Test #56:

score: 0
Accepted
time: 4476ms
memory: 17616kb

input:

1
200000 1761362182256
503223959 171153
215525286 7256
469093377 63904
782919806 155261
497124834 37241
699484821 54263
523186287 149133
435528064 186763
650356977 19300
2967414 115966
881081068 163860
856142098 139427
354956675 105996
635095895 51036
335875866 33481
340424181 32273
113478973 60107
...

output:

6602
19253
2 10 28 36 44 50 56 68 72 74 80 92 96 118 127 144 148 162 174 205 236 242 252 273 285 318 321 324 329 331 335 352 379 388 403 406 417 424 432 440 441 444 454 463 468 476 511 512 524 527 529 534 535 537 554 565 577 579 584 590 596 603 645 659 665 672 688 708 712 721 737 747 801 805 807 817...

result:

ok ok, 1 test cases (1 test case)

Test #57:

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

input:

1
200000 7695007124066
935103045 188716
189579994 105773
948721909 41728
645118111 109034
957534856 110290
889194851 104306
420203907 62914
66581709 183967
255985718 131452
514694498 55823
401590830 62014
597257496 105222
979588845 117646
516799272 67038
195365852 161807
223068968 114544
870882688 6...

output:

19856
43216
8 18 46 61 66 72 73 77 93 95 96 109 115 118 133 137 142 145 160 171 173 179 180 181 184 185 198 199 202 204 211 219 224 236 239 243 247 250 257 261 263 264 267 268 270 281 282 284 287 299 300 303 307 308 323 327 329 331 332 334 336 350 352 362 365 369 373 374 380 385 387 389 406 407 418 ...

result:

ok ok, 1 test cases (1 test case)

Test #58:

score: 0
Accepted
time: 4424ms
memory: 18216kb

input:

1
200000 33495073817765
454980889 51436
94554428 191084
104734346 199599
863177547 110765
854565444 158490
142159530 144841
47845415 163698
449215542 195047
40270172 157069
901593599 106755
420673009 66212
277396723 119994
719153064 130192
440107995 1948
29522955 154337
206042507 40606
711612356 203...

output:

52632
108588
1 2 3 6 7 9 11 12 14 15 16 17 21 24 25 26 29 30 31 32 33 36 37 39 40 41 47 50 51 53 54 58 59 61 64 76 79 82 83 84 85 87 88 91 92 93 96 98 99 100 103 105 106 107 109 120 122 127 128 130 131 133 134 135 137 138 139 140 141 142 144 146 148 149 151 152 155 156 159 160 162 164 165 166 167 17...

result:

ok ok, 1 test cases (1 test case)

Test #59:

score: 0
Accepted
time: 4536ms
memory: 18320kb

input:

1
200000 33248633143054
379350144 43429
543594548 12331
359652193 173215
877003263 157474
485706837 3469
513776846 146166
682619899 63950
862848600 66703
489876630 187591
44325485 133236
999368520 108311
82125642 168467
248115839 132600
188411182 98732
489732526 139650
929253677 155278
202430528 119...

output:

51949
108653
1 2 3 5 7 10 12 13 14 17 19 20 21 22 23 24 26 31 32 36 37 39 41 42 45 46 51 52 53 54 61 65 68 69 71 72 73 74 80 81 83 84 86 87 90 91 93 94 95 98 99 100 102 105 106 107 109 110 112 113 115 116 118 119 120 122 123 124 125 127 130 132 133 134 135 136 139 140 141 144 145 146 147 148 152 154...

result:

ok ok, 1 test cases (1 test case)

Test #60:

score: 0
Accepted
time: 3970ms
memory: 17832kb

input:

1
200000 7840004973944
272179144 63395
739529760 57242
991181645 156702
926915784 131396
674683907 121506
488044461 140657
440568399 155556
766599873 133660
932517959 20473
862692698 68290
584213348 101064
440083200 28562
660632950 55534
114251144 137570
459542743 195446
67618913 101913
246107619 66...

output:

20003
43569
12 14 16 18 30 31 41 46 52 56 59 61 63 65 67 69 76 77 95 100 108 117 121 123 143 156 167 179 180 192 198 201 207 208 209 213 220 223 224 227 228 233 236 237 239 241 244 249 251 253 254 257 264 271 273 278 279 283 287 294 297 298 300 303 306 309 312 325 336 337 338 344 345 348 350 358 361...

result:

ok ok, 1 test cases (1 test case)

Test #61:

score: 0
Accepted
time: 4693ms
memory: 19280kb

input:

1
200000 69378166199815
692028815 153591
329100409 178473
499445063 196668
787295778 166812
371331886 162029
732938525 48366
400756611 175483
559678110 150415
627194489 127242
252052361 94399
215724348 48136
964771603 187204
799581494 169751
521922473 185738
640770445 156133
781067280 182599
3081945...

output:

82224
164357
1 2 3 5 6 7 8 9 10 11 14 15 17 18 19 20 21 22 24 25 26 27 29 30 35 37 38 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 61 63 64 66 67 68 69 70 71 72 73 74 75 76 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 1...

result:

ok ok, 1 test cases (1 test case)

Test #62:

score: 0
Accepted
time: 4826ms
memory: 19292kb

input:

1
200000 88847647606645
224827254 180718
548127243 187454
142965123 197147
476186922 172169
633291203 198183
927788453 182480
99455134 196100
164023873 194878
44863563 197078
586600515 199405
742908549 192478
634451018 194422
400819069 180491
143142488 181228
54304786 130904
990096689 184091
1278528...

output:

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

result:

ok ok, 1 test cases (1 test case)

Test #63:

score: 0
Accepted
time: 3046ms
memory: 19264kb

input:

1
200000 105532502563483
191875168 199999
151276607 199999
780146920 200000
551353217 200000
402552682 200000
244198364 199999
931903113 199999
839940757 199999
804822642 200000
357392986 200000
330756728 199999
776374531 199999
282527199 199999
999817849 199999
570233335 199999
404177654 199999
574...

output:

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

result:

ok ok, 1 test cases (1 test case)