QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#487148#6416. Classical Scheduling Problemucup-team1525#AC ✓583ms103876kbC++203.6kb2024-07-22 16:56:582024-07-22 16:56:58

Judging History

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

  • [2024-07-22 16:56:58]
  • 评测
  • 测评结果:AC
  • 用时:583ms
  • 内存:103876kb
  • [2024-07-22 16:56:58]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int T,n;
const int N=2000005;
#define ll long long
ll m;
int a[N],b[N],rk[N],rk2[N],cnt;
struct node
{
    int ls,rs,sz;
    ll v;
}t[N*30];
bool cmp(int x,int y)
{
    return b[x]<b[y];
}
bool cmpa(int x,int y)
{
    return a[x]==a[y]?b[x]<b[y]:a[x]<a[y];
}
void insert(int x,int l,int r,int p)
{
    t[x].sz++;
    t[x].v+=p;
    if (l==r)
        return;
    int mid=(l+r)/2;
    if (p<=mid)
    {
        if (!t[x].ls)
            t[x].ls=++cnt;
        insert(t[x].ls,l,mid,p);
    }
    else
    {
        if (!t[x].rs)
            t[x].rs=++cnt;
        insert(t[x].rs,mid+1,r,p);
    }
}
ll ask(int x,int l,int r,int p)
{
    if (!x)
        return 0;
    if (l==r)
        return (ll)p*l;
    int mid=(l+r)/2;
    if (t[t[x].ls].sz>=p)
        return ask(t[x].ls,l,mid,p);
    else
        return ask(t[x].rs,mid+1,r,p-t[t[x].ls].sz)+t[t[x].ls].v;
}
pair<int,ll> ask2(int x,int l,int r,int p)
{
    if (!x)
        return make_pair(0,0);
    if (r<=p)
        return make_pair(t[x].sz,t[x].v);
    int mid=(l+r)/2;
    if (p<=mid)
        return ask2(t[x].ls,l,mid,p);
    pair<int,ll> tmp=ask2(t[x].rs,mid+1,r,p);
    return make_pair(tmp.first+t[t[x].ls].sz,tmp.second+t[t[x].ls].v);
}
ll psum[N];
pair<int,ll> g[N];
int posofrk2[N];
void ins(int x,int y)
{
    for (int i=x;i<=n;i+=i&(-i))
    {
        g[i].first++;
        g[i].second+=y;
    }
    // for (;x<=n;x+=x&(-x))
    //     ++g[x];
}
pair<int,ll> chk(int x)
{
    pair<int,ll> ans={0,0};
    // int ans=0;
    for (;x;x-=x&(-x))
        // ans+=g[x];
    {
        ans.first+=g[x].first;
        ans.second+=g[x].second;
    }
    return ans;
}
vector<int> v[N];
void solve()
{
    scanf("%d%lld",&n,&m);
    int mx=1;
    for (int i=1;i<=n;++i){
        v[i].clear();
        g[i]={0,0};
    }
    for (int i=1;i<=n;++i)
    {
        scanf("%d%d",&a[i],&b[i]);
        v[b[i]].push_back(i);
        mx=max(mx,a[i]);
        rk[i]=i;
        rk2[i]=i;
    }
    sort(rk+1,rk+1+n,cmp);
    sort(rk2+1,rk2+1+n,cmpa);
    for (int i=1;i<=n;++i)
        psum[i]=psum[i-1]+a[rk2[i]];
    for (int i=1;i<=n;++i)
        posofrk2[rk2[i]]=i;
    for (int x=1;x<=cnt;++x)
        t[x].ls=t[x].rs=t[x].v=t[x].sz=0;
    cnt=1;
    int mxp=0,mxsum=0,mxq=0;
    for (int p=1;p<=n;++p)
    {
        for (int i:v[p])
        {
            insert(1,1,mx,a[i]);
            ins(posofrk2[i],a[i]);
        }
        if (psum[p]>m)
            break;
        int l=0,r=p;
        while (l<=r)
        {
            int mid=(l+r)/2;
            // ll ressum=m-psum[mid];
            auto q=chk(mid);
            if (t[1].sz+mid-q.first>=p)
            {
                ll o=ask(1,1,mx,p-mid+q.first);
                if (o+psum[mid]-q.second<=m)
                    r=mid-1;
                else
                    l=mid+1;
            }
            else
                l=mid+1;
        }
        int tmp=p-(l-chk(l).first);
        if (tmp>mxsum)
        {
            mxp=p;
            mxsum=tmp;
            mxq=l;
        }
    }
    if (mxp==0)
    {
        puts("0");
        puts("0");
        puts("");
    }
    else
    {
        printf("%d\n",mxsum);
        printf("%d\n",mxp);
        int k=mxp;
        for (int i=1;i<=n&&k;++i)
            if (i<=mxq||b[rk2[i]]<=mxp)
            {
                --k;
                printf("%d ",rk2[i]);
            }
        puts("");
    }
}
int main()
{
    scanf("%d",&T);
    while (T--)
    {
        solve();
    }
    return 0;
}

詳細信息

Test #1:

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

input:

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

output:

2
3
1 4 2 
0
0


result:

ok ok, 2 test cases (2 test cases)

Test #2:

score: 0
Accepted
time: 72ms
memory: 18144kb

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

result:

ok ok, 10000 test cases (10000 test cases)

Test #3:

score: 0
Accepted
time: 103ms
memory: 18264kb

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

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

result:

ok ok, 10000 test cases (10000 test cases)

Test #4:

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

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

0
0

8
8
8 3 4 1 9 7 6 2 
9
11
21 18 16 11 9 24 10 12 26 4 15 
12
12
8 ...

result:

ok ok, 10000 test cases (10000 test cases)

Test #5:

score: 0
Accepted
time: 166ms
memory: 16756kb

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
14 81 3 44 48 50 70 55 69 59 56 30 78 36 46 33 76 41 79 39 9 21 38 24 73 6 72 17 65 23 18 
333
336
209 291 121 124 245 155 159 179 200 57 251 132 163 284 119 69 105 268 25 260 206 300 207 117 228 304 127 14 44 281 214 233 108 311 263 294 232 205 59 168 279 140 160 306 248 62 52 314 315 254 246...

result:

ok ok, 1000 test cases (1000 test cases)

Test #6:

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

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
1837 943 573 79 1221 326 496 868 1307 130 555 307 169 404 1393 36 1861 1305 650 1387 1588 1561 1784 1873 1017 1893 755 293 309 826 1106 1219 702 873 525 959 192 1398 569 1695 1228 968 1076 1080 1423 761 1169 1091 1406 1652 859 660 221 1531 1356 506 581 528 28 1374 654 862 790 1427 1789 109...

result:

ok ok, 100 test cases (100 test cases)

Test #7:

score: 0
Accepted
time: 269ms
memory: 31612kb

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
22876 25753 17897 4413 10380 17722 4158 14060 24290 43676 19100 12786 37863 21721 8162 30910 39141 20482 14624 32665 21509 11755 31041 28256 29019 32495 27323 23520 11816 10613 18182 38853 13366 20841 27931 30067 10353 28786 30122 18368 41567 20149 11045 10832 23820 11055 42566 38922 383...

result:

ok ok, 10 test cases (10 test cases)

Test #8:

score: 0
Accepted
time: 443ms
memory: 88476kb

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
66285 80280 56819 31467 135652 36171 118991 198601 85843 135213 134776 188784 18198 71107 194225 18504 151216 161225 86135 133070 138243 163171 87542 181967 82575 54652 191554 158317 131056 95587 78111 126688 108673 183384 38740 91941 117219 23905 85663 41155 124374 123439 55593 127461...

result:

ok ok, 1 test cases (1 test case)

Test #9:

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

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
69736 88475 113645 133903 77813 167594 186580 38949 60566 105305 152899 5537 140339 195339 190404 44067 10675 109479 165622 142473 1997 34370 3270 77193 44256 80532 148265 4659 8112 11092 31003 178262 143921 137350 34996 7388 195165 148698 155769 20045 129683 27050 103283 41067 165259 52...

result:

ok ok, 1 test cases (1 test case)

Test #10:

score: 0
Accepted
time: 233ms
memory: 56828kb

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
88998 29607 89143 177192 25968 105886 74650 40968 69033 80222 34969 86186 190983 142289 100014 127249 6807 183507 126791 100 187188 80796 159035 82334 17597 180019 152125 187670 2163 126565 103894 50731 72184 106197 196825 145026 131909 191086 139549 25643 83060 57836 4240 193357 68840 1...

result:

ok ok, 1 test cases (1 test case)

Test #11:

score: 0
Accepted
time: 412ms
memory: 85800kb

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
109259 94237 43307 22912 171000 149561 139989 151960 29140 65931 19137 84253 69031 33914 40340 72900 68032 161933 112889 192178 192894 88987 186498 30297 126377 118001 130128 62881 37623 100311 83851 76972 197251 70500 65377 159016 54324 104171 65835 15849 92111 53689 114333 190226 199...

result:

ok ok, 1 test cases (1 test case)

Test #12:

score: 0
Accepted
time: 376ms
memory: 77132kb

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
58620 80413 173929 170085 198744 190142 130885 121975 93115 178151 74416 9237 61231 156283 51636 30199 131466 78810 52012 103663 52610 30634 163658 49069 95775 195759 90203 128227 37818 124050 135745 186228 84749 53842 48347 81928 89582 80279 192779 4340 45856 44150 73553 22868 68700 18...

result:

ok ok, 1 test cases (1 test case)

Test #13:

score: 0
Accepted
time: 496ms
memory: 90288kb

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
80980 90902 166932 181906 50734 150130 166120 110746 34370 144018 53317 159568 87933 115044 103140 74843 856 172900 119143 54541 177367 39517 33838 21710 79732 151999 189087 154639 192622 162143 69623 54203 111900 188377 100163 150358 46779 68852 89061 76247 64290 268 20396 158951 1423...

result:

ok ok, 1 test cases (1 test case)

Test #14:

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

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
86263 178379 197991 3818 154809 191104 62250 181073 182396 41033 56884 55407 113214 36098 51758 73749 160544 2006 129266 33415 175157 53808 169483 102267 113444 175253 53166 91976 194176 39437 114713 173520 93482 14639 113053 7710 49393 108217 2169 159547 22003 139409 181977 118164 83674 ...

result:

ok ok, 1 test cases (1 test case)

Test #15:

score: 0
Accepted
time: 384ms
memory: 76108kb

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
128293 109511 67850 50609 53150 160525 65796 159603 182016 123957 123737 160725 116566 79258 127120 38911 171566 107477 120664 62917 25586 64602 87077 143532 11197 181528 27677 175959 97796 141057 78546 165022 185775 191926 168706 147424 65654 129278 63993 85022 154993 136938 162951 675...

result:

ok ok, 1 test cases (1 test case)

Test #16:

score: 0
Accepted
time: 375ms
memory: 76060kb

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
33476 59881 39608 168726 165810 14579 143301 116461 130826 166433 46533 181818 17847 133950 52078 67518 92587 67982 184018 158836 179 16847 76402 113036 76991 160433 189220 92176 61608 81027 189023 160679 185543 105337 158640 90250 143123 83553 160784 130718 4326 194471 69447 54862 1345...

result:

ok ok, 1 test cases (1 test case)

Test #17:

score: 0
Accepted
time: 460ms
memory: 84864kb

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
157413 89393 170292 58983 107625 134961 119595 120787 120391 184560 144965 609 170136 91992 6604 141060 100680 148459 25360 1472 36677 149794 79608 151869 188690 147217 181183 106506 71609 121799 69948 25732 162622 71293 170259 73000 178 56105 7413 12560 51826 167501 11099 152714 2943 ...

result:

ok ok, 1 test cases (1 test case)

Test #18:

score: 0
Accepted
time: 329ms
memory: 73464kb

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
88918 30079 118634 42049 63306 50250 19262 149378 152345 37138 163903 4117 63407 97901 114048 86285 170214 154879 176408 157970 159092 143361 193760 161040 195466 62186 165139 175376 85042 168246 183659 111656 87622 187334 159161 146240 18083 177601 167537 125658 31946 178559 17302 28366...

result:

ok ok, 1 test cases (1 test case)

Test #19:

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

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: 30ms
memory: 26268kb

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
133339 

result:

ok ok, 1 test cases (1 test case)

Test #21:

score: 0
Accepted
time: 30ms
memory: 28480kb

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: 40ms
memory: 26032kb

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: 36ms
memory: 28804kb

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: 59ms
memory: 30972kb

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
133339 133327 133328 133329 133330 133331 133332 133333 133334 133335 133336 133337 133338 133326 133340 133341 133342 133343 133344 133345 133346 133347 133348 133349 133350 133314 133303 133304 133305 133306 133307 133308 133309 133310 133311 133312 133313 133351 133315 133316 133317...

result:

ok ok, 1 test cases (1 test case)

Test #25:

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

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
133339 133327 133328 133329 133330 133331 133332 133333 133334 133335 133336 133337 133338 133326 133340 133341 133342 133343 133344 133345 133346 133347 133348 133349 133350 133314 133303 133304 133305 133306 133307 133308 133309 133310 133311 133312 133313 133351 133315 133316 133317...

result:

ok ok, 1 test cases (1 test case)

Test #26:

score: 0
Accepted
time: 421ms
memory: 31264kb

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
133339 133327 133328 133329 133330 133331 133332 133333 133334 133335 133336 133337 133338 133326 133340 133341 133342 133343 133344 133345 133346 133347 133348 133349 133350 133314 133303 133304 133305 133306 133307 133308 133309 133310 133311 133312 133313 133351 133315 133316 133317...

result:

ok ok, 1 test cases (1 test case)

Test #27:

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

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
133339 133327 133328 133329 133330 133331 133332 133333 133334 133335 133336 133337 133338 133326 133340 133341 133342 133343 133344 133345 133346 133347 133348 133349 133350 133314 133303 133304 133305 133306 133307 133308 133309 133310 133311 133312 133313 133351 133315 133316 133317...

result:

ok ok, 1 test cases (1 test case)

Test #28:

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

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: 0ms
memory: 16192kb

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

result:

ok ok, 1 test cases (1 test case)

Test #30:

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

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
909 419 481 480 788 513 547 605 970 261 642 366 334 207 173 197 693 872 526 647 211 128 364 26 99 347 690 521 963 448 93 532 161 652 126 116 262 839 327 886 739 840 355 537 957 773 382 945 619 219 192 408 854 354 94 181 200 11 923 884 696 378 400 756 519 599 103 52 620 33 151 813 643 486 424...

result:

ok ok, 1 test cases (1 test case)

Test #31:

score: 0
Accepted
time: 336ms
memory: 70368kb

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
123472 99263 143376 120916 110040 188665 141621 146581 51026 167908 194880 199301 45787 101701 24906 55100 131616 191403 48977 32657 40303 130611 130064 70056 122531 9557 90028 44281 46753 96099 84488 101462 57171 121008 21433 100127 74878 64725 42980 163298 136223 151950 106388 92210 87...

result:

ok ok, 1 test cases (1 test case)

Test #32:

