QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#269510#5738. Square Sumucup-team1198#TL 350ms3572kbC++202.3kb2023-11-29 18:00:172023-11-29 18:00:18

Judging History

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

  • [2023-11-29 18:00:18]
  • 评测
  • 测评结果:TL
  • 用时:350ms
  • 内存:3572kb
  • [2023-11-29 18:00:17]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pii pair<int, int>
#define ld long double
#define all(a) (a).begin(), (a).end()

#define int int64_t

int get2(int z, int k) {
    z %= (1ll << k);
    if (k == 0) return 1;
    if (k == 1) return 2;
    if (k == 2) {
        if (z == 0) return 4;
        if (z == 1) return 8;
        if (z == 2) return 4;
        return 0;
    }
    if (z % 4 == 0) {
        return get2(z / 4, k - 2) * 4;
    }
    if (z % 8 == 2 || z % 8 == 1 || z % 8 == 5) {
        return (1ll << (k + 1));
    }
    return 0;
}

int getp(int z, int p) {
    z %= p;
    int x = -1;
    int res = 1;
    int n = (p - 1) / 2;
    while (n) {
        if (n % 2 == 0) {
            x *= x;
            n /= 2;
        } else {
            res *= x;
            n--;
        }
    }
    if (z == 0) {
        if (res == 1) {
            return 2 * p - 1;
        } else {
            return 1;
        }
    }
    return p - res;
}

