QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#270050#7148. Inverse KMPddl_VS_pigeon#AC ✓14ms7076kbC++171.8kb2023-11-30 14:29:242023-11-30 14:29:24

Judging History

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

  • [2023-11-30 14:29:24]
  • 评测
  • 测评结果:AC
  • 用时:14ms
  • 内存:7076kb
  • [2023-11-30 14:29:24]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int M = 1e9 + 7;

struct DSU {
    vector<int> f;
    DSU(int n) : f(n + 1) {
        for (int i = 1; i <= n; i++) {
            f[i] = i;
        }
    }
    int getfa(int v) { return f[v] == v ? v : (f[v] = getfa(f[v])); }
    bool merge(int u, int v) {
        u = getfa(u), v = getfa(v);
        if (u == v) {
            return false;
        }
        f[u] = v;
        return true;
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    auto solve = []() {
        int n, m;
        cin >> n >> m;
        vector<int> nxt(n);
        vector<pair<int, int>> neq;
        DSU dsu(n);
        for (int i = 1; i < n; i++) {
            cin >> nxt[i];
            if (nxt[i] > nxt[i - 1] + 1) {
                return 0;
            }
            for (int j = nxt[i - 1]; j + 1 > nxt[i] && j > 0; j = nxt[j - 1]) {
                neq.emplace_back(j, i);
            }
            if (nxt[i] > 0) {
                dsu.merge(nxt[i] - 1, i);
            } else {
                neq.emplace_back(0, i);
            }
        }
        for (auto [x, y] : neq) {
            if (dsu.getfa(x) == dsu.getfa(y)) {
                return 0;
            }
        }
        int ans = m;
        for (int i = 1; i < n; i++) {
            if (nxt[i] == 0) {
                set<int> p = {dsu.getfa(0)};
                for (int j = nxt[i - 1]; j > 0; j = nxt[j - 1]) {
                    p.insert(dsu.getfa(j));
                }
                if ((int)p.size() >= m) {
                    return 0;
                }
                ans = ans * ll(m - p.size()) % M;
            }
        }
        return (ans % M + M) % M;
    };
    cout << solve() << '\n';
    return 0;
}

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

詳細信息

Test #1:

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

input:

3 3
0 0

output:

12

result:

ok 1 number(s): "12"

Test #2:

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

input:

5 1000000000
1 2 3 4

output:

1000000000

result:

ok 1 number(s): "1000000000"

Test #3:

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

input:

10 733645394
1 0 0 0 1 0 0 0 1

output:

837768026

result:

ok 1 number(s): "837768026"

Test #4:

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

input:

10 467028359
1 0 1 2 2 3 4 5 6

output:

116396120

result:

ok 1 number(s): "116396120"

Test #5:

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

input:

10 200411323
1 0 0 0 0 0 0 0 0

output:

65350942

result:

ok 1 number(s): "65350942"

Test #6:

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

input:

10 228761583
1 2 3 4 0 1 2 0 1

output:

786745156

result:

ok 1 number(s): "786745156"

Test #7:

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

input:

10 107368740
1 2 0 1 2 0 1 0 0

output:

88006964

result:

ok 1 number(s): "88006964"

Test #8:

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

input:

10 407905834
0 1 1 0 0 1 2 0 0

output:

107487330

result:

ok 1 number(s): "107487330"

Test #9:

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

input:

10 141288798
0 0 1 0 0 1 2 1 1

output:

772632813

result:

ok 1 number(s): "772632813"

Test #10:

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

input:

10 874671763
0 1 1 2 3 2 3 4 5

output:

759501604

result:

ok 1 number(s): "759501604"

Test #11:

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

input:

10 608054727
0 0 0 0 0 0 0 0 0

output:

415094542

result:

ok 1 number(s): "415094542"

Test #12:

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

input:

10 341437691
0 0 0 0 0 0 1 1 2

output:

272061812

result:

ok 1 number(s): "272061812"

Test #13:

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

input:

10 82166274
0 0 0 0 1 0 0 0 0

output:

592085612

result:

ok 1 number(s): "592085612"

Test #14:

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

input:

10 520581942
0 0 0 1 2 3 0 0 0

output:

327471030

result:

ok 1 number(s): "327471030"

Test #15:

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

input:

10 548932202
0 1 1 1 0 0 0 1 1

output:

294567884

result:

ok 1 number(s): "294567884"

Test #16:

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

input:

10 282315166
0 0 0 0 0 0 0 1 0

output:

919759843

result:

ok 1 number(s): "919759843"

Test #17:

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

input:

10 15698131
0 0 0 0 1 0 0 1 0

output:

833163239

result:

ok 1 number(s): "833163239"

Test #18:

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

input:

10 611202521
0 1 1 0 0 0 0 0 1

output:

27678335

result:

ok 1 number(s): "27678335"

Test #19:

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

input:

10 489809678
1 0 0 0 0 0 0 0 0

output:

819507315

result:

ok 1 number(s): "819507315"

Test #20:

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

input:

10 928225346
1 0 0 0 0 0 0 0 0

output:

623919994

result:

ok 1 number(s): "623919994"

Test #21:

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

input:

10 661608310
0 0 0 0 0 0 0 0 0

output:

394637933

result:

ok 1 number(s): "394637933"

Test #22:

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

input:

10 689958570
1 2 0 0 0 1 0 1 2

output:

399231678

result:

ok 1 number(s): "399231678"

Test #23:

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

input:

10 285462961
1 0 0 0 0 1 0 0 0

output:

558713426

result:

ok 1 number(s): "558713426"

Test #24:

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

input:

10 164070117
1 0 0 0 0 0 0 0 0

output:

223245164

result:

ok 1 number(s): "223245164"

Test #25:

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

input:

10 897453081
0 1 1 0 0 1 0 0 1

output:

379778249

result:

ok 1 number(s): "379778249"

Test #26:

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

input:

10 335868750
1 0 0 0 0 0 0 0 0

output:

111155498

result:

ok 1 number(s): "111155498"

Test #27:

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

input:

10 69251714
0 0 0 0 0 0 1 0 0

output:

605832811

result:

ok 1 number(s): "605832811"

Test #28:

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

input:

10 664756104
0 0 0 1 2 0 0 1 2

output:

723934876

result:

ok 1 number(s): "723934876"

Test #29:

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

input:

10 398139069
0 0 0 1 0 0 0 0 0

output:

763669756

result:

ok 1 number(s): "763669756"

Test #30:

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

input:

10 276746225
0 0 0 0 1 1 0 0 0

output:

276748725

result:

ok 1 number(s): "276748725"

Test #31:

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

input:

10 305096485
0 1 0 0 0 0 1 0 0

output:

773689119

result:

ok 1 number(s): "773689119"

Test #32:

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

input:

10 743512153
0 0 0 0 0 0 0 0 0

output:

280858174

result:

ok 1 number(s): "280858174"

Test #33:

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

input:

10 339016544
0 0 1 1 0 0 0 0 0

output:

483300506

result:

ok 1 number(s): "483300506"

Test #34:

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

input:

10 72399508
0 0 0 0 0 0 0 1 0

output:

162801742

result:

ok 1 number(s): "162801742"

Test #35:

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

input:

10 805782473
1 0 0 0 0 0 0 0 0

output:

715278577

result:

ok 1 number(s): "715278577"

Test #36:

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

input:

10 684389629
1 0 0 0 0 0 0 0 0

output:

768263229

result:

ok 1 number(s): "768263229"

Test #37:

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

input:

10 417772593
0 1 0 0 0 0 0 0 0

output:

371098342

result:

ok 1 number(s): "371098342"

Test #38:

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

input:

10 718309688
0 0 0 0 0 0 0 0 0

output:

857450011

result:

ok 1 number(s): "857450011"

Test #39:

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

input:

10 451692652
0 0 0 0 0 0 0 0 0

output:

130408898

result:

ok 1 number(s): "130408898"

Test #40:

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

input:

10 480042912
0 0 0 0 0 0 0 0 0

output:

601322583

result:

ok 1 number(s): "601322583"

Test #41:

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

input:

10 358650068
0 0 0 0 1 0 0 0 0

output:

810279034

result:

ok 1 number(s): "810279034"

Test #42:

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

input:

10 92033033
0 0 0 1 0 0 1 0 0

output:

551490886

result:

ok 1 number(s): "551490886"

Test #43:

score: 0
Accepted
time: 1ms
memory: 3676kb

input:

10 532620051
0 0 0 0 0 0 1 0 0

output:

763639185

result:

ok 1 number(s): "763639185"

Test #44:

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

input:

10 175452845
0 0 0 0 0 0 0 1 0

output:

844938074

result:

ok 1 number(s): "844938074"

Test #45:

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

input:

10 113252935
0 0 1 1 0 0 0 0 0

output:

156691115

result:

ok 1 number(s): "156691115"

Test #46:

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

input:

10 51053026
0 0 0 0 0 0 0 1 0

output:

925306921

result:

ok 1 number(s): "925306921"

Test #47:

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

input:

10 693885820
0 0 0 0 0 0 0 0 0

output:

305865581

result:

ok 1 number(s): "305865581"

Test #48:

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

input:

1000 415868408
0 1 2 3 1 1 2 3 4 5 4 0 1 1 1 1 2 3 4 5 4 0 0 1 1 2 3 1 2 0 1 2 0 1 1 2 3 1 1 1 1 1 1 2 3 1 1 2 3 1 1 2 3 4 5 6 7 1 2 3 4 0 1 1 1 2 3 1 2 0 0 0 0 0 1 1 2 0 1 2 3 1 1 2 3 1 2 0 0 0 1 2 0 1 2 3 4 0 0 1 1 1 1 1 2 0 1 2 0 1 1 2 0 1 1 2 0 1 1 2 3 1 1 2 3 1 1 2 0 0 0 0 1 1 2 3 1 1 1 1 1 2 3...

output:

321444191

result:

ok 1 number(s): "321444191"

Test #49:

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

input:

1000 482271289
0 0 1 2 3 0 0 0 0 0 0 1 1 1 1 2 3 4 5 1 2 1 1 2 3 4 1 1 2 1 1 1 2 1 2 1 2 3 0 0 1 2 3 0 0 0 0 1 2 1 2 3 4 1 2 3 4 5 1 2 3 0 0 0 1 1 2 3 4 5 6 4 5 6 4 5 1 1 1 1 1 2 1 2 1 1 1 1 1 2 1 1 2 1 2 1 2 3 4 1 1 2 3 0 0 0 1 1 2 3 4 5 1 2 3 4 1 1 2 3 0 1 2 1 2 3 4 5 1 2 1 1 2 3 0 1 2 3 0 1 1 2 3...

output:

902393620

result:

ok 1 number(s): "902393620"

Test #50:

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

input:

1000 403449978
0 1 2 3 1 2 3 1 2 3 1 1 2 0 0 1 2 0 0 1 1 1 1 2 0 1 2 0 0 0 0 1 1 2 0 1 1 1 2 3 1 1 1 1 2 3 1 1 2 0 0 0 1 1 2 0 0 1 2 3 1 2 0 1 1 1 1 1 1 1 1 1 1 2 3 4 0 0 1 1 2 0 0 1 2 0 1 2 3 1 1 1 2 0 0 1 2 3 1 2 0 1 2 3 4 0 0 0 0 0 0 1 1 2 0 1 1 2 3 4 0 0 0 0 0 0 0 1 1 2 3 4 0 1 1 1 2 0 1 2 0 1 2...

output:

204510113

result:

ok 1 number(s): "204510113"

Test #51:

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

input:

1000 469852860
1 0 0 1 2 2 2 3 1 0 0 1 0 0 0 0 0 0 1 2 2 3 1 2 2 2 3 4 5 6 7 3 4 0 1 0 1 2 2 2 2 3 4 5 6 3 4 0 1 2 2 2 2 3 1 2 3 4 5 0 0 1 2 2 2 3 4 0 1 0 1 0 1 0 1 2 2 3 4 0 1 2 3 4 0 0 1 2 3 4 0 0 0 0 0 0 1 2 2 2 3 1 0 0 0 1 0 0 0 1 2 3 4 5 6 3 1 0 0 0 1 2 2 3 4 0 0 1 2 3 4 0 1 2 2 2 2 2 2 2 3 4 0...

output:

643474281

result:

ok 1 number(s): "643474281"

Test #52:

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

input:

1000 685998845
0 1 2 3 1 1 2 0 0 0 0 1 1 1 1 1 1 1 2 0 0 1 2 0 0 1 1 2 0 1 1 2 0 1 1 1 1 1 1 1 2 0 0 1 1 2 0 0 1 1 2 0 1 1 1 1 2 3 4 0 1 2 3 1 2 3 4 0 0 1 2 0 1 2 0 0 1 2 3 4 0 1 1 2 3 1 1 2 0 1 1 2 3 1 2 3 4 5 6 7 1 1 1 1 1 2 3 4 0 0 1 2 3 1 1 1 2 0 0 1 1 1 2 0 1 2 3 4 5 6 2 0 1 1 1 1 2 0 1 2 0 0 0...

output:

297159276

result:

ok 1 number(s): "297159276"

Test #53:

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

input:

1000 556911325
0 0 0 0 1 2 1 0 1 2 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1 2 0 0 0 0 1 2 0 0 1 0 0 1 1 1 2 3 0 0 0 1 2 0 0 0 1 0 0 1 1 2 3 4 0 0 0 0 0 1 0 0 0 0 0 1 2 0 0 1 0 0 0 0 1 1 1 2 3 1 1 0 0 1 2 0 1 2 1 2 0 1 0 0 0 0 0 0 0 1 2 1 1 0 1 1 1 1 2 1 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1 0 0 1 2 1...

output:

987134617

result:

ok 1 number(s): "987134617"

Test #54:

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

input:

1000 623314206
1 2 0 0 0 1 0 0 1 2 0 1 2 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 2 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 2 3 4 0 0 0 0 0 1 0 0 0 1 2 0 0 0 0 0 1 2 0 0 1 2 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 2 0 1 2 3 3 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 1 2 0 0 0 0 1 0 1...

output:

521615092

result:

ok 1 number(s): "521615092"

Test #55:

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

input:

1000 544492896
1 2 3 0 1 0 0 0 1 2 3 0 0 0 0 0 1 0 1 0 0 1 0 0 1 2 0 0 0 0 0 0 1 0 0 0 0 1 2 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 1 2 0 0 1 0 0 0 0 1 2 0 0 0 1 0 0 1 2 0 0 0 0 0 0 0 1 0 0 1 2 0 1 2 3 0 1 0 0 0 1 2 0 1 0 0 1 2 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0...

output:

820661355

result:

ok 1 number(s): "820661355"

Test #56:

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

input:

1000 610895777
0 1 2 0 1 1 0 0 0 0 0 0 0 0 1 1 0 1 2 0 0 1 2 0 0 1 2 3 4 5 0 1 1 0 0 1 0 1 2 0 0 0 1 2 3 4 3 4 0 1 2 0 0 1 2 3 1 1 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 2 0 0 0 1 1 2 0 0 1 0 0 1 2 0 1 1 1 2 3 0 0 0 0 0 0 0 0 0 1 2 3 1 0 0 1 1 2 0 1 0 1 2 0 1...

output:

956237350

result:

ok 1 number(s): "956237350"

Test #57:

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

input:

1000 532074466
0 0 0 0 1 2 0 0 1 0 0 1 2 3 1 2 0 0 0 0 0 1 0 0 1 1 0 1 1 1 1 0 0 0 0 1 2 3 1 1 2 1 1 0 1 0 1 1 1 2 3 0 0 0 1 0 0 1 0 0 0 1 1 0 1 1 2 1 2 1 0 0 1 1 1 0 1 0 1 1 2 0 0 1 1 1 2 3 0 0 0 1 1 0 1 2 3 4 1 2 1 1 1 2 0 0 1 1 1 2 3 1 0 0 0 1 0 0 0 0 0 1 2 3 1 1 1 1 1 2 3 1 0 0 1 1 2 0 1 1 1 1 1...

output:

943032695

result:

ok 1 number(s): "943032695"

Test #58:

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

input:

1000 697954242
0 1 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 2 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 2 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 2 3 4 1 2 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0...

output:

13101455

result:

ok 1 number(s): "13101455"

Test #59:

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

input:

1000 764357124
1 0 0 0 0 1 0 0 1 0 1 0 0 0 1 0 0 1 2 0 0 0 0 0 0 1 2 3 4 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 2 0 0 0 0 0 0 0 1 0 1 2 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 2 0 0 0 0 0 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0...

output:

658008102

result:

ok 1 number(s): "658008102"

Test #60:

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

input:

1000 685535813
0 0 1 0 0 0 0 0 0 1 0 1 2 0 0 0 0 0 0 0 1 0 0 0 0 1 1 2 3 0 1 1 0 0 0 1 2 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 2 3 0 0 1 0 1 1 2 3 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 2 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 2...

output:

990123590

result:

ok 1 number(s): "990123590"

Test #61:

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

input:

1000 751938694
1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 2 2 2 2 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 2 3 1 0 1 0 1 0 0 1 0 0 0 1 0 0 1 2 2 0 1 0 0 0 0 0 1 2 2 0 1 0 0 0 0 0 0 1 2 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0...

output:

779617178

result:

ok 1 number(s): "779617178"

Test #62:

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

input:

1000 673117384
0 0 1 0 1 0 0 0 0 0 1 0 1 2 1 2 1 1 2 1 2 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 2 1 0 1 2 0 0 0 0 1 1 2 1 0 0 0 1 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 1 2 0 1 2 1 2 0 1 2 1 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0...

output:

555063492

result:

ok 1 number(s): "555063492"

Test #63:

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

input:

1000 838997160
0 0 1 2 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 1 0 0 1 2 0 1 2 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 2 3 0 0 0 1 2 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 1 0 0 0 0 0...

output:

518619291

result:

ok 1 number(s): "518619291"

Test #64:

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

input:

1000 610432745
1 2 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 2 3 3 3 4 0 0 0 0 0 0 0 1 0 0 0 0 1 2 3 0 0 0 0 1 0 1 0 0 0 1 0...

output:

720634357

result:

ok 1 number(s): "720634357"

Test #65:

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

input:

1000 826578730
0 0 1 2 1 2 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 2 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 2 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 2 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 2 1 2 0 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1...

output:

266149737

result:

ok 1 number(s): "266149737"

Test #66:

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

input:

1000 892981612
0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 2 0 0 1 2 3 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 2 1 0 1 0 0 1 2 1...

output:

374363104

result:

ok 1 number(s): "374363104"

Test #67:

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

input:

1000 959384493
0 0 0 1 0 0 0 0 1 0 0 0 1 2 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0...

output:

526315169

result:

ok 1 number(s): "526315169"

Test #68:

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

input:

1000 685072781
0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 0 1 2 3 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 1 2 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0...

output:

906319901

result:

ok 1 number(s): "906319901"

Test #69:

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

input:

1000 46442958
0 1 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 2 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

261522963

result:

ok 1 number(s): "261522963"

Test #70:

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

input:

1000 967621648
0 0 0 0 1 0 1 0 0 0 1 2 0 0 0 0 1 0 0 1 2 0 0 0 1 0 1 2 1 1 0 1 1 1 0 0 1 1 1 2 0 0 0 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 1...

output:

483043891

result:

ok 1 number(s): "483043891"

Test #71:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

1000 34024529
0 0 0 0 0 1 0 0 1 0 1 0 0 1 2 0 0 0 0 0 0 1 2 0 1 2 3 0 0 0 0 1 0 0 0 0 1 1 2 1 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 1 2 0 0 0 1 0 1 2 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 2 1 0 0 0 1 2 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 ...

output:

427201708

result:

ok 1 number(s): "427201708"

Test #72:

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

input:

1000 100427410
0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0...

output:

50631862

result:

ok 1 number(s): "50631862"

Test #73:

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

input:

1000 121082994
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 1 0 0 0 0 0 1 2 0 0 0 0 1 0 0 0 0 1 2 0 1 0 0 0 0 1 1 2 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 2 0 1 0...

output:

702913580

result:

ok 1 number(s): "702913580"

Test #74:

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

input:

1000 892518579
0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 1 1 2 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1...

output:

871549846

result:

ok 1 number(s): "871549846"

Test #75:

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

input:

1000 108664565
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 1 1 0 0 1 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

263821682

result:

ok 1 number(s): "263821682"

Test #76:

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

input:

1000 175067446
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 3 4 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0...

output:

262974853

result:

ok 1 number(s): "262974853"

Test #77:

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

input:

1000 241470328
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0...

output:

437685614

result:

ok 1 number(s): "437685614"

Test #78:

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

input:

1000 967158615
0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0...

output:

167634457

result:

ok 1 number(s): "167634457"

Test #79:

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

input:

1000 328528793
0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 2 0 0 0 0 0 0 1 0 1 2 0 1 1 2 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1...

output:

722838116

result:

ok 1 number(s): "722838116"

Test #80:

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

input:

1000 249707482
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 2 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0...

output:

88625896

result:

ok 1 number(s): "88625896"

Test #81:

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

input:

1000 21143067
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 1 1 0 0 ...

output:

306568338

result:

ok 1 number(s): "306568338"

Test #82:

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

input:

1000 382513245
0 1 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0...

output:

483546788

result:

ok 1 number(s): "483546788"

Test #83:

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

input:

1000 403168829
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 2 3 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

303587617

result:

ok 1 number(s): "303587617"

Test #84:

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

input:

1000 174604414
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0...

output:

418970966

result:

ok 1 number(s): "418970966"

Test #85:

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

input:

1000 241007295
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 0 1 2 3 0 0 0 0 1 2 0 0 1 0 1 1 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0...

output:

372361713

result:

ok 1 number(s): "372361713"

Test #86:

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

input:

1000 457153281
0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 2 3 1 2...

output:

837847812

result:

ok 1 number(s): "837847812"

Test #87:

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

input:

1000 228588866
0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 2 3 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 2 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0...

output:

532418876

result:

ok 1 number(s): "532418876"

Test #88:

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

input:

1000 765912365
0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0...

output:

817859137

result:

ok 1 number(s): "817859137"

Test #89:

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

input:

1000 569024208
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 2 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0...

output:

81546298

result:

ok 1 number(s): "81546298"

Test #90:

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

input:

1000 521879155
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0...

output:

726699432

result:

ok 1 number(s): "726699432"

Test #91:

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

input:

1000 324990998
0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...

output:

471388077

result:

ok 1 number(s): "471388077"

Test #92:

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

input:

1000 982878649
0 0 0 1 2 1 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0...

output:

904583149

result:

ok 1 number(s): "904583149"

Test #93:

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

input:

200000 579272183
0 1 1 2 3 4 5 6 7 1 1 1 1 2 3 4 5 6 7 1 2 3 4 5 6 2 0 1 1 2 0 0 1 1 1 2 3 2 3 2 0 1 1 1 1 1 1 1 1 2 3 2 0 1 1 2 0 1 2 3 2 3 2 3 2 3 2 3 2 3 4 5 6 2 0 0 0 1 2 0 0 1 1 2 3 4 5 0 1 1 1 1 2 3 4 5 6 2 0 1 2 0 1 1 2 3 4 5 6 2 3 2 0 1 2 3 2 0 0 0 1 1 2 0 1 2 0 0 0 0 0 1 1 2 3 4 1 2 0 1 2 3...

output:

347660170

result:

ok 1 number(s): "347660170"

Test #94:

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

input:

200000 819073288
1 0 0 0 0 1 2 2 3 4 1 0 1 2 3 1 0 1 2 2 3 1 0 0 0 0 1 2 3 1 2 3 4 5 1 2 3 4 1 2 2 3 4 5 6 0 0 0 0 1 2 3 4 5 6 0 1 0 1 0 0 1 0 1 2 3 1 2 2 2 3 1 2 3 4 5 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 2 2 2 2 2 2 2 2 2 3 4 1 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 1 2 2 3 4 5 1 0 1 0 1 2 2 2 2 2 2 3 1 0...

output:

153152121

result:

ok 1 number(s): "153152121"

Test #95:

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

input:

200000 353841688
0 0 1 1 2 3 0 0 1 1 2 3 0 1 1 1 2 1 1 1 1 1 2 1 2 1 1 2 1 2 3 4 2 1 1 2 1 1 2 1 2 1 2 1 1 1 1 1 1 1 1 2 1 2 1 1 2 1 2 3 0 0 1 1 1 1 2 3 0 0 0 1 1 2 1 1 1 2 1 1 1 2 1 1 2 3 4 5 1 2 3 4 5 1 2 1 2 1 1 1 2 3 4 5 1 1 2 3 0 1 1 1 1 2 1 1 1 2 3 0 1 1 1 1 1 2 1 1 1 1 1 1 2 3 4 2 3 0 1 2 3 0...

output:

591947149

result:

ok 1 number(s): "591947149"

Test #96:

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

input:

200000 738866985
1 0 0 1 0 1 0 1 2 2 2 2 2 3 1 0 0 1 0 1 0 0 0 0 0 0 1 2 2 2 2 2 2 3 1 2 2 3 4 0 0 1 0 1 2 3 4 5 2 2 3 1 0 0 0 0 0 1 0 0 1 0 1 0 1 2 3 1 2 2 3 1 0 1 0 1 2 2 2 2 2 2 2 3 1 2 2 2 3 1 0 0 1 0 1 0 1 2 2 2 3 1 2 3 4 5 6 0 0 1 0 0 1 0 0 0 0 0 1 2 3 4 5 6 7 2 3 4 0 1 2 2 3 1 2 2 2 2 2 3 4 5...

output:

684525127

result:

ok 1 number(s): "684525127"

Test #97:

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

input:

200000 978668089
0 1 1 1 1 1 1 1 2 0 1 2 3 4 5 2 0 1 2 3 4 5 2 3 2 0 1 1 2 0 0 0 0 1 1 2 0 1 2 0 1 2 3 2 0 1 1 1 2 3 2 3 4 2 3 4 5 2 3 4 2 3 4 2 3 2 3 4 2 3 4 5 6 7 8 2 0 0 0 1 1 1 1 2 0 0 0 1 1 1 1 2 3 2 0 1 1 1 2 3 4 5 2 0 0 1 2 0 0 0 1 1 1 1 1 2 3 4 5 2 3 4 2 0 1 1 1 2 0 0 1 1 2 0 1 2 0 0 0 0 0 0...

output:

684536522

result:

ok 1 number(s): "684536522"

Test #98:

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

input:

200000 207808617
1 0 0 1 2 2 2 2 3 1 2 3 1 0 0 0 0 0 1 0 1 2 0 0 1 0 0 0 0 0 0 1 2 3 0 0 0 0 1 0 0 0 0 1 2 3 0 1 2 3 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 2 2 0 1 2 3 1 0 1 2 3 4 0 1 0 1 2 3 1 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 2 3 0 1 0 1 2 3 1 0 1 2 2 0 1 0 0 0 0 0 0 0 0 0 1 0 1 2 0 1 0 1 2 3 0 1 2 0 0 1 0...

output:

102415678

result:

ok 1 number(s): "102415678"

Test #99:

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

input:

200000 447609722
0 0 0 1 2 3 4 5 0 0 1 1 0 0 0 1 1 2 1 0 0 0 0 0 0 0 1 1 2 0 0 1 0 0 1 2 0 1 2 3 4 5 6 1 2 1 2 0 0 0 0 1 1 0 0 0 1 2 0 1 2 3 4 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 2 3 1 0 0 0 0 1 2 0 0 0 0 0 0 1 0 1 1 1 1 2 0 1 1 2 0 1 0 1 1 2 3 4 0 1 0...

output:

370729195

result:

ok 1 number(s): "370729195"

Test #100:

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

input:

200000 687410826
0 0 0 1 2 1 2 3 0 1 2 3 4 0 0 0 0 1 2 1 2 3 4 0 0 1 1 0 0 0 0 0 1 2 1 0 1 2 1 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 2 0 0 0 0 0 0 1 1 0 0 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 3 4 0 0 1 1 2 3 1 1 1 2 1 1 0 0 0 1 0 0 0 0 0 1 2 3 4 0 1 0 0 1 0 1 2 1 1 2 3 1 2 1 2 1 2 3...

output:

43212245

result:

ok 1 number(s): "43212245"

Test #101:

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

input:

200000 367403419
1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 2 3 1 2 3 1 2 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 1 2 0 0 1 0 1 2 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 2 2 0 1 2 3 4 5 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 2 3 0 0 0 0 0 0 0 1 2 3 0 0 1 0 0 1 2 0 1 2 2 3 0 0 0 0 0 0 1 0 0 1 2 2 0 0 0 1 2 0 1 2 0 0 0 0...

output:

386226086

result:

ok 1 number(s): "386226086"

Test #102:

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

input:

200000 607204523
0 0 0 0 0 0 0 1 2 3 1 2 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 1 1 2 3 0 0 1 2 0 0 1 1 0 0 0 0 0 1 0 0 0 1 1 1 2 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 1 2 1 2 3 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 2 0 0 0 0 1 2 0 1 1 1 0 0...

output:

775972750

result:

ok 1 number(s): "775972750"

Test #103:

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

input:

200000 396153563
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 1 2 1 2 1 1 0 0 1 0 1 1 1 2 0 0 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 1 1 2 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1...

output:

966018293

result:

ok 1 number(s): "966018293"

Test #104:

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

input:

200000 76146156
0 1 0 0 0 0 0 0 1 1 2 3 2 3 0 0 0 0 0 0 1 0 0 0 0 0 1 2 3 4 0 0 1 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 1 1 2 3 2 3 1 0 0 1 1 2 0 0 1 0 0 0 0 0 0 0 1 0 1 1 2 0 0 1 1 0 0 1 2 0 0 0 0 1 1 1 2 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 0 1 2 0 0 0 0 1 2 0 0 0 0 0 0 1 0 0 0 1 2 0 1 0 0 0 1 1 1 0 0 0 0 ...

output:

132533793

result:

ok 1 number(s): "132533793"

Test #105:

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

input:

200000 315947260
0 1 1 1 0 0 1 1 2 3 4 5 2 0 0 1 2 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 3 2 0 0 0 1 2 0 1 0 0 0 0 1 2 0 1 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 0 1 2 3 4 0 1 0 0 1 0 0 1 1 0 0 1 0 1 2 0 0 0 0 1 0 1 1 1 2 3 0 0 1 1 2 0 0 0 0 0 1 2 0 0...

output:

90655276

result:

ok 1 number(s): "90655276"

Test #106:

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

input:

200000 555748365
0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 0 0 1 1 0 0 1 1 2 3 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 2 0 1 2 0 1 1 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 1 1 2 3 4 5 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 2 3 1 1 1 0 1 1 0 1 0 0 1 2 0 0...

output:

793860155

result:

ok 1 number(s): "793860155"

Test #107:

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

input:

200000 940773662
1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 1 0 0 0 1 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 3 1 2 3 4 5 0 0 0 1 0 0 0 0 0 0 0 1 0 1 2 3 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 2 0 1 0 0 0 0 1 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 1 2 0 0 0 1 0...

output:

576146912

result:

ok 1 number(s): "576146912"

Test #108:

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

input:

200000 24689997
0 1 2 0 1 0 0 1 0 1 1 1 2 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 2 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 2 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 2 0 1 0 0 1 0 0 0 0 0 ...

output:

991993325

result:

ok 1 number(s): "991993325"

Test #109:

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

input:

200000 704682590
0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 2 0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

783514522

result:

ok 1 number(s): "783514522"

Test #110:

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

input:

200000 649516398
0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 2 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 2 0 0 0 0 1 0 0 1 0 0 1 2 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 1 2 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0...

output:

307949336

result:

ok 1 number(s): "307949336"

Test #111:

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

input:

200000 184284799
0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 2 0 0 0 0 1 2 3 1 2 0 0 1 0 0 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 2 3 0 0 0 0 0 0 0 1 2 0...

output:

369035448

result:

ok 1 number(s): "369035448"

Test #112:

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

input:

200000 864277392
1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 2 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 3 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 1 0 1 2 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0...

output:

768613352

result:

ok 1 number(s): "768613352"

Test #113:

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

input:

200000 653226431
0 0 0 1 2 3 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 2 0 1 0 0 1 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 1 2 0 0 0 0 1 2 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

142630180

result:

ok 1 number(s): "142630180"

Test #114:

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

input:

200000 38251728
0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 1 2 1 2 3 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 2 0 0 0 0 0 0 1 1 0 0 0 0 0 1 2 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 1 0 0 0 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:

697892572

result:

ok 1 number(s): "697892572"

Test #115:

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

input:

200000 573020129
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 2 0 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0...

output:

498397217

result:

ok 1 number(s): "498397217"

Test #116:

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

input:

200000 517853937
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

891718407

result:

ok 1 number(s): "891718407"

Test #117:

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

input:

200000 197846530
0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 2 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0 1 2 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0...

output:

669796487

result:

ok 1 number(s): "669796487"

Test #118:

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

input:

200000 281762865
0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 2 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0...

output:

96510156

result:

ok 1 number(s): "96510156"

Test #119:

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

input:

200000 371820866
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0...

output:

749167673

result:

ok 1 number(s): "749167673"

Test #120:

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

input:

200000 906589267
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

352954727

result:

ok 1 number(s): "352954727"

Test #121:

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

input:

200000 441357667
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 2 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...

output:

799722892

result:

ok 1 number(s): "799722892"

Test #122:

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

input:

200000 531415668
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1...

output:

602850567

result:

ok 1 number(s): "602850567"

Test #123:

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

input:

200000 615332003
0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 1 2 0 0 0 1 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1...

output:

595241449

result:

ok 1 number(s): "595241449"

Test #124:

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

input:

200000 150100404
1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 1 0...

output:

323398133

result:

ok 1 number(s): "323398133"

Test #125:

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

input:

200000 240158405
1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0...

output:

201484914

result:

ok 1 number(s): "201484914"

Test #126:

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

input:

200000 774926805
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 1 1 0 0 1 0 1 2 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

331448986

result:

ok 1 number(s): "331448986"

Test #127:

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

input:

200000 14727910
0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 ...

output:

135252881

result:

ok 1 number(s): "135252881"

Test #128:

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

input:

200000 243868438
0 0 0 0 0 0 0 0 0 0 0 0 1 1 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 2 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0...

output:

684142741

result:

ok 1 number(s): "684142741"

Test #129:

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

input:

200000 483669542
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0...

output:

752766955

result:

ok 1 number(s): "752766955"

Test #130:

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

input:

200000 163662135
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0...

output:

981461127

result:

ok 1 number(s): "981461127"

Test #131:

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

input:

200000 403463239
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 2 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0...

output:

381805437

result:

ok 1 number(s): "381805437"

Test #132:

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

input:

200000 643264344
0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 1 2 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

763286827

result:

ok 1 number(s): "763286827"

Test #133:

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

input:

200000 653418349
0 1 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...

output:

845407997

result:

ok 1 number(s): "845407997"

Test #134:

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

input:

200000 515373820
0 0 0 0 0 0 1 0 0 1 2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 2 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 1 0 0 1 2 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0...

output:

458548074

result:

ok 1 number(s): "458548074"

Test #135:

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

input:

200000 82361994
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 2 0 0 0 0 0 1 0 0 0 0 0 0 ...

output:

120008960

result:

ok 1 number(s): "120008960"

Test #136:

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

input:

200000 89541657
0 0 1 0 0 0 1 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 ...

output:

65589608

result:

ok 1 number(s): "65589608"

Test #137:

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

input:

200000 951497128
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0...

output:

275439523

result:

ok 1 number(s): "275439523"

Extra Test:

score: 0
Extra Test Passed