score: 0
Accepted
time: 87ms
memory: 37040kb

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: 287ms
memory: 60144kb

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
163491 89782 49230 76598 161124 9504 37220 130523 166540 162025 98387 100451 73248 52981 167690 121315 17882 169835 47193 199580 110127 13300 131699 24059 177900 176487 159884 63974 39353 22371 24888 35524 16045 2361 44298 146217 65882 23148 3378 9081 76467 181922 72679 147764 62821 178...

result:

ok ok, 1 test cases (1 test case)

Test #34:

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

input:

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

output:

5
5
3 1 2 4 5 

result:

ok ok, 1 test cases (1 test case)

Test #35:

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

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

result:

ok ok, 1 test cases (1 test case)

Test #36:

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

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
6169 7991 7753 4160 4633 761 2535 1398 9898 321 336 9729 7358 6422 5394 1834 419 4744 8199 2927 1008 4300 9155 7338 5323 7045 1074 1707 4478 2824 5176 90 4275 4872 3181 407 5457 6949 4530 6045 7790 2046 9481 6727 8913 197 2738 8371 5992 5813 7397 6159 8571 7098 4437 4365 5145 678 260 400...

result:

ok ok, 1 test cases (1 test case)

Test #37:

score: 0
Accepted
time: 180ms
memory: 92684kb

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
27338 95756 43135 179802 111202 113455 30845 56161 26981 49543 157756 122640 59071 146999 139480 62571 26206 188516 40408 72255 19776 10737 172448 64993 148173 141675 108352 82558 141489 62095 128715 70007 52416 135040 165524 19712 96071 128250 16352 173535 134760 175484 102922 178922 ...

result:

ok ok, 1 test cases (1 test case)

Test #38:

score: 0
Accepted
time: 565ms
memory: 98140kb

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
53738 64628 66599 185372 127055 181310 110645 199771 99243 31749 162684 19273 47857 57168 176461 20785 33649 29610 31915 34729 80701 181362 109589 140245 92038 86649 107703 158377 88976 165126 162227 140752 60086 12706 176270 157083 2231 146443 29032 189354 166059 185633 120873 78225 6...

result:

ok ok, 1 test cases (1 test case)

Test #39:

score: 0
Accepted
time: 551ms
memory: 103876kb

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
19531 17767 122350 82500 147377 88335 138609 26522 57221 161303 147254 47761 95587 98024 86094 107077 41270 150862 197194 87265 1069 1935 23318 159171 40535 106092 9679 116470 113102 175175 139053 188322 155922 58838 65958 77528 199650 77903 23464 169378 34134 160565 63201 71094 24908 ...

result:

ok ok, 1 test cases (1 test case)

Test #40:

score: 0
Accepted
time: 545ms
memory: 99224kb

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
96037 44194 144752 93141 104956 13552 50071 116550 180638 105422 123552 104948 32955 184562 26645 32432 22464 43402 189628 102344 192710 123401 169273 123433 46482 127671 5119 197682 112188 123613 95727 184224 27507 90833 100079 185786 175856 104724 103089 27112 126900 157148 19982 538...

result:

ok ok, 1 test cases (1 test case)

Test #41:

score: 0
Accepted
time: 274ms
memory: 59716kb

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
41769 84103 72063 3619 105884 122200 70135 44188 186072 39537 159505 2209 132473 121312 4836 143977 17257 179738 25037 92634 71206 38482 28980 90893 182027 68778 80409 52479 8573 97314 32612 14817 81636 76772 107676 68484 164364 50829 130954 113626 66943 56105 6057 57939 185477 20468 283...

result:

ok ok, 1 test cases (1 test case)

Test #42:

score: 0
Accepted
time: 409ms
memory: 76728kb

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
162183 36567 69168 30123 167278 191034 100193 149806 126111 19872 23984 85603 97844 56635 139662 166579 51613 151963 60274 99263 107910 15351 54469 8090 190064 190258 38866 71429 96840 95634 55714 118674 19361 66466 172097 104296 139025 33542 45680 187408 28350 153762 47447 194146 40995...

result:

ok ok, 1 test cases (1 test case)

Test #43:

score: 0
Accepted
time: 435ms
memory: 87780kb

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
193139 91390 174775 122520 20314 14923 124028 144980 133204 176792 114451 91937 49741 167835 27237 121682 129668 169337 82815 77755 30875 192915 193514 54982 189716 117426 26540 156592 74904 141125 50147 122764 124921 158916 185135 175136 80337 20239 82903 75718 98427 39949 67463 19392...

result:

ok ok, 1 test cases (1 test case)

Test #44:

score: 0
Accepted
time: 491ms
memory: 100184kb

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
104520 148615 102092 29641 143309 124869 71383 180832 2239 62940 94959 159025 43192 186438 104289 145840 37566 140246 80817 161769 194571 33160 124983 168521 187115 132712 91471 11989 152879 101555 159274 2079 16773 51587 35993 130909 68060 82020 65044 94477 176273 118522 97199 48068 1...

result:

ok ok, 1 test cases (1 test case)

Test #45:

score: 0
Accepted
time: 532ms
memory: 96596kb

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
93762 8854 65302 23034 8787 45076 43160 97047 166449 179218 114900 106841 89723 124480 23561 113848 170443 161154 1803 38982 37637 75326 17365 38090 127711 87967 4986 142369 126524 87760 117657 23274 191559 92170 114263 105630 148386 102000 5165 70326 94793 161286 182862 76908 70810 19...

result:

ok ok, 1 test cases (1 test case)

Test #46:

score: 0
Accepted
time: 583ms
memory: 96840kb

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
191965 196946 122105 85526 184488 192086 29403 2277 47083 36097 22714 177354 60322 120325 119731 199781 170305 146725 137139 180755 122952 9270 17489 123434 111332 119088 81114 184318 27246 121932 144704 172123 20184 189176 163636 27043 54576 162313 3009 123865 130879 195542 42753 1578...

result:

ok ok, 1 test cases (1 test case)

Test #47:

score: 0
Accepted
time: 497ms
memory: 87288kb

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
128009 15275 186598 84544 16801 36977 125688 27729 14244 5833 50545 142347 144631 79765 147672 113201 76139 102509 8845 84761 115136 3194 107519 184765 134955 138961 153595 198959 36104 10816 195584 115404 131549 108235 120958 161842 104012 27638 70680 133225 75927 33084 70212 54357 13...

result:

ok ok, 1 test cases (1 test case)

Test #48:

score: 0
Accepted
time: 83ms
memory: 35640kb

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: 88ms
memory: 33960kb

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: 83ms
memory: 37600kb

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: 89ms
memory: 34516kb

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: 83ms
memory: 34528kb

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: 84ms
memory: 34000kb

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
112816 81878 99477 82591 117944 149773 52816 107175 181509 101051 104628 19566 165419 121203 53809 197552 163617 102329 17212 131517 16401 22273 78040 33508 186540 92082 90076 197978 197040 143185 135882 120823 108081 39467 99317 198819 149154 110831 122165 102471 79027 29495 73184 135699 12813...

result:

ok ok, 1 test cases (1 test case)

Test #54:

score: 0
Accepted
time: 90ms
memory: 35940kb

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
77425 192700 112459 193182 20626 6969 48215 87958 168870 114278 10446 54462 156690 134599 175524 117599 22610 83773 34262 141337 32069 16270 156553 74276 139574 157611 61644 17323 17632 137725 72258 13333 101172 51836 170164 89644 141542 179218 15427 196028 85560 104877 150171 49237 96437 493...

result:

ok ok, 1 test cases (1 test case)

Test #55:

score: 0
Accepted
time: 123ms
memory: 41836kb

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
136053 154178 116367 157231 12075 181235 77782 54179 118159 187638 88326 124050 30525 18478 144449 198891 165378 36742 39291 89654 109778 154348 88756 165591 156555 51256 195260 183322 90807 4457 16711 193078 92609 173870 25869 177892 8888 133462 168948 192226 97926 87305 30842 17085 9260...