int getpa(int z, int p, int a) {
    if (a == 0) {
        return 1;
    }
    if (z % p != 0) {
        int res = getp(z, p);
        for (int i = 1; i < a; ++i) {
            res *= p;
        }
        return res;
    }
    int res = getp(0, p) - 1;
    for (int i = 1; i < a; ++i) {
        res *= p;
    }
    if (a == 1) {
        ++res;
        return res;
    }
    if (z % (p * p) == 0) {
        res += getpa(z / p / p, p, a - 2) * p * p;
        return res;
    }
    return res;
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
        int m, n;
        cin >> m >> n;
        for (int i = 0; i < n; ++i) {
            int z;
            cin >> z;
            /// z = i;
            int ans = 1;
            int m1 = m;
            int k = 0;
            while (m % 2 == 0) {
                m /= 2;
                ++k;
            }
            ans *= get2(z, k);
            for (int p = 3; p * p <= m; ++p) {
                if (m % p == 0) {
                    int a = 0;
                    while (m % p == 0) {
                        m /= p;
                        ++a;
                    }
                    ans *= getpa(z, p, a);
                }
            }
            if (m != 1) {
                ans *= getp(z, m);
            }
            m = m1;
            cout << ans << " ";
        }
        cout << "\n";
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 3
0 1 2

output:

1 4 4 

result:

ok 3 number(s): "1 4 4"

Test #2:

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

input:

4 4
0 1 2 3

output:

4 8 4 0 

result:

ok 4 number(s): "4 8 4 0"

Test #3:

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

input:

5 1
3

output:

4 

result:

ok 1 number(s): "4"

Test #4:

score: 0
Accepted
time: 16ms
memory: 3388kb

input:

735134400 100000
4 4 1 2 3 4 4 4 5 4 3 4 1 1 1 1 2 0 1 4 4 5 4 1 0 0 1 3 0 4 0 5 3 0 3 0 5 4 0 0 3 2 5 3 2 4 3 4 2 1 3 3 2 2 2 3 1 0 1 2 3 4 3 5 4 4 0 1 5 2 2 3 3 2 4 3 5 5 1 3 1 1 4 3 4 3 4 5 2 4 1 3 2 0 5 0 0 5 5 1 2 0 3 4 0 4 1 0 1 4 5 5 3 1 3 0 3 5 0 4 2 0 4 0 0 0 4 0 2 2 2 4 5 3 0 2 0 4 1 4 1 2...

output:

1698693120 1698693120 1698693120 1698693120 0 1698693120 1698693120 1698693120 3397386240 1698693120 0 1698693120 1698693120 1698693120 1698693120 1698693120 1698693120 30888000 1698693120 1698693120 1698693120 3397386240 1698693120 1698693120 30888000 30888000 1698693120 0 30888000 1698693120 30888...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 21ms
memory: 3396kb

input:

735134400 100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 30888000 308...

result:

ok 100000 numbers

Test #6:

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

input:

536870912 100000
1 0 2 4 3 1 3 5 5 1 0 2 1 1 1 0 4 2 4 1 3 2 1 4 3 2 1 2 4 0 4 2 2 1 5 4 1 5 3 0 2 3 4 4 3 4 2 1 2 5 2 1 5 3 1 3 3 0 0 4 3 4 0 4 2 0 5 2 0 3 1 0 0 1 5 5 5 5 5 1 5 3 1 2 4 1 3 3 2 0 2 0 5 1 0 2 1 2 5 2 5 4 4 3 0 3 3 5 4 3 3 2 0 2 1 2 0 1 4 1 1 4 2 4 1 2 4 4 4 2 3 4 5 5 5 4 3 5 5 2 1 5...

output:

1073741824 536870912 1073741824 1073741824 0 1073741824 0 1073741824 1073741824 1073741824 536870912 1073741824 1073741824 1073741824 1073741824 536870912 1073741824 1073741824 1073741824 1073741824 0 1073741824 1073741824 1073741824 0 1073741824 1073741824 1073741824 1073741824 536870912 1073741824...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 18ms
memory: 3556kb

input:

536870912 100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 ...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 22ms
memory: 3304kb

input:

536870912 100000
268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268435456 268...

output:

536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 ...

result:

ok 100000 numbers

Test #9:

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

input:

536870912 100000
504070704 500101584 484480320 75189632 133364432 237444928 506874208 477655312 261146688 36394912 312952944 260479168 77969872 60413040 249853392 288067360 129948656 311385424 444949024 339508400 62885472 368704208 379750624 528964784 158077280 415604832 393291776 342918080 20621644...

output:

0 1073741824 1073741824 0 1073741824 1073741824 0 1073741824 1073741824 1073741824 0 0 1073741824 0 1073741824 1073741824 0 1073741824 1073741824 0 0 1073741824 0 0 0 0 1073741824 0 1073741824 0 0 1073741824 1073741824 1073741824 0 0 0 1073741824 0 0 0 0 0 0 1073741824 1073741824 0 1073741824 0 0 0 ...

result:

ok 100000 numbers

Test #10:

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

input:

536870912 100000
485294080 49414144 71499776 405143552 295436288 188612608 153288704 515768320 24248320 34471936 173539328 437387264 413663232 516947968 112263168 442826752 346488832 22151168 244514816 194510848 259260416 115015680 21757952 496828416 79429632 518979584 65011712 74317824 439812096 44...

output:

1073741824 1073741824 0 0 0 0 0 0 1073741824 0 0 1073741824 1073741824 1073741824 1073741824 1073741824 0 1073741824 0 0 1073741824 0 0 1073741824 0 0 0 0 0 1073741824 1073741824 0 0 1073741824 0 0 1073741824 1073741824 1073741824 0 1073741824 1073741824 1073741824 1073741824 0 1073741824 0 0 0 1073...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 20ms
memory: 3400kb

input:

536870912 100000
0 268435456 0 0 268435456 268435456 0 0 0 0 268435456 0 268435456 0 268435456 0 0 0 0 0 268435456 268435456 268435456 268435456 0 0 268435456 268435456 268435456 0 268435456 268435456 0 268435456 0 268435456 0 0 268435456 0 0 0 268435456 268435456 0 268435456 268435456 268435456 0 2...

output:

536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 ...

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 240ms
memory: 3560kb

input:

779796616 100000
495020978 289673094 752654486 745889165 186463032 629831042 568084109 351140037 633863589 766446110 731514155 674603390 119159255 209998056 365491910 488229083 674872263 239261773 726348242 127803836 478298775 449657268 316649799 497847195 529645573 633328344 385144015 422155171 520...

output:

1569924096 0 0 1569924096 784962048 1569924096 1569924096 1569924096 1569924096 0 0 0 0 784962048 0 0 0 1569924096 1569924096 784962048 0 784962048 0 0 1569924096 784962048 0 0 784962048 0 1569924096 0 0 1569924096 0 0 1569924096 0 1569924096 1569924096 0 0 784962048 1569924096 784962048 784962048 0...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 350ms
memory: 3356kb

input:

448340770 100000
17590207 378448283 377356435 142317962 32832284 283362954 431249178 350392871 210493301 353126480 88048955 133187907 155481936 36161241 120732436 163213003 410911210 27608106 348596232 178846917 22097057 75219456 295899274 238130211 383793986 278864287 345593615 417444550 409017940 ...

output:

358988288 358988288 807723648 358988288 358988288 358988288 358988288 358988288 358988288 807723648 807723648 358988288 358988288 358988288 358988288 358988288 807723648 358988288 358988288 358988288 358988288 358988288 358988288 358988288 358988288 358988288 807723648 807723648 807723648 807723648 ...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 23ms
memory: 3392kb

input:

266069635 100000
146486161 131831810 57279849 256487214 256048395 50362550 260854940 241073971 32811964 107121487 261768591 182834801 159474905 43026229 19974995 164881566 246287652 239486995 67200667 74910586 221718783 237592156 221561959 202289915 19119390 113997936 191068379 75123564 133679363 16...

output:

404490240 441262080 196116480 8171520 898283520 441262080 441262080 8171520 196116480 0 196116480 196116480 441262080 196116480 441262080 196116480 0 441262080 196116480 8171520 408576000 196116480 196116480 441262080 910103040 17024000 196116480 196116480 196116480 441262080 196116480 196116480 196...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 7ms
memory: 3384kb

input:

1 100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

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 100000 numbers

Test #16:

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

input:

2 100000
1 0 0 1 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 1 1 0 0 1 0 1 0 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 0 1 0 0 0 0 1 1 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 0 0 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 0...

output:

2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 8ms
memory: 3356kb

input:

3 100000
2 0 0 0 2 1 0 2 2 0 1 2 2 0 2 1 0 2 1 0 2 1 2 0 2 0 2 1 2 2 0 0 0 0 1 2 1 1 0 0 0 0 0 2 1 1 0 2 0 2 1 1 2 1 0 0 2 1 1 1 1 2 1 0 2 0 1 0 1 0 0 1 1 0 1 0 0 1 1 1 2 0 2 0 2 2 0 0 1 2 1 0 0 0 1 0 0 0 0 1 1 0 0 2 1 2 2 1 1 2 0 1 2 1 0 2 0 2 1 2 0 0 1 2 2 0 2 2 1 1 1 0 1 2 0 1 1 1 0 1 2 2 1 1 2 0...

output:

4 1 1 1 4 4 1 4 4 1 4 4 4 1 4 4 1 4 4 1 4 4 4 1 4 1 4 4 4 4 1 1 1 1 4 4 4 4 1 1 1 1 1 4 4 4 1 4 1 4 4 4 4 4 1 1 4 4 4 4 4 4 4 1 4 1 4 1 4 1 1 4 4 1 4 1 1 4 4 4 4 1 4 1 4 4 1 1 4 4 4 1 1 1 4 1 1 1 1 4 4 1 1 4 4 4 4 4 4 4 1 4 4 4 1 4 1 4 4 4 1 1 4 4 4 1 4 4 4 4 4 1 4 4 1 4 4 4 1 4 4 4 4 4 4 1 1 1 4 4 ...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 8ms
memory: 3572kb

input:

4 100000
0 2 2 2 3 0 0 0 2 1 3 3 3 3 0 2 2 2 1 0 3 3 1 3 3 2 3 1 2 1 3 1 2 3 1 3 2 2 2 3 0 0 0 2 2 0 2 0 2 2 3 1 3 3 1 3 1 2 3 1 1 0 1 3 1 1 1 1 3 3 0 2 3 0 2 3 2 3 3 2 2 0 3 1 2 1 2 3 2 0 1 0 3 1 1 3 1 1 0 1 3 1 3 0 1 0 1 1 1 3 2 0 3 3 0 1 2 1 2 0 2 3 1 1 0 0 0 3 3 1 3 3 0 3 1 1 2 3 1 2 3 2 2 1 2 0...

output:

4 4 4 4 0 4 4 4 4 8 0 0 0 0 4 4 4 4 8 4 0 0 8 0 0 4 0 8 4 8 0 8 4 0 8 0 4 4 4 0 4 4 4 4 4 4 4 4 4 4 0 8 0 0 8 0 8 4 0 8 8 4 8 0 8 8 8 8 0 0 4 4 0 4 4 0 4 0 0 4 4 4 0 8 4 8 4 0 4 4 8 4 0 8 8 0 8 8 4 8 0 8 0 4 8 4 8 8 8 0 4 4 0 0 4 8 4 8 4 4 4 0 8 8 4 4 4 0 0 8 0 0 4 0 8 8 4 0 8 4 0 4 4 8 4 4 0 8 4 4 ...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 8ms
memory: 3288kb

input:

5 100000
4 0 0 4 1 4 2 0 4 0 4 3 3 4 2 1 3 0 0 2 4 0 4 3 0 0 3 2 0 0 2 1 3 4 2 0 4 3 4 1 0 4 0 1 3 2 1 2 0 0 1 1 2 1 3 4 3 2 1 2 2 4 1 3 1 0 0 2 0 4 3 1 4 1 2 4 3 3 1 4 3 1 3 2 4 2 4 0 3 4 4 1 0 4 1 1 1 4 1 4 2 2 1 3 4 1 0 0 0 1 4 3 0 2 2 2 4 3 1 3 0 4 3 1 4 1 2 1 4 4 3 3 0 1 0 3 2 2 1 3 4 1 4 4 2 2...

output:

4 9 9 4 4 4 4 9 4 9 4 4 4 4 4 4 4 9 9 4 4 9 4 4 9 9 4 4 9 9 4 4 4 4 4 9 4 4 4 4 9 4 9 4 4 4 4 4 9 9 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 9 9 4 9 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 9 4 4 4 4 9 4 4 4 4 4 4 4 4 4 4 4 4 4 9 9 9 4 4 4 9 4 4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 4 4 4 9 4 9 4 4 4 4 4 4 4 4 4 4 4 4 9 4 4 ...

result:

ok 100000 numbers

Test #20:

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

input:

6 100000
4 1 2 0 3 0 0 4 4 2 4 3 0 3 5 3 3 4 0 3 2 0 2 1 3 0 1 0 1 1 5 1 1 3 0 3 0 3 1 0 3 4 2 0 0 0 3 1 3 4 4 3 4 2 2 3 1 5 0 1 0 3 0 1 5 2 3 5 2 0 3 2 1 0 0 1 4 1 1 3 4 1 4 5 4 1 0 3 3 0 5 0 4 0 0 0 0 3 5 1 0 4 4 0 3 3 5 4 1 2 3 4 5 0 0 3 1 2 0 2 2 4 4 4 2 2 0 4 2 1 1 5 5 4 5 5 2 3 0 0 2 5 5 4 5 1...

output:

8 8 8 2 2 2 2 8 8 8 8 2 2 2 8 2 2 8 2 2 8 2 8 8 2 2 8 2 8 8 8 8 8 2 2 2 2 2 8 2 2 8 8 2 2 2 2 8 2 8 8 2 8 8 8 2 8 8 2 8 2 2 2 8 8 8 2 8 8 2 2 8 8 2 2 8 8 8 8 2 8 8 8 8 8 8 2 2 2 2 8 2 8 2 2 2 2 2 8 8 2 8 8 2 2 2 8 8 8 8 2 8 8 2 2 2 8 8 2 8 8 8 8 8 8 8 2 8 8 8 8 8 8 8 8 8 8 2 2 2 8 8 8 8 8 8 8 2 2 2 ...

result:

ok 100000 numbers

Test #21:

score: 0
Accepted
time: 7ms
memory: 3556kb

input:

7 100000
1 2 5 5 5 1 3 5 1 4 2 1 1 2 3 0 6 2 5 4 3 0 2 5 6 2 2 3 6 1 0 5 1 5 3 4 4 6 6 1 4 6 3 6 1 2 4 0 6 1 5 6 0 3 1 5 5 6 5 3 0 4 2 3 2 0 0 5 2 2 6 0 2 3 5 5 1 2 0 2 0 3 1 1 1 0 1 3 1 4 0 1 5 2 1 5 1 5 1 2 2 1 6 4 4 0 4 2 5 4 5 6 3 4 6 5 1 2 6 0 5 5 5 3 6 5 0 4 4 2 3 5 6 1 1 4 6 4 5 6 1 1 3 0 6 2...

output:

8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 1 8 8 8 8 8 1 8 8 8 8 8 8 8 8 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 1 8 8 8 8 1 8 8 8 8 8 8 8 1 8 8 8 8 1 1 8 8 8 8 1 8 8 8 8 8 8 1 8 1 8 8 8 8 1 8 8 8 8 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 1 8 8 8 8 8 8 8 8 8 8 8 8 8 1 8 8 8 8 8 8 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 1 8 8 8 8 8 8 ...

result:

ok 100000 numbers

Test #22:

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

input:

8 100000
4 0 2 3 4 7 7 4 4 6 2 7 4 2 0 7 2 4 7 3 3 2 4 7 6 3 6 2 7 2 2 3 5 3 7 5 7 3 1 6 0 3 5 6 0 4 1 7 3 4 7 7 6 5 4 2 4 7 6 3 7 6 0 1 3 7 1 5 4 4 2 6 2 7 3 5 2 3 5 1 2 2 2 2 0 2 2 6 2 7 3 0 2 7 2 0 5 1 0 7 1 0 0 1 7 4 2 1 3 6 4 6 7 4 3 2 4 3 3 4 3 6 3 6 4 1 3 1 4 2 0 7 3 1 3 4 7 0 1 6 3 2 1 3 2 7...

output:

8 8 16 0 8 0 0 8 8 0 16 0 8 16 8 0 16 8 0 0 0 16 8 0 0 0 0 16 0 16 16 0 16 0 0 16 0 0 16 0 8 0 16 0 8 8 16 0 0 8 0 0 0 16 8 16 8 0 0 0 0 0 8 16 0 0 16 16 8 8 16 0 16 0 0 16 16 0 16 16 16 16 16 16 8 16 16 0 16 0 0 8 16 0 16 8 16 16 8 0 16 8 8 16 0 8 16 16 0 0 8 0 0 8 0 16 8 0 0 8 0 0 0 0 8 16 0 16 8 ...

result:

ok 100000 numbers

Test #23:

score: 0
Accepted
time: 6ms
memory: 3364kb

input:

9 100000
8 4 8 1 2 5 0 8 8 4 2 7 7 8 3 7 8 1 6 6 4 2 3 3 3 5 6 1 2 4 7 0 0 1 1 4 1 4 5 2 3 5 0 1 4 6 7 2 1 3 3 8 7 4 7 1 6 6 4 4 6 7 3 4 7 7 7 7 3 5 6 3 6 7 2 4 2 2 4 2 1 6 2 1 2 5 8 8 7 2 4 0 2 4 6 2 2 8 1 6 2 2 7 2 1 4 0 4 1 2 3 8 2 4 4 3 3 6 1 8 4 7 8 6 5 5 5 0 5 1 6 3 4 8 3 3 7 6 5 3 2 0 4 3 4 3...

output:

12 12 12 12 12 12 9 12 12 12 12 12 12 12 0 12 12 12 0 0 12 12 0 0 0 12 0 12 12 12 12 9 9 12 12 12 12 12 12 12 0 12 9 12 12 0 12 12 12 0 0 12 12 12 12 12 0 0 12 12 0 12 0 12 12 12 12 12 0 12 0 0 0 12 12 12 12 12 12 12 12 0 12 12 12 12 12 12 12 12 12 9 12 12 0 12 12 12 12 0 12 12 12 12 12 12 9 12 12 1...

result:

ok 100000 numbers

Test #24:

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

input:

10 100000
5 5 8 9 7 1 9 5 8 6 5 9 2 8 9 7 2 7 9 9 9 6 6 3 0 6 7 9 4 5 7 1 2 9 2 4 5 9 9 3 3 7 7 9 0 9 4 1 4 1 6 8 4 9 0 2 2 9 4 2 2 2 5 9 7 7 2 0 1 3 4 9 3 4 1 7 2 8 9 4 6 9 1 5 3 3 4 0 8 5 0 9 4 5 2 7 5 9 3 0 7 1 3 7 9 8 5 7 1 6 0 7 2 5 6 0 4 6 2 6 4 4 9 7 1 8 4 1 6 7 9 9 8 0 2 4 4 0 1 1 2 8 6 5 2 ...

output:

18 18 8 8 8 8 8 18 8 8 18 8 8 8 8 8 8 8 8 8 8 8 8 8 18 8 8 8 8 18 8 8 8 8 8 8 18 8 8 8 8 8 8 8 18 8 8 8 8 8 8 8 8 8 18 8 8 8 8 8 8 8 18 8 8 8 8 18 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 18 8 8 8 18 8 18 18 8 8 18 8 8 18 8 8 18 8 8 8 8 8 8 18 8 8 8 18 8 8 18 8 18 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 18 8 8 8 18 ...

result:

ok 100000 numbers

Test #25:

score: 0
Accepted
time: 17ms
memory: 3336kb

input:

11 100000
9 4 6 8 9 6 3 2 9 3 5 9 8 6 8 0 6 8 10 4 7 1 4 1 10 5 5 9 10 9 2 8 4 6 1 9 7 3 10 6 5 6 2 5 8 7 6 7 9 5 3 4 8 8 1 0 2 8 7 6 4 0 8 5 10 10 2 1 6 9 5 4 4 5 2 4 6 2 0 8 2 0 1 0 5 10 6 10 4 6 9 2 0 0 0 4 4 3 10 5 7 5 3 4 1 2 5 6 3 3 10 3 2 7 3 8 0 6 0 0 2 7 6 3 1 2 5 7 10 4 2 4 1 10 5 4 5 3 9 ...

output:

12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 12 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 1 12 1 12 12 12 12 12 12 12 12 1 1 1 12 12 12 12 12 12 12 12 ...

result:

ok 100000 numbers

Test #26:

score: 0
Accepted
time: 10ms
memory: 3404kb

input:

12 100000
2 2 3 9 3 6 9 4 9 8 3 9 6 4 2 11 6 0 0 3 6 7 7 5 5 10 10 6 2 1 1 6 6 3 5 5 9 10 3 7 2 9 3 8 3 2 2 4 10 2 9 5 9 6 1 9 3 0 11 8 1 1 2 0 6 11 1 0 5 10 6 6 11 0 4 6 3 4 0 1 9 0 7 7 8 8 1 3 0 8 8 3 3 5 8 5 10 4 1 1 9 10 0 11 11 5 11 6 9 5 0 11 10 4 0 9 9 10 3 9 1 4 11 1 4 10 1 1 10 6 11 3 1 8 8...

output:

16 16 0 8 0 4 8 16 8 16 0 8 4 16 16 0 4 4 4 0 4 0 0 32 32 16 16 4 16 32 32 4 4 0 32 32 8 16 0 0 16 8 0 16 0 16 16 16 16 16 8 32 8 4 32 8 0 4 0 16 32 32 16 4 4 0 32 4 32 16 4 4 0 4 16 4 0 16 4 32 8 4 0 0 16 16 32 0 4 16 16 0 0 32 16 32 16 16 32 32 8 16 4 0 0 32 0 4 8 32 4 0 16 16 4 8 8 16 0 8 32 16 0...

result:

ok 100000 numbers

Test #27:

score: 0
Accepted
time: 10ms
memory: 3568kb

input:

13 100000
10 6 6 2 7 6 4 3 12 7 3 3 11 1 5 3 2 0 5 0 3 10 10 4 3 1 1 4 8 9 11 10 2 9 4 2 3 0 4 6 3 12 3 12 4 9 11 4 1 7 6 8 11 7 2 7 0 0 4 6 8 11 8 8 12 9 3 10 8 8 6 1 10 6 8 11 8 2 6 12 4 5 8 11 9 4 0 3 5 0 10 12 6 2 6 5 11 1 7 4 3 4 5 6 4 10 5 9 5 6 4 10 9 9 11 4 11 7 8 11 9 5 5 12 4 10 7 8 12 10 ...

output:

12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 25 12 25 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 25 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 25 25 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 25 12 12 25 12 12 12 12 12 12 12 12 12 12 ...

result:

ok 100000 numbers

Test #28:

score: 0
Accepted
time: 8ms
memory: 3396kb

input:

14 100000
3 11 11 9 10 5 8 3 6 6 4 5 9 2 9 6 4 4 4 12 4 11 8 3 3 10 13 10 12 0 6 12 9 1 2 5 6 0 8 13 12 10 1 9 1 0 10 11 10 4 0 11 7 4 2 9 7 4 4 11 3 12 7 4 6 8 7 12 8 12 9 2 1 4 1 5 6 13 12 11 1 9 6 13 1 13 7 12 6 1 2 11 10 1 8 8 8 7 12 5 12 12 6 0 2 4 7 8 7 11 12 8 13 0 0 0 0 10 1 10 11 8 1 6 12 1...

output:

16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 2 16 16 16 16 16 16 16 2 16 16 16 16 16 16 16 2 16 16 16 16 2 16 2 16 16 16 2 16 16 16 16 16 2 16 16 16 2 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 2 16 16 16 16 16 16 16 16 16 16 2 16 16 16 16 16 2...

result:

ok 100000 numbers

Test #29:

score: 0
Accepted
time: 6ms
memory: 3388kb

input:

15 100000
14 1 2 9 11 1 8 7 1 9 12 4 0 7 1 1 14 12 8 5 8 2 8 14 10 4 5 11 5 7 11 0 10 0 7 2 2 6 13 8 13 10 2 4 8 10 5 10 8 6 7 4 12 9 8 4 14 4 7 11 2 9 7 3 2 0 13 6 3 9 0 0 14 12 1 6 4 8 10 8 4 11 4 0 8 6 4 13 3 9 6 7 8 7 4 10 13 8 11 11 4 10 0 2 5 13 11 4 4 14 0 9 1 2 8 8 3 10 3 10 0 3 4 8 5 12 12 ...

output:

16 16 16 4 16 16 16 16 16 4 4 16 9 16 16 16 16 4 16 36 16 16 16 16 36 16 36 16 36 16 16 9 36 9 16 16 16 4 16 16 16 36 16 16 16 36 36 36 16 4 16 16 4 4 16 16 16 16 16 16 16 4 16 4 16 9 16 4 4 4 9 9 16 4 16 4 16 16 36 16 16 16 16 9 16 4 16 16 4 4 4 16 16 16 16 36 16 16 16 16 16 36 9 16 36 16 16 16 16 ...

result:

ok 100000 numbers

Test #30:

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

input:

16 100000
13 12 11 5 8 11 0 3 15 10 1 10 15 1 13 6 13 4 14 10 15 3 0 14 6 0 1 6 2 8 7 15 15 13 0 9 7 13 9 3 4 7 5 2 12 8 15 10 10 11 3 9 1 6 9 12 6 15 7 1 4 0 7 2 11 5 2 10 11 3 2 3 1 0 13 5 11 2 3 11 3 0 5 3 9 7 5 9 1 8 2 14 6 1 3 14 5 3 4 4 15 12 7 3 2 4 8 0 1 14 9 9 6 10 8 2 12 3 13 4 5 9 9 14 6 ...

output:

32 0 0 32 16 0 16 0 0 32 32 32 0 32 32 0 32 32 0 32 0 0 16 0 0 16 32 0 32 16 0 0 0 32 16 32 0 32 32 0 32 0 32 32 0 16 0 32 32 0 0 32 32 0 32 0 0 0 0 32 32 16 0 32 0 32 32 32 0 0 32 0 32 16 32 32 0 32 0 0 0 16 32 0 32 0 32 32 32 16 32 0 0 32 0 0 32 0 32 32 0 0 0 0 32 32 16 16 32 0 32 32 0 32 16 32 0 ...

result:

ok 100000 numbers

Test #31:

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

input:

17 100000
8 15 6 15 16 16 7 9 5 4 16 3 2 1 5 14 12 1 3 1 9 11 6 4 11 12 6 5 1 13 5 3 2 8 7 4 15 5 11 8 1 1 12 3 6 2 13 10 3 1 15 4 1 13 15 15 10 0 2 15 10 5 15 5 15 0 1 7 16 4 4 12 3 0 8 10 9 5 15 13 7 15 11 15 15 5 8 6 7 6 11 8 14 0 10 14 16 12 14 6 14 3 15 6 13 11 1 0 12 15 14 7 13 13 6 2 10 10 1 ...

output:

16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 16 16 16 16 16 16 16 33 16 16 16 16 16 16 16 33 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 16 16 16 16 16 16 ...

result:

ok 100000 numbers

Test #32:

score: 0
Accepted
time: 10ms
memory: 3396kb

input:

18 100000
3 16 9 4 2 1 14 13 0 8 8 11 11 4 1 3 2 14 1 11 13 8 8 2 0 17 14 5 11 16 8 11 14 8 7 17 0 8 12 6 5 10 6 4 15 14 17 12 15 7 17 16 10 6 13 6 1 0 13 4 17 8 17 6 12 3 15 7 12 15 13 7 12 5 15 17 0 12 4 15 17 11 15 15 6 13 13 16 6 10 8 1 17 17 10 16 10 17 5 6 10 6 16 0 15 2 8 12 17 0 13 8 3 17 9 ...

output:

0 24 18 24 24 24 24 24 18 24 24 24 24 24 24 0 24 24 24 24 24 24 24 24 18 24 24 24 24 24 24 24 24 24 24 24 18 24 0 0 24 24 0 24 0 24 24 0 0 24 24 24 24 0 24 0 24 18 24 24 24 24 24 0 0 0 0 24 0 0 24 24 0 24 0 24 18 0 24 0 24 24 0 0 0 24 24 24 0 24 24 24 24 24 24 24 24 24 24 0 24 0 24 18 0 24 24 0 24 1...

result:

ok 100000 numbers

Test #33:

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

input:

19 100000
6 17 1 1 17 12 9 4 11 9 4 1 8 0 12 10 7 2 7 15 10 9 0 2 14 9 4 7 17 14 18 6 14 1 8 13 4 11 9 16 15 2 4 7 17 11 15 12 14 18 3 11 18 17 10 16 11 6 12 6 3 18 14 4 17 6 11 3 7 6 17 7 14 7 2 15 10 6 13 3 4 11 16 18 1 5 10 2 10 8 15 17 15 1 16 17 11 16 10 17 6 14 10 4 2 3 3 4 18 4 8 8 15 9 4 6 1...

output:

20 20 20 20 20 20 20 20 20 20 20 20 20 1 20 20 20 20 20 20 20 20 1 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20...

result:

ok 100000 numbers

Test #34:

score: 0
Accepted
time: 10ms
memory: 3560kb

input:

20 100000
15 19 8 14 7 12 13 6 12 12 9 1 5 15 0 1 16 11 10 5 2 2 13 19 7 5 19 13 12 2 9 3 10 1 13 12 2 2 9 11 0 17 11 8 10 8 16 3 13 7 16 16 5 4 4 17 0 2 17 4 18 11 0 5 11 1 17 7 8 16 0 19 18 6 4 4 17 1 19 17 10 4 9 11 10 6 16 2 18 9 7 1 19 14 12 2 4 18 15 8 3 10 4 5 7 0 14 13 0 13 12 14 9 13 11 12 ...

output:

0 0 16 16 0 16 32 16 16 16 32 32 72 0 36 32 16 0 36 72 16 16 32 0 0 72 0 32 16 16 32 0 36 32 32 16 16 16 32 0 36 32 0 16 36 16 16 0 32 0 16 16 72 16 16 32 36 16 32 16 16 0 36 72 0 32 32 0 16 16 36 0 16 16 16 16 32 32 0 32 36 16 32 0 36 16 16 16 16 32 0 32 0 16 16 16 16 16 0 16 0 36 16 72 0 36 16 32 ...

result:

ok 100000 numbers

Test #35:

score: 0
Accepted
time: 11ms
memory: 3352kb

input:

100 100000
48 32 34 54 85 85 82 68 47 73 17 52 90 96 65 52 7 34 62 95 26 12 9 43 33 84 12 85 19 72 96 18 85 86 67 89 30 2 82 52 30 20 27 34 70 21 44 68 61 10 41 43 46 75 14 66 72 46 84 18 48 93 99 17 90 45 50 36 30 12 56 50 94 23 65 51 50 25 62 67 80 34 16 67 61 16 73 21 26 53 97 85 76 84 10 66 11 7...

output:

80 80 80 80 320 320 80 80 0 160 160 80 160 80 320 80 0 80 80 0 80 80 160 0 160 80 80 320 0 80 80 80 320 80 0 160 160 80 80 80 160 160 0 80 160 160 80 80 160 160 160 0 80 0 80 80 80 80 80 80 80 160 0 160 160 320 260 80 160 80 80 260 80 0 320 0 260 520 80 0 160 80 80 0 160 80 160 160 80 160 160 320 80...

result:

ok 100000 numbers

Test #36:

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

input:

128 100000
16 19 39 13 115 121 95 52 85 114 91 49 9 57 52 8 13 85 66 120 70 85 109 31 15 125 125 81 86 71 63 52 34 86 52 81 1 34 74 38 46 85 61 17 48 86 114 56 123 96 5 31 95 121 56 45 105 107 122 7 31 76 119 89 55 69 124 101 72 118 68 25 32 96 62 127 41 114 70 18 70 115 96 38 37 63 74 79 31 101 111...

output:

256 0 0 256 0 256 0 256 256 256 0 256 256 256 256 256 256 256 256 0 0 256 256 0 0 256 256 256 0 0 0 256 256 0 256 256 256 256 256 0 0 256 256 256 0 0 256 0 0 0 256 0 0 256 0 256 256 0 256 0 0 0 0 256 0 256 0 256 256 0 256 256 256 0 0 0 256 256 0 256 0 0 0 0 256 0 256 0 0 256 0 256 0 0 256 0 256 0 25...

result:

ok 100000 numbers

Test #37:

score: 0
Accepted
time: 10ms
memory: 3572kb

input:

1024 100000
532 343 203 182 425 460 12 972 1018 768 298 646 568 413 471 473 169 713 292 584 781 539 687 873 93 332 992 1003 831 271 104 794 1007 442 811 959 793 194 955 132 980 643 942 316 778 967 207 880 662 1023 661 174 725 621 1011 845 337 557 648 227 620 116 446 973 593 82 834 413 560 40 153 748...

output:

2048 0 0 0 2048 0 0 0 2048 0 2048 0 0 2048 0 2048 2048 2048 2048 2048 2048 0 0 2048 2048 0 0 0 0 0 2048 2048 0 2048 0 0 2048 2048 0 2048 2048 0 0 0 2048 0 0 0 0 0 2048 0 2048 2048 0 2048 2048 2048 2048 0 0 2048 0 2048 2048 2048 2048 2048 0 2048 2048 0 0 0 2048 2048 0 0 0 0 2048 2048 2048 2048 2048 2...

result:

ok 100000 numbers

Test #38:

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

input:

536870912 100000
107025491 421633051 132023139 31380718 245778528 520704567 172552428 423483031 227692942 192211998 411480632 4226101 378697969 243491892 35406045 401467807 232630591 153062333 428429010 310105922 138296860 234353498 519351056 131796946 483907490 460132043 85788428 180522266 20565242...

output:

0 0 0 0 0 0 0 0 0 0 0 1073741824 1073741824 1073741824 1073741824 0 0 1073741824 1073741824 1073741824 0 1073741824 1073741824 1073741824 1073741824 0 0 1073741824 1073741824 0 1073741824 1073741824 0 0 1073741824 1073741824 0 1073741824 1073741824 1073741824 0 0 1073741824 0 1073741824 0 1073741824...

result:

ok 100000 numbers

Test #39:

score: 0
Accepted
time: 20ms
memory: 3396kb

input:

735134400 100000
351966946 399558695 239189398 510344231 175039439 644675791 543396921 351955791 351276431 584254884 9603576 370310467 319508226 106760052 205742033 264239914 381113405 385922876 630634787 379962836 727797698 457331284 248751094 670398804 647086386 580523149 431769976 363364422 52821...

output:

3503554560 0 0 0 0 0 0 0 0 0 0 0 424673280 53084160 212336640 1698693120 3397386240 0 0 141557760 1698693120 1698693120 0 1698693120 0 1698693120 0 0 3397386240 690094080 0 1698693120 0 1698693120 5520752640 0 141557760 0 1698693120 1698693120 212336640 1698693120 1698693120 3503554560 0 0 0 8493465...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 25ms
memory: 3364kb

input:

698377680 100000
174874929 115776451 542362291 296235171 640864821 543893571 555407534 647698115 68974020 217165158 362922817 487305620 153843634 396400618 656920216 427154318 436458059 584629557 346896621 39021446 444407994 497679085 190393608 73249592 397237852 28267885 461913501 239085036 6447365...

output:

0 0 0 0 0 0 0 0 3822059520 0 3503554560 3822059520 212336640 1698693120 849346560 0 0 0 424673280 0 1698693120 3822059520 0 1769472000 0 3822059520 0 0 0 0 0 656916480 1698693120 0 849346560 0 0 0 0 0 849346560 0 0 221184000 212336640 1698693120 212336640 437944320 1698693120 955514880 0 212336640 0...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 21ms
memory: 3364kb

input:

551350800 100000
347255357 494342994 497739323 298000174 305664559 293832011 13717396 238652722 516900907 151895054 324024370 106006683 28877808 530427027 95992705 430133685 35615930 156796714 499871507 89966715 261159684 349743316 401057912 265563544 46555881 188236911 471232806 453542929 493061902...

output:

1274019840 0 0 0 0 0 13271040 13271040 0 0 2548039680 0 0 0 2548039680 0 318504960 1274019840 0 0 0 2654208000 637009920 637009920 0 0 0 159252480 0 1274019840 0 0 0 0 1274019840 0 0 159252480 0 0 1274019840 0 0 1274019840 1274019840 2548039680 0 0 2548039680 0 109486080 2070282240 637009920 0 0 254...

result:

ok 100000 numbers

Test #42:

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

input:

110270160 100000
52294691 47672839 11158151 61123157 39733125 11467450 75592834 32034080 61466552 86394203 15702698 50569874 4503637 58233925 28472416 74050932 35468713 43504692 68943331 70691978 40079111 8477068 17093514 12148185 55028876 90799420 20686784 82647011 24779800 22250946 32444824 270685...

output:

0 0 0 254803968 0 573308928 254803968 597196800 15925248 0 21233664 254803968 254803968 1182449664 32845824 0 31850496 0 0 31850496 0 0 0 0 0 0 127401984 0 286654464 0 127401984 0 0 0 254803968 254803968 254803968 147806208 0 0 0 0 0 254803968 0 0 0 127401984 0 0 573308928 0 0 0 254803968 31850496 1...

result:

ok 100000 numbers

Test #43:

score: 0
Accepted
time: 20ms
memory: 3388kb

input:

4324320 100000
2306857 2162405 949815 3818685 1515090 4143771 1744746 457621 1154376 2645554 2578220 910706 2340155 2668184 1365262 3214167 3953908 263148 2151717 3300462 4322030 3938027 438740 3741257 126581 2294758 3380226 909290 2263855 3970446 1664867 1215350 1446612 2576177 841055 1211179 35046...

output:

1327104 2985984 0 0 0 0 0 10616832 10616832 10616832 0 10616832 0 0 0 0 1327104 0 0 0 0 0 23887872 22118400 2764800 0 0 23887872 0 0 0 0 0 10616832 0 0 5308416 0 10616832 10616832 0 22118400 1327104 0 10616832 0 0 22118400 10616832 0 110592 0 10616832 0 0 0 2654208 0 0 5308416 10616832 0 884736 0 10...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 14ms
memory: 3304kb

input:

110880 100000
95873 94423 21273 56888 75476 61735 13992 44987 71532 3907 30744 58028 32541 89549 33513 75609 79761 22264 23996 931 108447 355 56804 52996 51543 68318 67542 73557 96916 48010 30431 39388 57906 14115 42516 71688 95653 61090 79446 103697 6070 88442 20583 56180 7225 54492 85167 23722 520...

output:

294912 0 0 0 294912 0 0 0 0 0 0 0 0 294912 0 221184 0 0 0 0 0 0 24576 294912 0 0 0 18432 294912 663552 0 0 221184 0 221184 0 294912 663552 0 24576 0 294912 0 663552 663552 0 0 294912 294912 0 0 0 221184 0 24576 663552 0 0 0 294912 294912 294912 147456 0 294912 0 0 0 0 0 0 0 294912 0 0 0 36864 82944 ...

result:

ok 100000 numbers

Test #45:

score: 0
Accepted
time: 17ms
memory: 3304kb

input:

27720 100000
17686 18200 5273 561 26699 7661 3554 13726 12472 13115 996 14224 23866 14991 11535 6715 26131 8873 5713 17067 21383 8611 18621 10034 14676 17672 9331 24098 17268 14070 5700 25128 17735 18555 13344 23068 26577 20359 20336 21748 26226 19098 27601 9896 18527 14284 20958 26340 25774 2276 14...

output:

0 10368 73728 0 0 73728 73728 0 36864 0 0 4608 73728 0 0 0 0 73728 73728 0 0 0 55296 73728 0 36864 0 73728 0 0 0 27648 0 0 0 36864 55296 0 36864 36864 55296 55296 9216 36864 0 36864 0 0 0 36864 82944 0 0 0 165888 73728 0 55296 0 0 82944 0 82944 0 82944 0 73728 0 0 0 0 0 0 36864 165888 6144 36864 0 0...

result:

ok 100000 numbers

Test #46:

score: 0
Accepted
time: 11ms
memory: 3336kb

input:

60 100000
27 17 11 59 13 40 43 50 20 3 29 39 34 34 12 10 8 43 46 26 33 0 41 39 41 38 53 45 10 50 27 3 30 11 57 28 10 53 9 58 4 11 37 14 58 24 34 11 13 32 15 23 18 36 42 28 48 51 56 53 51 47 36 8 15 20 41 24 8 54 23 44 31 31 27 58 37 4 44 46 34 48 53 30 36 42 44 29 10 13 34 43 57 47 7 34 6 58 45 12 1...

output:

0 128 0 0 128 144 0 144 144 0 128 0 64 64 16 144 64 0 64 64 32 36 128 0 128 64 128 72 144 144 0 0 36 0 32 64 144 128 32 64 64 0 128 64 64 16 64 0 128 64 0 0 16 16 16 64 16 0 64 128 0 0 16 64 0 144 128 16 64 16 0 64 0 0 0 64 128 64 64 64 64 16 128 36 16 16 64 128 144 128 64 0 32 0 0 64 16 64 72 16 12...

result:

ok 100000 numbers

Test #47:

score: -100
Time Limit Exceeded

input:

999999929 100000
333111242 985608776 551629335 660056000 312643703 869806771 159666392 500650706 270736111 911053844 892559745 998822728 729706800 197533987 939222864 646096675 307023844 887718043 640832715 173209697 22212288 617166617 970250943 418300747 28207326 311253961 579344918 468543108 48691...

output:

999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 999999928 ...

result: