Source Code
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;

const ll N = 1000000;
const ll M = N * N;

ll k;
int n;
vector<pll> a;

int main() {
    cin >> n >> k;

    for (int i = 0; i < n; i++) {
        ll x, y;
        scanf("%lld%lld", &x, &y);
        if (x <= N && x * x <= k) {
            a.emplace_back(y, x);
        }
    }
    sort(a.begin(), a.end());

    auto cmp = [](ll a, ll b) {
        return abs(a) < abs(b);
    };

    ll old = 0;
    ll answer = 0;
    std::set<ll, decltype(cmp)> subs(cmp);
    // set<ll> subs;
    vector<ll> temp;
    for (pll p : a) {
        ll y = p.second;
        ll x = y * y;

        ll current = old;
        if (x <= k) {
            temp.push_back(x);
            current += k / x;
        }

        for (ll z : subs) {
            if (abs(z * y) <= k && abs(z * x) <= k) {
                temp.push_back(-z * x);
                current += k / (-z * x);
            } else {
                break;
            }
        }

        for (ll z : temp) {
            subs.insert(z);
        }

        temp.clear();

        ll now = current - old;
        answer += now * p.first;
        old = current;
    }

    cout << answer << endl;
}
Copy
Number of the Beast Baraa_Armoush
GNU G++17
323 ms
31.9 MB
Accepted
Test Case #1
0 ms
360 KB
Accepted
Input
4 10
2 300
3 66
5 100
13 32
Output
666
Judge Output
666
Checker Message
1 number(s): "666"
Test Case #2
0 ms
432 KB
Accepted
Input
2 50
3 10
7 21
Output
71
Judge Output
71
Checker Message
1 number(s): "71"
Test Case #3
3 ms
1.0 MB
Accepted
Input
8944 1000000000000
530851 634109
437629 135449
760841 608005
987979 505317
567187 797505
115057 581792
986287 132112
788677 472337
209929 417283
972313 694722
65809 400083
710887 970135
432959 268565
920039 761441
375703 505835
988439 938996
257473 ...
Output
39179400996329
Judge Output
39179400996329
Checker Message
1 number(s): "39179400996329"
Test Case #4
34 ms
5.8 MB
Accepted
Input
52876 1000000000000
774601 578667
323131 777063
726521 116978
526049 7406
439849 428478
257993 853903
926099 703420
650543 859979
445657 85973
713653 866195
201973 968679
393709 554653
695377 749686
970817 300795
175631 382628
17291 977384
453659 21...
Output
47954264298367020
Judge Output
47954264298367020
Checker Message
1 number(s): "47954264298367020"
Test Case #5
56 ms
9.2 MB
Accepted
Input
62889 1000000000000
96731 938745
564197 887165
101891 807095
435103 275925
826561 814908
624809 289314
392759 261341
739693 210688
375059 926955
911419 693188
249211 940854
389447 860957
430357 210450
238181 144053
250057 490781
236287 914972
826907...
Output
177626424930464313
Judge Output
177626424930464313
Checker Message
1 number(s): "177626424930464313"
Test Case #6
50 ms
7.9 MB
Accepted
Input
69495 1000000000000
882751 466967
733283 816448
593051 278689
344969 969845
836788915219 640191
759229 326245
937919 353916
495389 689089
829789 827675
770359 83602
81637 947110
248701 197354
345637 547014
88919 217436
290011 903701
647321 571437
68...
Output
3488990381123725
Judge Output
3488990381123725
Checker Message
1 number(s): "3488990381123725"
Test Case #7
92 ms
13.4 MB
Accepted
Input
71267 1000000000000
460937 935534
431377 252584
470333 733923
677423 863927
59509 536581
436871 626577
211969 827999
92507 226497
104347 817794
918223 609294
118931 610119
492979 718821
701761 501716
247729 902837
160603 715743
78049 525082
716869 9...
Output
218291702857338019
Judge Output
218291702857338019
Checker Message
1 number(s): "218291702857338019"
Test Case #8
99 ms
15.0 MB
Accepted
Input
73918 1000000000000
510137 711495
138071 753418
88811 466860
438029 203472
232549 220155
95027 317536
284729 79563
168937 38758
575249 693880
176087 440015
177337 146033
670321 180931
46549 845839
756683 494290
581177 249642
292807 889517
831911 565...
Output
90498084014424909
Judge Output
90498084014424909
Checker Message
1 number(s): "90498084014424909"
Test Case #9
232 ms
28.0 MB
Accepted
Input
75460 1000000000000
550541 799895
470627 455442
952297 220169
247369 943190
1531 792535
352423 768136
468323 47592
603103 68915
155171 99702
635461 922128
741709 320280
29131 685116
783487 291292
778307 400299
156691 380890
418471 618460
790189 1093...
Output
234480378246163257
Judge Output
234480378246163257
Checker Message
1 number(s): "234480378246163257"
Test Case #10
149 ms
19.3 MB
Accepted
Input
76412 1000000000000
619739 140074
43661 895691
373207 11522
850133 246002
25999 542158
184777 864567
637513 601399
743377 561609
545731 403281
719179 152618
52181 470076
690163 481843
919 467788
560869 311451
75217 309676
679951 183736
798397 160063...
Output
76095122442469919
Judge Output
76095122442469919
Checker Message
1 number(s): "76095122442469919"
Test Case #11
9 ms
2.2 MB
Accepted
Input
22966 1000000000000
329081 213166
589861 823587
615427 409884
104107 14651
695171 216930
318281 895636
960251 212838
679067 721660
72221 319405
987191 789442
523459 866219
837929 430950
219977 92701
344791 944019
91691 727127
789793 897805
917549 67...
Output
1460048061594948
Judge Output
1460048061594948
Checker Message
1 number(s): "1460048061594948"
Test Case #12
29 ms
5.2 MB
Accepted
Input
56011 1000000000000
890653 775142
456809 139922
160141 673130
852457 9097
439063 895174
599623 99312
13399 573666
290183 509747
248737 451847
447677 980179
932447 828434
426583 468342
89213 532324
765209 200120
110989 67932
511507 94789
89867 558600...
Output
2243620674765612
Judge Output
2243620674765612
Checker Message
1 number(s): "2243620674765612"
Test Case #13
57 ms
9.7 MB
Accepted
Input
64344 1000000000000
321163 690762
43943 995377
844187 898597
486833 85977
793103 623166
592741 641629
783191 322082
779489 630314
469891 389649
401209 826963
991811 663609
689873 237292
755009 568807
69809 914457
530093 523770
929197 565281
180437 2...
Output
67526422661477378
Judge Output
67526422661477378
Checker Message
1 number(s): "67526422661477378"
Test Case #14
117 ms
16.3 MB
Accepted
Input
69017 1000000000000
243527 580239
919337 595046
329471 567067
816157 537134
493249 168276
947239 837886
105761 725071
539761 517212
182423 566189
211889 789654
361993 3552
433429 109730
184913 971246
924403 750726
759653 737077
22783 646650
806639 1...
Output
167979042233327820
Judge Output
167979042233327820
Checker Message
1 number(s): "167979042233327820"
Test Case #15
66 ms
10.8 MB
Accepted
Input
71873 1000000000000
806009 191326
423043 35473
84691 733040
527623 182830
353567 978872
29207 458636
850271 945695
153889 373741
772567 155293
577327 522139
393739 785066
57773 8239
19477 712571
243401 344368
944963 970220
894667 910239
123209 7113...
Output
42765453002067827
Judge Output
42765453002067827
Checker Message
1 number(s): "42765453002067827"
Test Case #16
77 ms
11.5 MB
Accepted
Input
74205 1000000000000
279337 617040
91019 378701
747557 985485
495343 481058
151673 989057
89501 609645
424829 455484
421313 370100
501157 665357
543607 659370
202667 963637
664253 918667
372371 844702
655021 141676
142697 382347
649877 144525
271253 ...
Output
14312621313935280
Judge Output
14312621313935280
Checker Message
1 number(s): "14312621313935280"
Test Case #17
140 ms
18.0 MB
Accepted
Input
75769 1000000000000
112951 891069
866743 938080
225983 518943
195043 907358
931571 909258
617189 29939
428137 493982
877423 560157
597361 950966
305927 529816
192557 560952
810053 239243
270121 491566
768727 825669
761459 678613
197371 348840
440953...
Output
89433007252086127
Judge Output
89433007252086127
Checker Message
1 number(s): "89433007252086127"
Test Case #18
168 ms
20.6 MB
Accepted
Input
76164 1000000000000
465407 154863
311033 139217
602521 992451
7573 487078
399493 505934
25057 457645
753329 951411
444449 228699
427247 23860
607819 206690
448999 722936
275421287521 211855
472937 233549
792227 805683
840253 999727
406093 179845
896...
Output
117399149807101176
Judge Output
117399149807101176
Checker Message
1 number(s): "117399149807101176"
Test Case #19
0 ms
640 KB
Accepted
Input
22 300061850403
937891 830919
875089 260365
875068022483 291994
478321 361938
173347 816893
562147 367372
67391 170165
240421 861268
928253 460281
365669 993361
586457 405952
937919 592750
308849 182549
188311 44173
412457 560301
729383369069 830139...
Output
68503345
Judge Output
68503345
Checker Message
1 number(s): "68503345"
Test Case #20
0 ms
756 KB
Accepted
Input
30 259928802773
10589 464714
321163 859716
406117 845807
660061 335790
68577521107 636197
756869 105577
485753 579464
590431 604580
812297 211196
48473 134405
188693 258452
891763 136485
685393 736183
909071 69535
363577 883520
89189 948490
543241 2...
Output
1184138827
Judge Output
1184138827
Checker Message
1 number(s): "1184138827"
Test Case #21
0 ms
732 KB
Accepted
Input
14 215500787846
919519080167 914732
24121 214852
635051 432524
518387 464878
305867 826245
645833 836365
907637 742388
219911 448826
653977 935812
393955578323 338832
113259009397 132964
982453 664637
633559 82427
102983 775709
Output
98457214
Judge Output
98457214
Checker Message
1 number(s): "98457214"
Test Case #22
0 ms
756 KB
Accepted
Input
22 175367740215
584659 195293
828917 728541
732959 864872
966293 711035
8713 696752
867431 411117
942779 639156
630023 241350
981809 706
217457 52960
781301 560248
893023 784956
489869 71751
379369 743470
53090869541 339066
275459 895479
502919 4436...
Output
1612190428
Judge Output
1612190428
Checker Message
1 number(s): "1612190428"
Test Case #23
0 ms
736 KB
Accepted
Input
22 126644757993
659629 735716
414209 851896
704897 647768
276137 149832
179173 926209
222493 930296
184412870429 192649
134591 530114
103357 525082
207013 870437
509363 385781
378401 945559
147703 304323
703081 654137
981683 587753
527671 410956
594...
Output
18594954
Judge Output
18594954
Checker Message
1 number(s): "18594954"
Test Case #24
0 ms
736 KB
Accepted
Input
30 119080742246
862129 72907
490849 523612
525353 87441
852661 861058
195023 591072
837887 785639
131381 833853
934229 564903
657973 314313
523541 456195
409259 28777
697967 414764
857839 590825
443011 913664
286469 215325
4391 352660
812627 525769
...
Output
2188601465
Judge Output
2188601465
Checker Message
1 number(s): "2188601465"
Test Case #25
0 ms
736 KB
Accepted
Input
38 78947694616
576721 266235
851797 324852
80141 67449
89449 793774
366511 339344
375703 391398
786916808219 357173
85061 348170
35671 810452
352601 622359
430739 150476
33149 650665
334931 842077
135559 87569
732373 458720
850807 966058
9796128882...
Output
141987924
Judge Output
141987924
Checker Message
1 number(s): "141987924"
Test Case #26
0 ms
736 KB
Accepted
Input
22 34519679689
840967 67387
8147 352775
757993 220646
217387 531633
180949 581876
609487 974040
196480907591 853128
612107 877492
836699 65507
299501 962739
317288083543 572781
188677 170469
421621 969333
633497 353434
846851 399222
822944089207 443...
Output
187823951
Judge Output
187823951
Checker Message
1 number(s): "187823951"
Test Case #27
0 ms
752 KB
Accepted
Input
41 117599755717
244087 786715
981397 888570
204871 565069
226379 911606
495923 784764
801503 6371
700027 140422
546349 111134
258253 378061
359981 837875
110210556851 515030
714199 353437
852316251931 235316
847919 434253
980887 67173
526367 626154
...
Output
104027886
Judge Output
104027886
Checker Message
1 number(s): "104027886"
Test Case #28
0 ms
768 KB
Accepted
Input
9 110035739971
376307 872917
129003387559 420744
962233 597501
714140103319 558088
670519316407 749196
390307 932734
731113 236805
989467 121466
650953 567838
Output
0
Judge Output
0
Checker Message
1 number(s): "0"
Test Case #29
0 ms
768 KB
Accepted
Input
33 69902692340
618929 57757
407567 729976
557261 999530
129719 417321
357671 605628
247939 812766
53939 592607
199909 618412
684869 26735
479623 983713
653357 2561
945851 773200
106853 623043
21893 10764
463433 585569
127663 530226
136429 381674
678...
Output
127808820
Judge Output
127808820
Checker Message
1 number(s): "127808820"
Test Case #30
0 ms
796 KB
Accepted
Input
17 25474677413
632029 263963
725579 721449
472597 986593
87767 977593
869474166017 505952
603311 767295
519667 376305
467081 612374
719681 225973
626377 211384
772279 927377
73867 818637
608459 592089
178120696627 896964
799979 717450
5147 838374
62...
Output
811884741
Judge Output
811884741
Checker Message
1 number(s): "811884741"
Test Case #31
0 ms
772 KB
Accepted
Input
41 976751695190
942269 793984
874799 780883
192587 687845
542747 588713
134789 69289
153421 825353
330352526921 940993
602111 995994
681001 512110
756227 401991
382999 713091
295769 712682
809471944271 965028
659371 647526
374531 611215
742909 6073...
Output
193010238821
Judge Output
193010238821
Checker Message
1 number(s): "193010238821"
Test Case #32
0 ms
772 KB
Accepted
Input
9 936618647559
713159 417945
764261 502793
200971 974386
622792315427 705915
664546586267 125357
790241 842615
229743443453 537901
93553 714164
211681 455915
Output
109708079
Judge Output
109708079
Checker Message
1 number(s): "109708079"
Test Case #33
0 ms
800 KB
Accepted
Input
17 892190632632
751957 290145
678211 661596
813013 27028
573101 884917
109789 512398
939452562329 576887
460531 515646
426469 493722
770503 76341
240203 516357
560042750441 873361
163481 833044
310243 584157
189764800493 36827
860297 409208
515857 9...
Output
121122136
Judge Output
121122136
Checker Message
1 number(s): "121122136"
Test Case #34
0 ms
784 KB
Accepted
Input
17 888921584182
450557 448334
280121 189975
21001 149647
596927 400649
999521 978824
906068136647 329545
494237 261464
409657 712773
8081 390922
575753 15177
787331 866257
25200662801 936086
939287 117236
542688255059 116152
812587 565063
155921 710...
Output
5660297884
Judge Output
5660297884
Checker Message
1 number(s): "5660297884"
Test Case #35
0 ms
780 KB
Accepted
Input
19 300061850403
26687 656770
308849 784660
478321 284722
555029 389147
967819 582349
937919 369168
188311 46161
240421 175335
875089 593587
67391 418116
895277 202654
365669 800220
562147 916091
173347 483035
586457 602739
937891 137864
412457 8671...
Output
315941683
Judge Output
315941683
Checker Message
1 number(s): "315941683"
Test Case #36
0 ms
780 KB
Accepted
Input
7 259928802773
543241 605777
363577 759705
188693 485733
590431 534730
321163 812292
89189 937524
813577 788519
Output
35785188
Judge Output
35785188
Checker Message
1 number(s): "35785188"
Test Case #37
0 ms
780 KB
Accepted
Input
11 215500787846
518387 567552
219911 980720
635051 351348
653977 994140
305867 332021
102983 797828
24121 138348
633559 52399
645833 751728
907637 227676
982453 475498
Output
71732242
Judge Output
71732242
Checker Message
1 number(s): "71732242"
Test Case #38
0 ms
800 KB
Accepted
Input
19 175367740215
217457 499066
379369 732513
489869 198774
867431 206811
781301 821914
939247 123664
584659 803672
942779 391595
630023 766154
882103 109873
502919 284579
8713 869841
966293 212135
732959 111040
752569 373084
275459 230853
981809 9054...
Output
2012024127
Judge Output
2012024127
Checker Message
1 number(s): "2012024127"
Test Case #39
0 ms
692 KB
Accepted
Input
19 126644757993
527671 219021
981683 445627
103357 417826
378401 362608
222493 129246
798823 83856
703081 163611
179173 733186
641143 845479
276137 265728
147703 818191
414209 432057
251609 126944
207013 353079
659629 327658
594227 842884
704897 144...
Output
16452947
Judge Output
16452947
Checker Message
1 number(s): "16452947"
Test Case #40
0 ms
784 KB
Accepted
Input
7 119080742246
684637 312468
547601 271596
862129 852652
332561 740575
525353 501313
204857 482552
857839 837864
Output
1705679
Judge Output
1705679
Checker Message
1 number(s): "1705679"
Test Case #41
0 ms
788 KB
Accepted
Input
15 78947694616
33149 89445
411641 235612
510137 430725
41843 794245
851797 820918
576721 899528
923903 36789
375703 886829
994717 279973
774377 184299
391789 500146
130729 871854
310043 80121
135559 57179
85061 902695
Output
54834702
Judge Output
54834702
Checker Message
1 number(s): "54834702"
Test Case #42
0 ms
788 KB
Accepted
Input
19 34519679689
299501 252805
662999 360776
217387 331877
421621 180272
180949 434219
633497 29840
624191 178018
757993 725255
840967 985342
188677 181677
609487 900116
810013 468975
846851 422987
883391 46493
8147 98004
81899 935874
836699 149655
22...
Output
56075669
Judge Output
56075669
Checker Message
1 number(s): "56075669"
Test Case #43
0 ms
792 KB
Accepted
Input
18 117599755717
495923 102808
493393 852212
267167 431978
535991 180608
171341 182981
204871 140946
226379 632103
661393 880754
258253 355773
690757 665944
700027 307833
145721559131 750182
526367 424232
244087 777880
918431 168707
359981 469497
173...
Output
5218193
Judge Output
5218193
Checker Message
1 number(s): "5218193"
Test Case #44
0 ms
796 KB
Accepted
Input
6 110035739971
650953 79802
731113 820164
376307 16655
962233 943330
989467 830090
390307 772762
Output
0
Judge Output
0
Checker Message
1 number(s): "0"
Test Case #45
0 ms
796 KB
Accepted
Input
10 69902692340
247939 803924
479623 801212
684869 177751
945851 344076
618929 966627
557261 255340
299137 335116
33931 735075
129719 97130
541589 44732
Output
45296944
Judge Output
45296944
Checker Message
1 number(s): "45296944"
Test Case #46
0 ms
796 KB
Accepted
Input
14 25474677413
467081 543887
603311 533308
519667 129525
772279 74782
719681 740076
73867 649451
472597 857951
5147 419832
87767 490544
632029 814850
626377 471652
608459 858474
725579 665085
799979 197185
Output
407527988
Judge Output
407527988
Checker Message
1 number(s): "407527988"
Test Case #47
0 ms
824 KB
Accepted
Input
18 976751695190
874799 156002
134789 971803
791191 914240
643691 399326
756227 469899
281063 159152
153421 331718
542747 827501
816649 771082
382999 325141
962161 313846
192587 707875
942269 138659
374531 244830
311473 663004
420353 474734
967259 49...
Output
111706769
Judge Output
111706769
Checker Message
1 number(s): "111706769"
Test Case #48
0 ms
816 KB
Accepted
Input
6 936618647559
713159 273003
200971 229154
93553 734659
790241 638889
211681 314872
764261 233820
Output
91322207
Judge Output
91322207
Checker Message
1 number(s): "91322207"
Test Case #49
0 ms
796 KB
Accepted
Input
14 892190632632
460531 838086
860297 508998
813013 91972
770503 983268
109789 854513
163481 686932
310243 824329
240203 119314
678211 638018
573101 91667
751957 333215
515857 646845
153589 445254
426469 995097
Output
123597859
Judge Output
123597859
Checker Message
1 number(s): "123597859"
Test Case #50
0 ms
796 KB
Accepted
Input
14 888921584182
21001 85614
787331 384138
999521 454815
939287 393531
8081 324232
280121 721229
575753 532716
155921 718512
450557 20509
812587 916142
596927 826078
494237 727470
519889 727113
409657 421430
Output
4630722479
Judge Output
4630722479
Checker Message
1 number(s): "4630722479"
Test Case #51
99 ms
16.0 MB
Accepted
Input
78498 244649277227
225383 985856
458377 669819
574741 322976
838193 514279
227233 543281
414347 699959
587263 421194
139313 281717
44701 308864
723109 562720
533213 476126
672863 604923
916621 730005
168743 393889
33457 901297
269257 321949
243799 1...
Output
44981350607757576
Judge Output
44981350607757576
Checker Message
1 number(s): "44981350607757576"
Test Case #52
156 ms
22.3 MB
Accepted
Input
78498 483532394181
97859 255677
338993 417870
492467 605195
616243 459335
459421 42481
104651 124253
769541 367508
274871 593806
504797 468097
285977 603827
457411 768866
173729 836816
96431 390316
252709 870380
455219 88411
401671 811172
242807 328...
Output
130919873235461632
Judge Output
130919873235461632
Checker Message
1 number(s): "130919873235461632"
Test Case #53
232 ms
26.6 MB
Accepted
Input
78498 726710478431
590201 859615
224737 60258
20071 860687
491341 641935
834367 713626
219491 999496
779003 547108
209519 247689
140071 899653
851293 56079
323149 846436
657289 515778
603931 418060
909613 409582
846931 778936
442579 188089
913771 31...
Output
90473108613502844
Judge Output
90473108613502844
Checker Message
1 number(s): "90473108613502844"
Test Case #54
274 ms
30.9 MB
Accepted
Input
78498 965593595385
452923 829199
434209 531285
862783 629542
890887 722115
557281 203055
453197 389808
334231 497969
180949 747027
390323 902887
169159 786406
502237 610983
729649 471205
313211 325127
903781 901077
223711 652348
473203 282311
659693...
Output
176385564081928723
Judge Output
176385564081928723
Checker Message
1 number(s): "176385564081928723"
Test Case #55
111 ms
14.7 MB
Accepted
Input
78498 213066646932
375259 574590
564197 259209
376891 365693
362657 769591
284759 883972
147919 555928
885403 640318
415607 246366
959471 714633
312899 582141
56039 184042
379787 459336
319069 73410
343393 392571
329387 366975
694259 343829
474389 1...
Output
13786425189144275
Judge Output
13786425189144275
Checker Message
1 number(s): "13786425189144275"
Test Case #56
158 ms
21.5 MB
Accepted
Input
78498 451949763886
355139 954428
552047 134548
726289 73963
809401 340696
421303 913537
26297 591179
378601 680296
806129 493675
587033 536661
792881 948589
757579 157868
565907 821693
731243 884066
741119 305794
715889 148452
103217 713638
637409 5...
Output
84199682638506609
Judge Output
84199682638506609
Checker Message
1 number(s): "84199682638506609"
Test Case #57
219 ms
26.1 MB
Accepted
Input
78498 690832880840
296753 871774
987997 399441
855619 85353
588871 677957
423887 162598
249059 61958
855697 251704
31663 116534
826289 831946
220933 15094
431441 543947
59113 870728
140831 300474
882653 621173
627433 348771
289543 809073
849203 5916...
Output
138522073059603618
Judge Output
138522073059603618
Checker Message
1 number(s): "138522073059603618"
Test Case #58
304 ms
30.0 MB
Accepted
Input
78498 934010965090
684091 417933
13487 120675
770387 639554
379133 234323
165181 543745
494359 278482
219281 460197
672863 646268
909611 84464
224947 30019
206483 318899
808187 68722
983347 477043
868349 123951
349903 150729
378601 304192
331663 856...
Output
138474712884922802
Judge Output
138474712884922802
Checker Message
1 number(s): "138474712884922802"
Test Case #59
155 ms
19.2 MB
Accepted
Input
78498 375804027036
156361 853662
612809 661914
607573 528838
879707 474236
680027 28824
857053 869403
762241 99318
613699 682917
309433 157826
999451 854782
60689 888924
46757 207268
781211 539240
182981 306451
870223 82644
50821 511914
826381 1094...
Output
34693296776137583
Judge Output
34693296776137583
Checker Message
1 number(s): "34693296776137583"
Test Case #60
198 ms
24.6 MB
Accepted
Input
78498 614687143990
252457 66558
124561 206849
545933 805248
681719 453499
908071 530466
318919 812106
561091 89239
623729 25760
17599 830596
843527 478091
910361 96343
572161 671970
256561 791326
676031 469691
884791 573014
251297 607711
215183 7761...
Output
105879974667383775
Judge Output
105879974667383775
Checker Message
1 number(s): "105879974667383775"
Test Case #61
234 ms
29.2 MB
Accepted
Input
78498 857865228240
22037 279454
979541 751784
21799 114361
920167 432763
826363 97517
243769 754808
415949 46456
126949 111708
40099 503366
490283 877209
47431 560659
120247 912481
778213 819220
308597 632931
523987 63383
729551 479317
872587 667048...
Output
241910657908589585
Judge Output
241910657908589585
Checker Message
1 number(s): "241910657908589585"
Test Case #62
62 ms
10.8 MB
Accepted
Input
78498 101043312491
111337 525054
739787 329423
542987 423474
439 444730
239263 856056
931241 730215
48731 812185
28087 454551
943139 176135
272621 243622
864503 768078
796193 344479
24359 136714
452537 763467
772139 329561
929549 575115
339091 5252...
Output
29961307054881774
Judge Output
29961307054881774
Checker Message
1 number(s): "29961307054881774"
Test Case #63
145 ms
18.6 MB
Accepted
Input
78498 344221396741
501367 351088
825613 86037
749081 574718
262231 340093
195469 606628
334993 204988
876229 143031
608099 157927
174169 263813
195659 466122
167449 545064
321743 630756
646619 72223
885233 336277
442699 962714
670409 555669
588037 5...
Output
21654800910552834
Judge Output
21654800910552834
Checker Message
1 number(s): "21654800910552834"
Test Case #64
195 ms
24.1 MB
Accepted
Input
78498 583104513695
624271 320671
289897 748553
365567 343573
862307 420273
591893 287545
338267 338405
353137 93892
683899 624561
487133 42855
924881 196449
595381 85419
620981 586183
965551 11994
460063 827772
564197 901533
575837 584483
587551 108...
Output
117542138977004144
Judge Output
117542138977004144
Checker Message
1 number(s): "117542138977004144"
Test Case #65
267 ms
28.8 MB
Accepted
Input
78498 821987630649
354401 906847
36583 221123
371779 318109
262553 639417
633767 459095
796709 525619
298943 716540
148403 258889
440009 194444
382463 856655
336767 871425
451961 705883
396637 701484
246931 444676
278543 800669
822037 605612
193283 ...
Output
250351536692575196
Judge Output
250351536692575196
Checker Message
1 number(s): "250351536692575196"
Test Case #66
67 ms
8.9 MB
Accepted
Input
78498 69460682196
10501 970239
212867 138991
148721 848579
699697 515225
6053 457890
100799 927542
171811 187102
14369 557829
44279 633643
146527 946704
166613 423025
954461 464334
324073 667344
669733 843465
103387 522276
999007 483328
644363 2842...
Output
14442246782289572
Judge Output
14442246782289572
Checker Message
1 number(s): "14442246782289572"
Test Case #67
157 ms
21.9 MB
Accepted
Input
100000 454416748484
861053 66419
911689 394489
604579 921975
463 999631
915909659321 133870
954406699429 458031
91603923947 663210
424913 543725
93761 545111
781481 12231
988321 810261
106543 283472
221401 607541
990547 931280
474751 219982
680587 8...
Output
131595601257304996
Judge Output
131595601257304996
Checker Message
1 number(s): "131595601257304996"
Test Case #68
274 ms
27.3 MB
Accepted
Input
100000 760786762742
52291 508630
8059 561423
459353 919191
510253 999739
789323 126218
174259 911244
764683 204065
324953 115234
84253430897 959270
57991 35933
771186162367 169918
972319 768377
105929 287538
327419 81230
816183785687 90757
520703 41...
Output
58346134692860809
Judge Output
58346134692860809
Checker Message
1 number(s): "58346134692860809"
Test Case #69
249 ms
28.8 MB
Accepted
Input
100000 812414812608
859020127061 784033
684918471439 340302
982559 183925
33037 9260
756043 896043
591391 229237
519863 274999
594820691221 594799
818574473033 845572
604609 15205
424139 997061
726589 944214
980802786091 285299
983443 209156
998857 ...
Output
188119070492578296
Judge Output
188119070492578296
Checker Message
1 number(s): "188119070492578296"
Test Case #70
290 ms
29.5 MB
Accepted
Input
100000 885550939955
496073 281096
680987 584042
685019 867787
75193 422338
514021 574618
297469 353444
236563 175847
501001 604109
149689 99125
149623 388174
134857 983147
218521 18423
761377 392397
27583 629332
817463 303096
386896648669 669549
505...
Output
169673788187785374
Judge Output
169673788187785374
Checker Message
1 number(s): "169673788187785374"
Test Case #71
323 ms
31.3 MB
Accepted
Input
100000 999400760356
997123 384179
107180338409 458168
432663877157 236306
322769 720196
251609 900668
625507 578579
189947 158046
419231 125496
432959 364614
570391 967844
641789 765612
159385039361 757775
343141 19011
33826660709 234838
4249527594...
Output
126364687926306779
Judge Output
126364687926306779
Checker Message
1 number(s): "126364687926306779"
Test Case #72
110 ms
14.2 MB
Accepted
Input
100000 198253328203
989783 292644
421123 486028
617237 68101
138289 171798
186253 915962
418279 583284
614609 566883
849601 222017
115837 747423
631259 593218
903682720597 626433
291349 911858
65186676227 493688
55619 807876
745931 969481
747737 106...
Output
17132096373430315
Judge Output
17132096373430315
Checker Message
1 number(s): "17132096373430315"
Test Case #73
306 ms
31.9 MB
Accepted
Input
100000 1000000000000
537743 701340
150518181533 960681
115499 179065
660617 96218
118147 616206
312773 635403
792179 696905
434243 823351
81509 1772
27697 767707
897817 520072
405659 850612
379681 265862
165313 951930
100907080093 140769
9880274357...
Output
238182545452569174
Judge Output
238182545452569174
Checker Message
1 number(s): "238182545452569174"