result:

ok ok, 1 test cases (1 test case)

Test #56:

score: 0
Accepted
time: 142ms
memory: 47564kb

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
139481 158433 178892 119446 26503 110666 12190 83844 6867 25647 178962 40662 55692 74489 59625 102587 73203 75393 42909 132607 83898 125486 167596 14196 179102 8500 155885 103191 89780 154465 142806 25842 73425 25151 147120 79730 139333 35012 31967 91658 44198 105169 54617 130803 121672 1...

result:

ok ok, 1 test cases (1 test case)

Test #57:

score: 0
Accepted
time: 201ms
memory: 55952kb

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
173089 55736 158618 154267 183513 150562 154812 12708 121774 24458 151876 126591 158090 18921 128138 53086 170310 146504 54758 69566 95089 119145 131957 143156 1000 131091 94263 180898 53245 22692 120331 113840 94672 54090 139455 37730 136605 94689 151720 198431 32030 93888 174376 81494 ...

result:

ok ok, 1 test cases (1 test case)

Test #58:

score: 0
Accepted
time: 290ms
memory: 59200kb

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
145534 90874 147910 135942 25097 118114 163022 120613 154394 34028 199504 125962 176391 25812 76961 185271 28696 37454 109344 5701 1012 122791 24277 56174 37493 128564 20953 42432 185327 68136 65316 120805 151262 197212 166451 139569 89395 167006 127905 50228 108686 43118 156620 197136 ...

result:

ok ok, 1 test cases (1 test case)

Test #59:

score: 0
Accepted
time: 289ms
memory: 58616kb

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
11808 47974 76275 55593 125117 66377 123930 13143 124658 93649 85401 13893 140956 9541 6684 19369 196811 170488 192290 69565 15695 39185 90561 56253 123040 39841 182619 96729 39778 159397 69360 151068 123400 86239 23000 33307 128518 25452 20824 88427 24367 76649 78481 61519 191164 16083...

result:

ok ok, 1 test cases (1 test case)

Test #60:

score: 0
Accepted
time: 182ms
memory: 51216kb

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
2252 40968 159269 68797 7945 112121 158983 186008 155883 195247 55637 166773 158337 138848 180089 196331 12621 167113 147153 124237 40554 118416 167989 130424 158070 139587 128412 67287 21224 24632 112382 50392 61506 11352 44586 136467 89254 68156 103129 56436 56770 141578 14536 54831 10...

result:

ok ok, 1 test cases (1 test case)

Test #61:

score: 0
Accepted
time: 327ms
memory: 64628kb

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
115965 17948 51864 2913 64676 26650 22334 8288 11352 177173 90052 165279 49516 147334 51728 118871 87167 102369 1168 8341 82570 120903 160113 183613 138501 30848 139878 105880 142895 119365 170133 144681 175992 98115 68092 193236 113906 176974 115992 43547 9697 131358 85466 28515 184876...

result:

ok ok, 1 test cases (1 test case)

Test #62:

score: 0
Accepted
time: 306ms
memory: 63876kb

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
137149 32385 49720 29915 22470 79192 64940 171731 15093 186348 64391 75089 69357 122959 92733 59396 196393 36235 20810 178427 128712 105615 66065 48281 185187 67615 85322 197392 80356 190774 98023 116608 154780 9696 131038 54085 92302 102262 174629 37582 160487 100652 113511 52397 36149...

result:

ok ok, 1 test cases (1 test case)

Test #63:

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

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
182309 110213 120848 140866 63706 82555 106137 92895 34634 50758 23275 74241 65720 977 153567 132163 129572 194287 94539 138360 161839 45371 158360 151618 148616 96461 73666 109138 73341 168272 184833 98049 184331 185970 159078 185373 92459 23028 155472 75863 99353 50108 60661 127479 1...

result:

ok ok, 1 test cases (1 test case)