QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#803740#6405. BarkleyZhaozefeng0409AC ✓100ms50444kbC++142.0kb2024-12-07 18:16:032024-12-07 18:16:04

Judging History

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

  • [2024-12-07 18:16:04]
  • 评测
  • 测评结果:AC
  • 用时:100ms
  • 内存:50444kb
  • [2024-12-07 18:16:03]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long 

using namespace std;

const int N = 1e5 + 10;
const int M = 21;

int n , q;
ll a[N] , f[N] , st[M][N] , Log[N];

vector<pair<ll , int> > nxt[N];

ll gcd(ll a , ll b) {
    if(b == 0) return a;
    return gcd(b , a % b);
}

ll qry(int l , int r) {
    int k = Log[r - l + 1];
    return gcd(st[k][l] , st[k][r - (1 << k) + 1]);  
}

ll res = 0;

void dfs(int l , int r , int k , ll g) {
    if(l > r) {
        res = max(res , g);
        return;
    }
    if(k == 0) {
        res = max(res , gcd(g , qry(l , r)));
        return;
    }
    dfs(l + 1 , r , k - 1 , g);
    for(int i = 0 ; i < nxt[l].size() ; ++ i) {
        ll d = nxt[l][i].first; 
        int p = nxt[l][i].second + 1;
        if(p <= r && r - p >= k - 1) {
            dfs(p + 1 , r , k - 1 , gcd(g , d));
        }
    }
    return;
}

int main(void) {

    // freopen("rand.in" , "r" , stdin);
    // freopen("mine.out" , "w" , stdout);

    scanf("%d%d" , &n , &q);

    for(int i = 1 ; i <= n ; ++ i) {
        scanf("%lld" , &a[i]);
        st[0][i] = a[i];
    }

    Log[1] = 0;

    for(int i = 2 ; i <= n ; ++ i) {
        Log[i] = Log[i >> 1] + 1;
    }

    for(int k = 1 ; (1 << k) <= n ; ++ k) {
        for(int i = 1 ; i + (1 << k) - 1 <= n ; ++ i) {
            st[k][i] = gcd(st[k - 1][i] , st[k - 1][i + (1 << k - 1)]);
        }
    }

    for(int l = n ; l >= 1 ; -- l) {
        vector<pair<ll , int> > T;
        ll lst = 0;
        for(auto o : nxt[l + 1]) {
            ll d = o.first; int r = o.second;
            d = gcd(d , a[l]);
            if(d != lst) T.push_back({d , r});
            lst = d;
        }
        if(a[l] != lst) T.push_back({a[l] , l});
        nxt[l] = T;
    }

    while(q -- ) {
        int l , r , k;
        scanf("%d%d%d" , &l , &r , &k);
        res = 0; dfs(l , r , k , 0);
        printf("%lld\n" , res);
    }

    return 0;
}

/*
4 4
3 2 6 4
1 3 1
2 4 1
1 4 2
1 4 3


5 1
16 12 19 18 20 
1 5 3
*/

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

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 9120kb

input:

4 4
3 2 6 4
1 3 1
2 4 1
1 4 2
1 4 3

output:

3
2
3
6

result:

ok 4 number(s): "3 2 3 6"

Test #2:

score: 0
Accepted
time: 4ms
memory: 13484kb

input:

100 10000
7 25 33 17 13 33 24 29 11 1 3 19 2 20 33 23 14 24 15 12 3 1 5 13 6 35 15 21 10 34 31 19 7 33 17 26 26 1 19 21 31 5 29 20 18 32 19 18 19 31 11 26 6 19 2 26 23 1 4 2 31 21 29 30 1 14 20 23 14 32 4 34 13 29 5 26 24 29 28 5 26 26 21 19 2 33 2 31 30 3 23 24 26 32 36 21 21 11 5 9
56 57 1
90 97 1...

output:

26
1
1
1
1
1
1
1
31
1
1
1
1
1
26
1
1
1
1
1
1
29
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
1
1
1
21
1
1
1
1
1
19
1
1
1
21
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
3
1
2
1
26
1
1
1
1
1
1
1
7
1
1
1
33
1
1
1
1
1
1
2
1
26
1
1
1
2
1
1
1
1
1
1
26
1
1
1
1
31
1
1
2
1
4
29
1
2
1
1...

result:

ok 10000 numbers

Test #3:

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

input:

1000 66666
25 21 18 19 9 34 16 7 36 2 8 10 25 15 34 9 1 34 6 19 20 20 1 16 10 6 10 1 30 34 6 15 15 11 9 4 34 36 27 17 2 2 19 10 4 22 15 16 22 36 27 26 20 23 29 16 27 14 3 31 32 16 5 5 31 13 27 5 17 23 20 19 13 22 30 14 25 13 7 16 10 6 1 6 3 5 36 1 33 22 31 26 28 3 14 14 2 31 35 7 19 30 36 5 3 14 14 ...

output:

1
2
1
1
1
1
1
1
1
1
1
3
1
2
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
17
1
1
1
20
1
1
1
7
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
7
1
2
15
1
3
1
2
1
1
3
4
1
1
1
1
1
31
1
1
1
2
1
1
1
1
27
3
1
1
1
1
4
10
1
1
1
1
17
1
1
1
2
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
8
1
1
17
1
2
1
1
1
30
1
25
1
35
1...

result:

ok 66666 numbers

Test #4:

score: 0
Accepted
time: 19ms
memory: 19576kb

input:

10000 66666
35 30 29 34 3 25 23 29 30 32 34 1 25 1 23 11 10 24 33 25 14 1 16 25 33 5 19 2 16 1 19 14 34 6 26 25 36 35 1 32 35 27 18 3 7 16 10 25 6 21 36 31 24 17 20 12 30 21 25 31 27 22 5 19 6 16 7 26 15 21 32 11 34 4 7 25 34 3 14 13 10 1 28 8 12 24 34 27 17 8 17 32 23 30 23 8 19 22 2 11 23 10 4 30 ...

output:

1
16
2
2
1
23
1
1
1
2
1
3
5
1
1
2
1
1
1
1
30
1
1
1
3
18
1
1
1
1
2
1
1
1
1
1
1
1
1
2
2
1
6
36
1
1
2
19
2
1
1
1
1
1
2
1
1
1
21
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
29
1
1
30
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
2
1
1
1
2
29
1
1
14
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
2
3
1
9
5
1
2
2
1
32
1
1
1
3
2
1
1
...

result:

ok 66666 numbers

Test #5:

score: 0
Accepted
time: 44ms
memory: 28060kb

input:

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

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
2
1
1
7
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
29
1
1
1
1
1
1
1
1
1
1
1
35
3
1
1
20
1
1
1
1
1
1
1
1
1
2
1
1
2
1
1
19
1
1
1
1
1
1
1
1
1
1
1
1
1
1
25
1
1
1
1
1
1
2
13
1
9
25
1
1
1
1
1
1
1
1
2
1
1
1
25
1
18
4
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
23
1
1
1
1
1
33
2...

result:

ok 66666 numbers

Test #6:

score: 0
Accepted
time: 40ms
memory: 26348kb

input:

100000 66666
450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 450283905890997363 45...

output:

450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997363
450283905890997...

result:

ok 66666 numbers

Test #7:

score: 0
Accepted
time: 76ms
memory: 41868kb

input:

100000 66666
701982420492091392 592297667290202112 789730223053602816 369768517790072832 526486815369068544 562220051373121536 701982420492091392 701982420492091392 444223250467651584 592297667290202112 554652776685109248 888446500935303168 623984373770747904 888446500935303168 888446500935303168 55...

output:

9795520512
9795520512
352638738432
9795520512
29386561536
39182082048
117546246144
9795520512
19591041024
9795520512
29386561536
352638738432
176319369216
9795520512
9795520512
58773123072
176319369216
29386561536
9795520512
9795520512
117546246144
29386561536
9795520512
58773123072
117546246144
117...

result:

ok 66666 numbers

Test #8:

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

input:

100000 66666
592297667290202112 623984373770747904 789730223053602816 789730223053602816 789730223053602816 444223250467651584 592297667290202112 554652776685109248 666334875701477376 623984373770747904 888446500935303168 592297667290202112 350991210246045696 789730223053602816 888446500935303168 39...

output:

58773123072
352638738432
705277476864
33853318889472
176319369216
176319369216
313456656384
12694994583552
117546246144
528958107648
1410554953728
4231664861184
528958107648
19042491875328
39182082048
19042491875328
39182082048
3173748645888
528958107648
705277476864
352638738432
4231664861184
17631...

result:

ok 66666 numbers

Test #9:

score: 0
Accepted
time: 75ms
memory: 32872kb

input:

100000 66666
394865111526801408 467988280328060928 888446500935303168 592297667290202112 394865111526801408 394865111526801408 789730223053602816 623984373770747904 932600926626323251 562220051373121536 415989582513831936 267489760325645039 467988280328060928 592297667290202112 789730223053602816 44...

output:

304679870005248
1371059415023616
5484237660094464
824837199746271719
854723856817756836
879549815483199491
152339935002624
3656158440062976
270826551115776
58498535041007616
417942208512
623984373770747904
304679870005248
101559956668416
444223250467651584
914039610015744
685529707511808
88844650093...

result:

ok 66666 numbers

Test #10:

score: 0
Accepted
time: 41ms
memory: 27600kb

input:

100000 66666
298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 298023223876953125 29...

output:

298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953125
298023223876953...

result:

ok 66666 numbers

Test #11:

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

input:

100000 66666
472925401611328125 437893890380859375 375423431396484375 405457305908203125 437893890380859375 788209002685546875 262736334228515625 283755240966796875 262736334228515625 625705718994140625 510759433740234375 472925401611328125 437893890380859375 405457305908203125 472925401611328125 72...

output:

18984375
12814453125
854296875
18984375
2562890625
18984375
21357421875
18984375
18984375
284765625
4271484375
18984375
18984375
284765625
4271484375
18984375
854296875
854296875
474609375
4271484375
12814453125
18984375
854296875
18984375
284765625
94921875
94921875
18984375
18984375
854296875
1423...

result:

ok 66666 numbers

Test #12:

score: 0
Accepted
time: 78ms
memory: 39028kb

input:

100000 66666
339211709033203125 284937835587890625 781869420853171875 930796929587109375 284937835587890625 610581076259765625 615606434912109375 726882233642578125 563074685799609375 603156410372446875 472982736071671875 664854949705078125 927046162700476875 434371900473984375 615606434912109375 72...

output:

826875
385875
2701125
8103375
1157625
2701125
1157625
77175
2701125
8575
77175
4254271875
385875
13505625
53603825625
40516875
1418090625
8103375
202584375
4862025
102102525
77175
231525
77175
1620675
8103375
121550625
4862025
4501875
5955980625
2701125
283618125
46903347421875
89339709375
425427187...

result:

ok 66666 numbers

Test #13:

score: 0
Accepted
time: 81ms
memory: 33736kb

input:

100000 66666
768867187500000000 531441000000000000 410062500000000000 464724384570141087 787320000000000000 896283049339348985 476062296883200000 590490000000000000 205031250000000000 656100000000000000 510183360000000000 768867187500000000 566870400000000000 717445350000000000 498225937500000000 62...

output:

131220000000000
43740000000
27337500000
531441000000000
1093500000000
273375000000
524880000000
265720500000000
262440000000
13668750000
11809800000000
590490000000000
656100000000
24603750000000
151875000000
109350000000
377913600000
398580750000000
82012500000000
1640250000000
397627607007569321
1...

result:

ok 66666 numbers

Test #14:

score: 0
Accepted
time: 34ms
memory: 27892kb

input:

100000 66666
576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 576460752303423488 57...

output:

576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423488
576460752303423...

result:

ok 66666 numbers

Test #15:

score: 0
Accepted
time: 70ms
memory: 38260kb

input:

100000 66666
437718434374464997 437718434374464997 195739344661245593 437718434374464997 255966835326244237 149683028270364277 334725861580473233 75295356187869701 748524423279410557 195739344661245593 334725861580473233 255966835326244237 334725861580473233 572401029566608073 334725861580473233 437...

output:

3757
48841
48841
830297
48841
634933
63869
3757
3757
48841
3757
830297
48841
48841
3757
3757
830297
48841
48841
3757
3757
8254129
48841
3757
10793861
3757
48841
3757
3757
2385443281
3757
3757
48841
140320193
14115049
48841
48841
3757
48841
3757
3757
3757
48841
10793861
48841
48841
48841
48841
3757
8...

result:

ok 66666 numbers

Test #16:

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

input:

100000 66666
45353206897101877 235495977390733981 27509322216274909 640088043733324429 34264426936753621 640088043733324429 142841822351756677 388250124887426293 148095408462214153 17299676857657417 17299676857657417 402529594512709177 17299676857657417 640088043733324429 388250124887426293 56490001...

output:

5917
13354669
97
61
37
1
61
97
1
97
3589
97
1
3589
97
97
1
5917
97
3589
5917
97
5917
97
47929907041
1
4649200982977
1
1
218929
97
97
1
1
1
218929
37
226981
61
2257
1
1
1
1
1
218929
1
97
13354669
2923724329501
912673
1
97
1
1
3589
61
61
218929
5917
4649200982977
1
5917
97
2257
5917
61
5917
1
5917
591...

result:

ok 66666 numbers

Test #17:

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

input:

100000 66666
31378474310796875 66522365538889375 794305606422029988 363314846854706909 25320923395296875 126604616976484375 126685643931349325 298786896064503125 56489143751177548 705137074712227375 784963913358894625 268401787990146875 31378474310796875 156992782671778925 25337128786269865 69263565...

output:

43918715
2884548055
165731
4254708381125
2388766358046875
4143275
1325
184493
800588548081391855
244453225
64780104625
884553481638582020
5064184679059375
219593575
800174948855018885
219593575
14045
922465
370029178193359375
64780104625
828655
184493
987328382667665993
4143275
80277516625
784963913...

result:

ok 66666 numbers

Test #18:

score: 0
Accepted
time: 70ms
memory: 30248kb

input:

100000 66666
338134100426929 519288679363117 797496413920441 606065523119263 444936598813303 519288679363117 248237576380249 519288679363117 795104957145937547 248237576380249 381230296039477 289719846716611 797496413920441 519288679363117 930763755299299 338134100426929 188650674737407 338134100426...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 66666 numbers

Test #19:

score: 0
Accepted
time: 62ms
memory: 31456kb

input:

100000 66666
1053716702538473 41275846970251687 41275846970251687 177149557812239 1053716702538473 1053716702538473 177149557812239 41275846970251687 1053716702538473 245515991691464209 1053716702538473 1053716702538473 160005726539569 41275846970251687 245515991691464209 1053716702538473 4127584697...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9127
1
9127
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9127
1
1
1
1
9127
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9127
1
1
1
1
1
9127
...

result:

ok 66666 numbers

Test #20:

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

input:

100000 66666
41655640594789601 41655640594789601 41655640594789601 41655640594789601 100721707609683701 41655640594789601 100721707609683701 100721707609683701 100721707609683701 243541144463387801 41655640594789601 100721707609683701 41655640594789601 17227591097705501 41655640594789601 10072170760...

output:

1
1
3581
1
1
1481
3581
1481
5303461
5303461
1
1
1
1
3581
1
1481
3581
1
1
1
1
5303461
1
1
1481
1
1
1481
5303461
1
1
1
1
1481
1
1
1
1
1
1
1
1
1481
1
3581
1
1
1
1
1
1
1
1
1
1
1481
5303461
1
5303461
1
1
5303461
1
1
1
5303461
2193361
1
1
1
3581
1481
1
2193361
1
1
1
1
1
1
1
1
1
1
1
1
1
5303461
5303461
148...

result:

ok 66666 numbers

Test #21:

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

input:

100000 66666
977142648636961 977142648636961 977142648636961 977142648636961 977142648636961 977142648636961 72824662358594073 977142648636961 977142648636961 977142648636961 977142648636961 977142648636961 977142648636961 977142648636961 977142648636961 977142648636961 977142648636961 9771426486369...

output:

977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
977142648636961
320578543307887433
977142648636961
982461370523776742
977142648636961
977142648636961
977142...

result:

ok 66666 numbers

Test #22:

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

input:

100000 66666
39302646579895813 92257280832229991 92257280832229991 38805014811590903 38313683824489693 92257280832229991 93440379306034261 93440379306034261 38805014811590903 94638649720590431 93440379306034261 91089162199144621 38313683824489693 38805014811590903 16322063266379399 16115400918867469...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 66666 numbers

Test #23:

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

input:

100000 66666
18986649113634949 149417824264164721 18986649113634949 2412649537226281 18986649113634949 306577414194589 2412649537226281 2412649537226281 18986649113634949 2412649537226281 149417824264164721 2412649537226281 2412649537226281 18986649113634949 2412649537226281 2412649537226281 3065774...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 66666 numbers

Test #24:

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

input:

100000 66666
523941011210103901 523941011210103901 927478369620543313 295979067781577977 523941011210103901 295979067781577977 523941011210103901 167201281614739429 295979067781577977 523941011210103901 523941011210103901 927478369620543313 927478369620543313 167201281614739429 927478369620543313 16...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
550909
1
1
1
537255822253
1
1
975217
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
975217
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
752045370831378182
1
1
1
1
1
1
1
1
1
1
1
1
1
537255822253
975217
1
1
1
1
975217
...

result:

ok 66666 numbers

Test #25:

score: 0
Accepted
time: 77ms
memory: 28628kb

input:

100000 66666
119336946756580697 21407447765136011 3840209023880993 142689178022006377 99806495899686217 17903946813319771 99806495899686217 621161893216905093 823684604342419 142689178022006377 21407447765136011 99806495899686217 17903946813319771 21407447765136011 21407447765136011 3840209023880993...

output:

522553
93739
1
853776535995198818
93739
1
478300669305073451
151605490118300919
1
1
522553
1
1
1
522553
809559597344142227
1
1
93739
190997843089
93739
648193084672583815
1
1
1
40967036387
1
522553
1
119336946756580697
1
1
1
335265327363373768
1
1
99806495899686217
93739
1
1
1
1
1
1
228372905249
1
4...

result:

ok 66666 numbers

Test #26:

score: 0
Accepted
time: 79ms
memory: 49772kb

input:

100000 66666
12600 320892 5353920 1290240 5483520 24806400 7920640 9175040 34546176 1146880 38535168 260112384 132710400 3371335680 6955597824 644087808 4128768000 33973862400 2179989504 84557168640 66303557632 52781121536 434865438720 642634481664 1449551462400 7187359334400 1855425871872 460812409...

output:

1
1
1
1
1
2
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
2
1
2
2
1
2
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
2
1
2
1
1
1
1
2
2
2
1
1
1
2
1
1
1
1
1
2
2
1
1
1
2
1
1
2
2
1
1
2
1
2
1
2
1
1
1
2
2
1
1
2
1
2
1
1
1
2
1
1
2
1
1
2
2
2
1
2
1
1
1
1
1
1
2
1
1
2
1
1
1
2
1
1
1
1
2
4
1
1
1
1
1
1
1
1
1
2
2
1
2
1
1
2
1
1
1
2
1
1
1
2
...

result:

ok 66666 numbers

Test #27:

score: 0
Accepted
time: 81ms
memory: 50444kb

input:

100000 66666
129200 677376 8400 707616 984960 64512 3686400 7879680 14745600 716513280 119848960 61931520 466944000 153354240 2913730560 14863564800 807403520 8925478912 39118700544 234712203264 635311226880 45298483200 1162661068800 646862340096 516402708480 841813590016 33661806182400 782757789696...

output:

