QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#847972#9994. waht 先生的法阵ChiFANAC ✓2268ms106288kbC++143.4kb2025-01-08 14:14:142025-01-08 14:14:15

Judging History

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

  • [2025-01-08 14:14:15]
  • 评测
  • 测评结果:AC
  • 用时:2268ms
  • 内存:106288kb
  • [2025-01-08 14:14:14]
  • 提交

answer

#include<bits/stdc++.h>
#define ctz __builtin_ctz
using namespace std;
const int mod = 998244353;
const int maxn = 3e5+114;
const int maxp = 3e4+114;
const int maxB = 5000;
const int B = 200;
int n,q;
int b[maxn];
int a[maxn];
int tag[maxB]; 
int jump[maxn];
int dp[maxn];
vector< pair<int,int> > vec;//c = \prood p_i^{q_i}
int isPr[maxn],Pr[maxn],tot;
constexpr int add(int x,int y){return x+y<mod?x+y:x+y-mod;}
void init(){
    for(int i=2;i<maxn;i++){
        if(isPr[i]==0){
            Pr[++tot]=i;
        }
        for(int j=1;j<=tot;j++){
            if(1ll*i*Pr[j]>=maxn) break;
            isPr[i*Pr[j]]=Pr[j];
            if(i%Pr[j]==0) break;
        }
    }
}
int f;
void rebuild(int id,int c,int l,int r){
	f++;
    int L=B*(id-1)+1,R=min(id*B,n);
    for(int i=L;i<=R;i++){
        a[i]=1ll*a[i]*tag[id]%mod;
        if(l<=i&&i<=r&&c!=1){
            a[i]=1ll*a[i]*c%mod;
        }
    }
    for(int i=R;i>=L;i--){
        int to=i+i/b[i];
        jump[i]=(to>R?to:jump[to]);
        dp[i]=add(a[i],(to>R?0:dp[to]));
    }
    tag[id]=1;
}
int ask(int u){
    int sum=0;
    while(u<=n){
        int id=(u-1)/B+1;
        sum=(sum+1ll*dp[u]*tag[id])%mod;
        u=jump[u];
    }
    return sum;
}
map<int,int> mp[maxn],chifan;
set<int> S[maxn];
int main(){
	//freopen("1.in","r",stdin);
	//freopen("1.out","w",stdout);
    init();
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    cin>>n>>q;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        b[i]=i/__gcd(a[i],i);
        int res=b[i];
        while(isPr[res]!=0){
            int ct=0;
            int p=isPr[res];
            while(res%p==0) ct++,res/=p;
            S[p].insert(i);
            mp[i][p]=ct;
        }
        if(res!=1) S[res].insert(i),mp[i][res]=1;
    }
    for(int i=1;i<=(n-1)/B+1;i++){
        tag[i]=1;
        rebuild(i,1,1,n);
    }
    while(q--){
        int op;
        cin>>op;
        if(op==1){
            int l,r,c;
            cin>>l>>r>>c;
            int res=c;
            chifan.clear();
            while(isPr[res]!=0){
                int ct=0;
                int p=isPr[res];
                while(res%p==0) ct++,res/=p;
                vector<int> del;
                for(auto it=S[p].lower_bound(l);it!=S[p].end()&&(*it)<=r;it++){
                	int x=(*it);
                	if(chifan[x]==0) b[x]/=__gcd(b[x],c);
                	chifan[x]=1;
                	rebuild((x-1)/B+1,1,1,n);
                	mp[x][p]-=ct;
                	if(mp[x][p]<=0) del.push_back(x);
				}
				for(int x:del) S[p].erase(x);
            }
            if(res!=1){
            	vector<int> del;
                for(auto it=S[res].lower_bound(l);it!=S[res].end()&&(*it)<=r;it++){
                	int x=(*it);
                	if(chifan[x]==0) b[x]/=__gcd(b[x],c);
                	chifan[x]=1;
                	rebuild((x-1)/B+1,1,1,n);
                	mp[x][res]-=1;
                	if(mp[x][res]<=0) del.push_back(x);
				}
				for(int x:del) S[res].erase(x);
			}
            for(int i=1;i<=(n-1)/B+1;i++){
                int L=(i-1)*B+1,R=min(n,i*B);
                if(l<=L&&R<=r){
                   tag[i]=1ll*tag[i]*c%mod;
                }else if(max(l,L)<=min(r,R)) rebuild(i,c,l,r);
            }
        }else{
            int x;
            cin>>x;
            cout<<ask(x)<<'\n';
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 9ms
memory: 36980kb

input:

998 4970
604930052 733121966 111477169 629331886 907145780 306419159 358274571 279467377 778652746 419669771 929596817 426691768 554317460 313052874 798647485 491363256 951783139 128560911 373258126 597578307 941513530 738365198 772320937 328050879 190312538 576900137 141991025 960913405 64864592 24...

output:

990686178
15417519
570424889
554093709
501808911
353261525
87917945
21605443
368864704
654270513
519903074
118675822
551855700
888843636
159432512
356503639
210170664
562480949
128892422
749784320
688648004
32631819
288848838
798591313
907380802
825062205
616538154
590198451
394395945
26504124
90538...

result:

ok 1988 lines

Test #2:

score: 0
Accepted
time: 13ms
memory: 34148kb

input:

999 4984
306021723 274342806 692715688 423257057 110611296 946241431 377228399 629276832 289214757 210453264 594168584 719632376 556413214 220978849 46842583 600021026 653689639 53103404 301308878 998228981 997197581 349726338 761145706 673852637 794319097 93546138 997650588 427423703 658313976 2752...

output:

290704829
971438654
793702432
288298065
464477051
496909399
444654123
776330194
723066754
448393514
860630317
5309074
301536351
120043731
924664970
656184802
830439205
96903098
901824392
419868072
666053477
240679161
634883937
59403011
673153209
58542206
355341081
324176679
136975010
448002892
23027...

result:

ok 1003 lines

Test #3:

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

input:

1000 4994
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

18994981
18994996
1439902
1319955
1439893
2292310
3459749
3219869
3771816
3531950
704953150
324853672
579335047
830716608
830236845
830356783
830836535
830476721
830716616
146403080
736074145
736553921
736553897
386620473
344042341
804496508
821528368
821528346
380758413
954009730
933830031
31946038...

result:

ok 3496 lines

Test #4:

score: 0
Accepted
time: 13ms
memory: 38604kb

input:

996 4982
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

999
1406
108376441
551609071
551609515
551609185
551609190
551609197
551609071
669171546
669171281
74700834
912178874
50325208
50278070
751459259
751445941
751510948
751543841
382622683
826709886
644449595
841137364
841137358
210799942
7105325
480462730
958195992
192591923
721877304
87956440
6824164...

result:

ok 2990 lines

Test #5:

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

input:

993 4974
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

943
12695579
12385679
42215477
191575819
469293500
469137401
258840250
223978140
225514706
258476019
258840250
365613795
258267887
589616759
354270601
258736184
883595164
146129838
586571895
208787766
942611329
743240005
474517786
459386797
885166609
141096676
474517854
474517359
478908580
589506537...

result:

ok 2487 lines

Test #6:

score: 0
Accepted
time: 15ms
memory: 37220kb

input:

999 4989
942204445 701773258 83643952 675438620 953279452 164033771 496967633 897663287 532312691 912525191 521251299 356488616 520391275 386363575 704345777 448062480 848105565 355644622 713586630 140841509 912054620 495138325 435270934 872174746 333891439 406741114 430566338 192954212 78244610 838...

output:

779066116
27298422
963768886
843358825
895508691
279111275
312969264
920899826
268667936
786295996
937552974
418318707
583220918
492978778
448343946
496645273
423655493
357661023
601568843
184820621
444366425
939205723
374217524
205407709
847121141
952555975
526423821
158511545
745934882
241504616
4...

result:

ok 3493 lines

Test #7:

score: 0
Accepted
time: 15ms
memory: 37724kb

input:

1000 4996
94215357 210282664 298562150 225540257 40917010 259006723 722472549 547270513 244206968 807887196 901397930 424231674 329215146 75072000 777809267 926575584 799413913 101841104 222308906 726286972 527654547 75526953 493227694 641031637 355615260 341091457 677197909 287246879 420511957 3198...

output:

544381265
414872727
493119303
222479562
188169587
135507213
254012687
316116321
301150090
917286647
763711620
950192518
800971630
595697244
180656884
831131179
612717163
875441052
711750104
897549097
458359829
526243976
482593395
720339779
24778375
713030284
212364445
841124112
985585109
616630244
1...

result:

ok 2998 lines

Test #8:

score: 0
Accepted
time: 15ms
memory: 35240kb

input:

1000 4988
981898154 194000941 217721403 655508498 884305756 902021532 197316583 78466688 296774949 347954347 363399860 678824742 462599619 60399193 71512081 163248588 489799186 519023480 82078680 785956804 576754736 740001661 937305510 43433516 127979062 486303732 164126274 702848596 228761157 51023...

output:

824494526
282787432
803439021
378284268
71777228
427948519
682510142
143785656
122549124
122549124
180825911
836321283
721548362
978320315
109275492
411704282
818362134
151711703
200491849
865605972
431197851
418297577
646946107
554067305
959586458
737392184
674431183
23332129
786973141
183835746
32...

result:

ok 2494 lines

Test #9:

score: 0
Accepted
time: 1740ms
memory: 97236kb

input:

249174 249519
779502962 380675117 124710956 683223364 611328956 819507884 943140643 42561823 488764921 17023570 768424866 644155236 303831888 99265776 634972670 379338258 930224987 667534580 839345930 301421070 226355123 478090579 224197284 505938322 653292278 513978177 988694662 708147005 932965371...

output:

124277849
323414488
30875762
100917603
810336806
694115685
657030653
345982679
418241003
275359085
186450076
430549356
148526139
188842479
271853615
746535383
315784025
449678592
900869217
600948851
794992142
313636
29999501
379428302
22389691
37104941
118055183
318764825
322612893
30894794
54802215...

result:

ok 149490 lines

Test #10:

score: 0
Accepted
time: 1939ms
memory: 96032kb

input:

249140 249386
404245632 174854485 235440512 162605907 651156153 625417072 424630231 531896961 946697934 101894126 745107931 930204449 967001350 213022782 691022011 49299513 325917026 425797759 840358651 230713580 791862121 557791720 197791573 600459565 866175130 959529857 200548075 740633448 3158670...

output:

23350081
582204594
951808926
197213431
868945291
771299318
164840108
210817394
422019537
377954308
432060553
996329325
435318212
365499867
92558172
200531303
352429207
106473162
991199119
455544699
586082661
654071829
340164237
295848949
556409563
897354781
62964707
551981135
209297381
650539365
384...

result:

ok 100165 lines

Test #11:

score: 0
Accepted
time: 1860ms
memory: 97612kb

input:

249251 249344
308574550 532911071 947436870 907743596 96362693 797979184 762947643 390274737 732058872 822205377 438683304 733251397 491089799 860711029 781779199 98229378 265219149 545244755 813721597 608190330 117080769 336174613 111720355 492033549 66694575 641754693 836704789 894197815 725814630...

output:

206850317
465727165
594565152
586381818
587063062
648615062
59101930
274702104
751497929
884782453
719827189
923238982
912417914
967175847
287337491
527616690
63327508
13856941
641531089
358346443
592620998
772932899
141278739
620633455
616926655
369567614
60390407
378388317
601691723
827668150
8842...

result:

ok 99745 lines

Test #12:

score: 0
Accepted
time: 2162ms
memory: 95484kb

input:

249613 249436
894271427 207774023 506943853 558735446 911140211 358593753 322392849 844959579 384702165 338173656 165154018 565411281 281800876 640742678 864769933 91573722 120503531 739069993 725819954 489614124 101589893 914354058 161524798 329169367 312170042 846067513 922513911 302835348 9574156...

output:

40520277
373049372
360348391
491202414
641181107
612577674
337229902
559765956
332974476
388171842
811126229
638667840
530538144
394662615
466148327
283612875
12889048
837660533
156352223
417655236
264173334
731729632
100525542
768876731
39580105
28730656
217372200
809425730
109731014
148960450
4985...

result:

ok 49896 lines

Test #13:

score: 0
Accepted
time: 1690ms
memory: 103488kb

input:

249843 249364
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

135052
237673
249107
234244
234331
244707
249077
232932
234383
241183
234618
724527812
691787728
691780785
691749181
691780786
691779231
230197318
730227162
270314740
618972666
618968732
618968122
97427241
772315122
387743437
807454265
894513956
33941489
894516879
294396420
471510503
212612127
96681...

result:

ok 187023 lines

Test #14:

score: 0
Accepted
time: 1752ms
memory: 106288kb

input:

249663 249797
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

238994
245099
159803
242497
6683643
6691520
25315819
25311766
32349188
25841626
32190451
32209569
32214458
467052552
467047248
597239404
467044080
467042523
58067856
467051110
594765199
724265621
777015862
978543523
494999458
29833248
495037262
387018877
127263231
484567068
617556232
284032057
26743...

result:

ok 174858 lines

Test #15:

score: 0
Accepted
time: 1741ms
memory: 103928kb

input:

249227 249867
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

239488
226450
228809
239942
320684189
161087377
577521431
577521976
577518470
449742733
35050133
330538110
699487390
449803270
583419948
446500570
501327786
448482190
880559414
3770357
917769834
877256714
452885790
450904170
551039342
531145709
567721255
329281296
394828213
591130249
439340912
59961...

result:

ok 162414 lines

Test #16:

score: 0
Accepted
time: 1856ms
memory: 103452kb

input:

249790 249386
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

249396
246210
247618
70976521
86170240
32293644
705572843
724459132
206962826
504620766
106204373
857047848
202685581
484819110
776828825
639906534
243667264
60287095
80382290
879765539
226382314
172446980
111799843
591123659
759528750
95478303
868892350
324941438
731489037
2436243
167980414
2637757...

result:

ok 149632 lines

Test #17:

score: 0
Accepted
time: 1972ms
memory: 102184kb

input:

249213 249213
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

246266
237150
248067
78149489
137712768
567022082
262534590
14272518
183567886
582033025
17787846
801100716
295491814
654637080
734806713
422727331
824530196
354158685
603603426
979139507
763482745
179046319
917886053
101614878
332296481
492088524
882740024
801776084
576981633
483265122
40437560
747...

result:

ok 137068 lines

Test #18:

score: 0
Accepted
time: 1916ms
memory: 103680kb

input:

249942 249994
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

239082
854832158
854823804
854831708
16126722
476192852
6252877
481937965
146592
46386450
962906500
115579151
626288902
46566886
463507849
698795177
797713799
744384185
190224447
373505936
871293994
205685666
566841408
566751761
332166755
806412905
84675209
730162790
309693401
389805370
818887778
22...

result:

ok 124997 lines

Test #19:

score: 0
Accepted
time: 2033ms
memory: 103576kb

input:

249177 249703
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

231180
265318269
579437415
363038959
97010593
13139
245192784
769009615
883570332
520762320
520742702
520695965
520759435
612618589
790875441
28616033
695049560
465708132
560145922
312455401
789341974
478141063
724420242
520481323
558915788
585731286
707095848
221530832
192995275
415457688
119580923...

result:

ok 99882 lines

Test #20:

score: 0
Accepted
time: 2163ms
memory: 101892kb

input:

249262 249064
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

52622673
55765237
78361034
47392767
298940862
398276714
395078247
681577358
680633465
681573493
6971
461239271
503870374
683829904
447110423
474244685
474249404
518257285
595261687
445525089
828790510
828784261
571565967
460400755
388305428
560900870
184735612
494585836
158640983
836142949
31182211
...

result:

ok 74720 lines

Test #21:

score: 0
Accepted
time: 2268ms
memory: 104372kb

input:

249744 249594
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

103649899
764132706
171886261
734784866
512362083
861481858
255731033
414681078
416097740
195254075
953054031
287738648
387351838
179444591
327479437
388845072
116643619
590301580
258660120
539680462
813749482
621183213
617140743
530341870
129700319
727663355
322178597
184386537
271376405
156183170
...

result:

ok 49919 lines

Test #22:

score: 0
Accepted
time: 1561ms
memory: 97624kb

input:

249898 249713
845398704 754719860 165656972 66684250 259407773 339656513 688496086 182798582 155217653 121640812 424591449 744307611 441183603 614959633 579232388 426772301 481295386 755385715 405255483 125113319 835569759 559876534 799373615 494265741 171516841 164588404 559568545 728333097 7167849...

output:

872486933
586024031
672802791
160926382
889298370
737177833
170097219
90779080
276429527
472477461
953340303
619285393
615645462
330298825
954122894
327101793
965493691
557085297
403207734
694385280
450262096
931016844
873145541
161496102
474179693
759885670
179548276
907958690
282313464
269477570
8...

result:

ok 187285 lines

Test #23:

score: 0
Accepted
time: 1636ms
memory: 95512kb

input:

249847 249264
631310803 319993551 790096857 263916922 994128687 937248082 594802815 290351057 315903860 705676076 191617589 992559851 964372422 553445675 87443404 82334571 825749793 924098400 162030258 958661133 140198210 163072798 267137190 741013894 429039571 119726490 938223112 709951839 78818899...

output:

137339024
706432361
383376581
355050080
356710436
548927665
423104056
891047517
169745869
255920071
131931657
154274604
867841859
670829199
476647551
808486785
343800266
665512001
352899860
156419890
108800789
266411917
987388738
622075406
252000496
760711581
695969688
966057902
313684121
632683871
...

result:

ok 174485 lines

Test #24:

score: 0
Accepted
time: 1651ms
memory: 95488kb

input:

249070 249389
329814769 634981634 518179243 319418371 627304128 857219893 688959944 913502805 309235820 945180270 413965225 682256855 479909177 264573223 394167392 96020800 621934789 992852168 466578441 328697735 892361048 357501099 880385766 230042275 540857175 406628730 889091617 926964503 2077266...

output:

354234847
216926457
114676745
374924864
559731591
529062369
797705725
315903117
832670680
397380604
603450223
449783361
95154675
545794851
960758002
404576504
79388417
705440938
503270465
357005073
594740371
978301524
708969881
169716110
218759489
612633325
227115042
881063126
168082723
708734863
12...

result:

ok 162103 lines

Test #25:

score: 0
Accepted
time: 1724ms
memory: 95244kb

input:

249672 249607
89485580 978952855 575663588 911442694 858433261 344477859 237158314 641807088 152372412 52968724 928089542 179702071 329883017 773899386 903240747 783487828 557170810 496431020 848772516 192237526 546856365 343086238 365182536 69048997 651930641 373163858 589159422 956719952 442965470...

output:

34700368
804777524
114670929
892291723
931315222
504859109
639334163
380351479
324390454
198965150
529317886
837900586
446382297
352280527
707238659
430234254
514544144
341021935
532676227
284745453
428660433
55761764
665454359
844959284
746535740
798949952
186993435
668650300
868502435
922551495
47...

result:

ok 149765 lines

Test #26:

score: 0
Accepted
time: 1703ms
memory: 98204kb

input:

249219 249616
681519735 586859113 803783666 153906089 360524679 539698308 64100201 6430502 319935958 362347220 965163079 192245175 851133674 482347982 903237830 30059157 216527874 322947125 407130795 770855843 906940575 120350860 95043329 732229343 188102669 777603137 189713836 515918407 138370913 3...

output:

932701389
460530138
419701254
771215709
682007609
918553956
183497914
913778363
707156763
768448446
679848771
625297671
112057395
620627165
493851265
838678020
109933704
989377696
456798644
414696797
761695670
659277394
148692646
289363418
514802144
851292806
214357462
204763477
80987709
564737805
9...

result:

ok 137289 lines

Test #27:

score: 0
Accepted
time: 1798ms
memory: 95332kb

input:

249248 249061
415115789 161762281 13389227 448830034 415103922 330271040 739858781 539404548 509683071 337911509 183648782 530376402 502374598 775689652 172708866 14118767 467435008 604983677 138248383 934470638 592421854 614861490 150257918 226800780 939391099 516229645 35984053 788200707 987319817...

output:

226999005
1921189
972029777
34199319
939114832
638563512
552213843
98324227
715135521
507319013
74748422
439107577
745287622
754410920
333551859
882555627
783035405
206707237
107708408
748595292
314025097
728449897
622346721
911054294
314854246
59996629
422340183
934451731
853154601
887081865
369249...

result:

ok 124531 lines

Test #28:

score: 0
Accepted
time: 1944ms
memory: 96260kb

input:

249432 249736
723337098 455760086 538766011 815307011 525499173 4119755 561356209 28762709 137346936 537466445 138150582 914417804 497555242 629730943 152332507 782842619 439101060 855874132 898627341 873473301 878903280 50910600 290687721 521340936 979932593 333072372 974733494 519880385 642588854 ...

output:

525101893
74638968
289007598
156343116
568231630
320309190
541490799
812042172
409586448
480966745
510954698
743488796
205433419
184763943
939436678
735737512
948770429
131953851
981020219
875877865
617405966
569734724
369978594
701525361
265068157
511983774
809982425
529578619
150051959
871829023
6...

result:

ok 99895 lines

Test #29:

score: 0
Accepted
time: 2011ms
memory: 95436kb

input:

249075 249285
122520378 678808430 488089562 431641532 56198032 703565537 668967185 4951726 940491657 751193694 309958246 183083899 480837947 668076334 322193473 681296384 292912743 577003701 894890012 220473511 643538228 275747879 156203675 18193995 655126093 786158699 710162234 388073917 997604303 ...

output:

11093399
293346909
295079304
865355382
808048318
507025340
366495540
952534573
981117244
564795944
658941427
138988519
161070454
475671333
541451005
6670696
594037857
835742336
316637559
620906246
923281386
393387971
190542008
176505543
302551293
85669368
252087148
184819455
950550902
995478314
1395...

result:

ok 74786 lines

Test #30:

score: 0
Accepted
time: 2154ms
memory: 95292kb

input:

249866 249423
135575076 85574732 972445193 114793131 451685541 69329487 254386882 144878172 454355069 479229784 703062214 257844458 346061875 907201481 510043945 630291219 153914782 670383583 106985896 206748593 464204500 338434879 130805650 730668215 95916502 349095367 511121315 607159531 956688193...

output:

768860047
827882014
658856137
627061831
440691979
182164159
546494865
86595192
907526814
967821901
122825833
562543662
869923030
115002312
762662389
509346704
406345890
302580946
250929718
818215422
996870639
600673929
237626769
958994025
618177779
907240385
695134967
723060302
554430707
17425334
96...

result:

ok 49885 lines