4
2
2
2
2
4
2
4
1
4
2
2
4
4
2
2
2
4
268435456
4
4
2
2
2
2
4
2
2
2
1
2
2
2
2
4
2
8
4
2
2
1
1
1
2
2
1
2
2
4
2
2
2
4
1
4
2
4
2
2
16
4
4
1
2
2
4
2
2
2
4
2
2
2
2
2
2
8
4
1
4
2
8
2
4
2
2
16
4
4
2
1
16
4
4
2
1
2
2
2
2
2
2
16
1
2
1
4
1
16
2
32
1
4
8
8
2
4
4
1
1
1
2
2
2
2
2
32
4
2
2
2
2
2
8
2
2
2
2
1
2
2
16
...

result:

ok 66666 numbers

Test #28:

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

input:

100000 66666
59850 6720 109440 12403200 13440 614400 9139200 716800 40857600 171601920 453246976 7667712 53084160 1120665600 12582912 190716211864194797 377487360 1585446912 24914165760 83969966080 21139292160 70128762880 110578630656 34225520640 4177124130816 16234976378880 33919504220160 901943132...

output:

8
268435456
4
16
4
16
16384
4
8
4
8
96
16
4
4
2199023255552
256
4398046511104
36028797018963968
8
2
1024
16
256
4
8
128
262144
9007199254740992
68719476736
17179869184
4
262144
512
8
536870912
131072
268435456
16
4
1
1073741824
8
4
16
4
2
134217728
32
32
8
8
2
8
16
16
4
4
16
8
16
2
16777216
17179869...

result:

ok 66666 numbers

Test #29:

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

input:

100000 66666
16320 465920 4608 330480 4202496 614400 10886400 226492416 18264064 982333440 98058240 44564480 555089920 86507520 792723456 1804861440 32487505920 30198988800 192367558656 24914165760 889435717632 471104225280 1848178114560 124570828800 27058293964800 34321321355118415 17797270732800 4...

output:

16
533874399602908432
33554432
384
512
4503599627370496
33554432
17592186044416
9007199254740992
4194304
33554432
8589934592
4503599627370496
70368744177664
17179869184
2097152
8
1024
268435456
33554432
8
72057594037927936
18014398509481984
857414636395720789
3092376453120
262144
5308416
28147497671...

result:

ok 66666 numbers

Test #30:

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

input:

100000 66666
702345691905 934867260198872280 1668603098344 211680 4164496808472 296783257205991200 2118689870000 32400 504787491936 901479143763198270 1983093718320 77440 212177160072 140230089029830842 7334519113600 68040 2797364017812 120197219168426436 1739020645296 36465 1067819694480 7345385615...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 66666 numbers

Test #31:

score: 0
Accepted
time: 67ms
memory: 32404kb

input:

100000 66666
286023132450 740103247657440555 1223138922768 233928 404477157000 289363675775841420 2283562463520 9600 155319228288 949706423059171840 67605467670 20328 127121392200 320525917782470496 4979922756984 11088 4193619163776 624357777347103987 2095576889600 397488 1747341318240 6009860958421...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
12
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1...

result:

ok 66666 numbers

Test #32:

score: 0
Accepted
time: 59ms
memory: 31948kb

input:

100000 66666
938675916495 816153957316475800 2062833500700 302328 1682624973120 183634640396207055 1735207003530 59136 7544076802560 434045513663762130 304897897683346052 68640 3559398981600 641051835564940992 2542427844000 1100 190682088300 213683945188313664 15809278593600 9504 199696150656 467433...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
2
2
1
2
1
1
1
1
1
2
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
2
2
1
1
1
1
1
1
1
1
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
2
1
6
1
1
2
1
4
1
2
2
1
2
1
2
3
1
1
2
1
1
1
2
1
1
1
1
...

result:

ok 66666 numbers

Test #33:

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

input:

100000 66666
3182657401080 457046216097226448 46803785310 113807937197721993 1464785132850 701150445149154210 409870185760 4356 86288460160 340558787643874902 27735576480 1440 6712009508160 133552465742696040 612911973097553748 21658 32049999488 930415511340782412 1941028093992 96900 4271278777920 1...

output:

110612220752176565
693389412
2
26
2
45
1
4
210
3
4
1
16
12
1
696598974301538395
2
2
4
432156061661681961
4
583424347568553160
2
2
2
6
16
2
2
4
19260817
3
5
4
4160336472
4
1
2
2
353126150042911885
4
1
1
1
507620739797810562
2
510
2
4
4
607756552146080620
562477229833154225
8
318934077250808299
4
5777...

result:

ok 66666 numbers

Test #34:

score: 0
Accepted
time: 70ms
memory: 35912kb

input:

100000 66666
251997480 1777742222400 497762844593777280 444257781377760 319996800 43890 161998380 66665333340000 767976960230399232 26879462402688 623993760 86400 10751892480 1617247654561728 341323093435732992 959980800096 1763982360 86632 2822371776 115597688011560 133329333373333200 3384821191449...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
2
2
1
1
1
...

result:

ok 66666 numbers

Test #35:

score: 0
Accepted
time: 63ms
memory: 34980kb

input:

100000 66666
16455835440 1343973120134400 296287407496296000 836249941416960 3225567744 20160 2495975040 106664533344000 293324533421333040 286714265628672 201597984 302400 3059969400 19199616001920 211549208952355344 2073558528207360 647993520 480 24076559232 561588768056160 136884782263288752 4607...

output:

1
1
1
1
1
1
2
1
1
1
1
2
1
1
1
6
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
2
1
1
1
1
2
1
2
1
2
1
1
4
1
2
1
1
1
1
1
1
1
1
1
1
2
1
2
1
1
1
1
1
1
1
1
1
1
4
1
1
3
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
4
2
1
...

result:

ok 66666 numbers

Test #36:

score: 0
Accepted
time: 75ms
memory: 33088kb

input:

100000 66666
5279947200 483545884492800 472874702364088416 388792224038880 13463865360 470016 1468785312 4159916800416 251844296371851600 70398592007040 17099829000 208080 6527934720 604432355616000 234659626737066432 195836083219584 25535744640 38016 30506361600 112317753611232 303990880091199696 5...

output:

1
3
6
2
2
16
1
2
2
2
2
6
4
2
9
2
2
1
2
2
2
2
3
753480753110112601
72
2
2
3
2
4
1
2
3
2
2
24
2
6
1
12
2
2
2
2
2
1
1
5333280
1
4
2
2
2
1
4
12
2
8
1
1
2
2
4
1
12
2
6
1
2
2
2
6
6
1
2
1
2
2
48
2
2
4
2
1
6
2
2
2
1
36
2
2
8
3
4
12
12
2
2
1
2
1
288
2
2
4
2
12
2
72
2
8
144
2
4
1
2
2
2
1
8
1
36
2
2
4
2
6
2
4
...

result:

ok 66666 numbers

Test #37:

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

input:

100000 66666
12767872320 71180798584896 410654346789866256 2572464105501696 7937920620 405000 3079969200 159996800016000 223993280067199776 1295974080129600 538336467770058785 16800 294663720 127109109040319086 194251755348473335 165074640480215327 27647723520 311168 50999490 403191936040320 9481197...

output:

108
637746924913004448
24
254432920168732434
12
4
3
144
4799952
24
1599984
12
24
4
4799952
24
7253188267392
36
36
6
18
64
6
4
2
57599424
8
12
1152
133330666680
9
24
1512
36
763728881041030964
4
3
4
12
48
2133312
6
6
395751684040370021
48
8
3
4
162
6
799992
144
36
32
230397696
120
4
17225693193770302...

result:

ok 66666 numbers

Test #38:

score: 0
Accepted
time: 61ms
memory: 28912kb

input:

100000 66666
73580591259630 996491788296388609 21993319585296 53040 50311515391200 996491788296388609 105654182321520 141570 197221140333504 996491788296388609 76814902963350 18816 1612164630095 996491788296388609 27311965498080 25344 9391482873024 996491788296388609 13416404104320 184800 3563732340...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 66666 numbers

Test #39:

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

input:

100000 66666
80498424625920 996491788296388609 87326416000440 6528 36984953278650 996491788296388609 10589376096624 44352 30546277201800 996491788296388609 13584109155624 2400 8145673920480 996491788296388609 9702935111160 25920 27311965498080 996491788296388609 323431170372000 93600 65404970008560 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 66666 numbers

Test #40:

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

input:

100000 66666
37949257323648 996491788296388609 190608769739232 290700 383325831552 996491788296388609 33960272889060 1280 79659899369400 996491788296388609 2587449362976 8736 112661857679580 996491788296388609 46717835720400 336600 43528445012565 996491788296388609 355774287409200 82944 503115153912...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
998244353
1
1
1
1
117298098427712176
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
127775277184
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 66666 numbers

Test #41:

score: 0
Accepted
time: 62ms
memory: 28324kb

input:

100000 66666
263919835023552 996491788296388609 43603313339040 16380 28110560980480 996491788296388609 210829207353600 23040 5576192955858 996491788296388609 2036418480120 64800 402492123129600 996491788296388609 4438194393438 276480 23670370098336 996491788296388609 471710957932644491 26400 1149977...

output:

1
1
998244353
1
1
1
998244353
1
998244353
1
998244353
1
4
998244353
2
1
1
10
1
1
1
1
1
4
1
998244353
1
1
1
1
1
1
1
8
90463323055818757
1
574880278545664076
4
15
1
1
1
12
1
1
1
1
941249530677884727
1
1
1
1
1
1
1
998244353
1
996491788296388609
1
1
720
8
1
1
1
1
1
1
1
1
996491788296388609
1
1
1
34
1
1
...

result:

ok 66666 numbers

Test #42:

score: 0
Accepted
time: 94ms
memory: 45840kb

input:

100000 66666
573440000000000000 615726511554560000 939524096000000000 501760000000000000 234881024000000000 822083584000000000 841813590016000000 822083584000000000 587202560000000000 439040000000000000 420906795008000000 469762048000000000 939524096000000000 939524096000000000 538760697610240000 20...

output:

11468800
5734400
5734400
2867200
2867200
5734400
11468800
91750400
5734400
22937600
5734400
22937600
114688000
22937600
2867200
22937600
3670016000
5734400
2867200
11468800
2867200
2867200
11468800
458752000
1146880
2867200
5734400
11468800
11468800
11468800
11468800
2867200
22937600
11468800
573440...

result:

ok 66666 numbers

Test #43:

score: 0
Accepted
time: 99ms
memory: 47340kb

input:

100000 66666
639106080130990080 832169375170560000 863964909158400000 426070720087326720 758314343124172800 718994340147363840 852141440174653440 902961561600000000 780158789222400000 975198486528000000 520105859481600000 702142910300160000 552313896409497600 346737239654400000 585119091916800000 86...

output:

15482880
2580480
10321920
7741440
2580480
2580480
1290240
3870720
2580480
1290240
7741440
61931520
3870720
10321920
3870720
15482880
30965760
92897280
15482880
7741440
2580480
7741440
2580480
7741440
2580480
3870720
2580480
2580480
2580480
2580480
7741440
3870720
3870720
371589120
3870720
1290240
25...

result:

ok 66666 numbers

Test #44:

score: 0
Accepted
time: 54ms
memory: 37000kb

input:

100000 66666
239735288231341903 903617624871981019 202852936195750841 903617624871981019 575029397645806103 903617624871981019 903617624871981019 575029397645806103 903617624871981019 903617624871981019 202852936195750841 365927798501876611 903617624871981019 152558819783581211 903617624871981019 90...

output:

117766649
16823807
824366543
16823807
117766649
5770565801
117766649
16823807
117766649
117766649
117766649
16823807
117766649
16823807
824366543
117766649
117766649
16823807
117766649
117766649
16823807
117766649
16823807
16823807
16823807
16823807
117766649
16823807
16823807
117766649
16823807
824...

result:

ok 66666 numbers

Test #45:

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

input:

100000 66666
852992000000000000 533120000000000000 597094400000000000 599196172288000000 545914880000000000 682393600000000000 468122009600000000 511101108224000000 298547200000000000 978279464960000000 653072000000000000 218365952000000000 207155200000000000 457150400000000000 373184000000000000 60...

output:

761600
15232000
7616000
761600
3046400
1523200
1523200
1904000
761600
761600
1523200
1904000
1523200
1523200
1523200
1523200
3808000
1523200
761600
1523200
1523200
1523200
304640000
761600
121856000
761600
15232000
1523200
3046400
7616000
1523200
3808000
1523200
1523200
1523200
304640000
1523200
761...

result:

ok 66666 numbers

Test #46:

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

input:

100000 66666
780938948011622400 941525544960000000 697266917867520000 759246199455744000 803435131699200000 941525544960000000 662833983651840000 830425530654720000 741451366656000000 692021275545600000 828542479564800000 790881457766400000 292919058432000000 565618332716236800 645886523842560000 60...

output:

2882880
240240
240240
120120
240240
1441440
240240
360360
360360
720720
5765760
2882880
240240
960960
720720
120120
360360
240240
120120
25945920
8648640
240240
120120
2882880
240240
2882880
360360
34594560
960960
1441440
1441440
4324320
2882880
360360
1441440
360360
240240
720720
720720
1441440
720...

result:

ok 66666 numbers

Test #47:

score: 0
Accepted
time: 99ms
memory: 47804kb

input:

100000 66666
657391389557760000 986087084336640000 417190689527040000 206020093593600000 758528526412800000 734255613567590400 263377960560000000 584347901829120000 812440471265280000 358577121576960000 971146370937600000 905497781760000000 512006755328640000 535652243343360000 951004849766400000 24...

output:

995280
995280
2985840
995280
995280
1990560
995280
995280
5971680
995280
5971680
995280
995280
2985840
2985840
5971680
995280
5971680
995280
5971680
995280
2985840
5971680
2985840
995280
35830080
995280
995280
5971680
2985840
995280
995280
995280
995280
995280
2985840
995280
995280
995280
2985840
99...

result:

ok 66666 numbers

Test #48:

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

input:

100000 66666
419046600341796875 318475416259765625 174779308443359375 162487457275390625 338857842900390625 821331336669921875 821331336669921875 821331336669921875 445865582763671875 318475416259765625 617452337646484375 242041316357421875 821331336669921875 617452337646484375 229972774267578125 44...

output:

3574375
3574375
3574375
3574375
3574375
3574375
3574375
3574375
3574375
3574375
3574375
17871875
3574375
3574375
3574375
17871875
17871875
3574375
3574375
17871875
3574375
3574375
3574375
3574375
3574375
3574375
3574375
3574375
17871875
3574375
17871875
17871875
3574375
3574375
3574375
3574375
35743...

result:

ok 66666 numbers

Test #49:

score: 0
Accepted
time: 51ms
memory: 34388kb

input:

100000 66666
29066130815063969 103298447991802393 374334258938883617 925384490367966827 296394347797533667 114465847774699949 97767894559760623 313560033926335867 304856395292880233 313560033926335867 108337396674329339 354292567502536487 108337396674329339 39010443836202949 27714217753898203 932205...

output:

33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
33724427
337...

result:

ok 66666 numbers

Test #50:

score: 0
Accepted
time: 78ms
memory: 38372kb

input:

100000 66666
684189444633773312 535408603862819648 170055338199605248 626414780946202144 170055338199605248 108124127292777856 100346068411130464 224526188716666304 702806827403056064 99309660393910096 342094722316886656 259784056312137344 237222165565425664 684189444633773312 552679849148717056 842...

output:

35722726
35722726
71445452
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
35722726
357...

result:

ok 66666 numbers

Test #51:

score: 0
Accepted
time: 96ms
memory: 30084kb

input:

100000 66666
122126108798870136 86243695388892828 332742712500400384 463120265715701496 435163158471516208 307685269172270448 1273379044464106 341265583916380408 317210174405127588 38094524408929872 63436867432055645 38908918689626765 6042645311576616 361551611142667524 21760333505891100 41489702551...

output:

637919697459080
842702945889877
1366092560876296
187511782927010
1705092415624864
1839940742250753
847520305471025
5918695551610338
746029376040723
959615425979500
595685721034846
312844740200539
113315757242939
4609845145673388
2696897898719548
1060637201945508
233833810908775
1650894295397038
5934...

result:

ok 66666 numbers

Test #52:

score: 0
Accepted
time: 99ms
memory: 30032kb

input:

100000 66666
4718757343745970 195041970208166760 52733845352544324 61971891253719972 3434737997427612 655176273009316989 45974790059441148 103443277633742583 77031856083181629 16876237021757106 187829413488973380 585906589818829866 191070900359576112 293381914381902328 48525042005532640 473415043956...

output:

777573363257272
487579101388757
882546416739318
424550268183095
715386342100388
104831501790588
1571259630449703
859449005124653
412695447812658
2299441240891284
2057792476222338
4906661540708601
2460985530611724
797987771418207
996897717449632
688055019243931
436924095438225
580763091167361
6223990...

result:

ok 66666 numbers

Test #53:

score: 0
Accepted
time: 91ms
memory: 29132kb

input:

100000 66666
571086778981823990 596027858914960760 15141121228914330 7298796900092036 553320110884294675 250801376893283315 277137384255712617 440748611105470668 580208598103664496 716445423625243176 106774844132895200 179381738143263936 191634166462491252 138182005536899904 189415678015350780 84335...

output:

229916123745579
485485328244083
820827772197323
417472949844720
306552567292473
42805654944217
465275463430350
405250542256545
162991587884591
971658364334212
601498220181162
6321511380234568
426491107177841
557849214303430
2400308891286751
345174111413194
816122466145833
6953000436506030
4938305869...

result:

ok 66666 numbers

Test #54:

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

input:

100000 66666
343930683869819808 685981965095542240 367300520229599810 374737426151009030 52562071848257622 174789746860475743 117010873240476574 2946316952098331 213819549958301786 57789067556297780 281897494958107200 54051142101112000 255611935911757152 205762305256767168 148999148615031650 4859664...

output:

1566886658106438
224229988670736
1047102551474992
1960222620481215
1154777959510737
143384319809735
28556356787296450
1713137789792900
32860541051904489
1937495949340861
2826761557969316
4382559472563180
922011685616736
5763688037082269
919965776172072
1045211301754365
730731491137445
18168839572609...

result:

ok 66666 numbers

Test #55:

score: 0
Accepted
time: 94ms
memory: 29216kb

input:

100000 66666
620259028719829907 614509234710839595 598750122596122636 440018585779641296 230635646642946350 130575258407083472 311347226950872231 151718856551117877 275994350335600832 301537096700794659 114430355852500506 327433677420638152 36838455506273740 51071495133697685 344053912841786532 7345...

output:

953994114554162
1640626094500347
931343062661325
3936472662545752
624534797777159
747852822562786
279034892389591
156441699494019
591680804664895
2701500352710162
58636283890991
2234602818196452
2215656571410776
4559931093613728
576244526804392
1372716731802470
7274761010490216
339736562917588
67236...

result:

ok 66666 numbers

Test #56:

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

input:

100000 66666
1951804822934022 19703934402952984 4973496529417839 15901179044758443 429279004620000040 860509277442818262 88544738421345856 91418185461461647 130991425567365384 67055134516627518 169241023867052250 224977734393934791 38886301531672260 495377667338259660 107836283088266846 213693918780...

output:

947773045296905
9153743641862666
376209992752234
560693688963835
727899436815173
8022786660420075
9507585321689169
983935268752041
419768651707298
138758714687280
907213241391463
479816214160810
294700544550561
1634229184734650
923783819330466
895052044855553
918999040694142
333315602857935
13865412...

result:

ok 66666 numbers