QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#190525#6735. Treeucup-team004AC ✓2014ms75100kbC++205.5kb2023-09-29 02:23:032023-09-29 02:23:04

Judging History

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

  • [2023-09-29 02:23:04]
  • 评测
  • 测评结果:AC
  • 用时:2014ms
  • 内存:75100kb
  • [2023-09-29 02:23:03]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

constexpr i64 inf = 1E18;

struct Info {
    i64 ans = 0;
    i64 len = -inf;
    i64 vl = -inf;
    i64 vr = -inf;
};

constexpr int N = 1 << 19;

Info info[N];

Info operator+(const Info &a, const Info &b) {
    if (a.vl < 0) {
        return b;
    }
    if (b.vl < 0) {
        return a;
    }
    Info c;
    c.ans = std::max({a.ans, b.ans, a.vr + b.vl});
    c.len = std::max(-inf, a.len + b.len);
    c.vl = std::max(a.vl, a.len + b.vl);
    c.vr = std::max(b.vr, a.vr + b.len);
    return c;
}

Info query(int p, int l, int r, int x, int y) {
    if (l >= y || r <= x) {
        return {};
    }
    if (l >= x && r <= y) {
        return info[p];
    }
    int m = (l + r) / 2;
    return query(2 * p, l, m, x, y) + query(2 * p + 1, m, r, x, y);
}

void pull(int p) {
    info[p] = info[2 * p] + info[2 * p + 1];
}

void modify(int p, int l, int r, int x, const Info &v) {
    if (r - l == 1) {
        info[p] = v;
        return;
    }
    int m = (l + r) / 2;
    if (x < m) {
        modify(2 * p, l, m, x, v);
    } else {
        modify(2 * p + 1, m, r, x, v);
    }
    pull(p);
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int n, q;
    std::cin >> n >> q;
    
    std::vector<int> a(n);
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
    }
    
    std::vector<int> p(n);
    p[0] = -1;
    for (int i = 1; i < n; i++) {
        std::cin >> p[i];
        p[i]--;
    }
    
    std::vector<int> c(n);
    for (int i = 1; i < n; i++) {
        std::cin >> c[i];
    }
    
    std::vector<int> w(n);
    for (int i = 1; i < n; i++) {
        std::cin >> w[i];
    }
    
    std::vector<int> dep(n), siz(n), in(n), top(n), bot(n);
    std::vector<std::vector<int>> adj(n);
    for (int i = 1; i < n; i++) {
        adj[p[i]].push_back(i);
    }
    auto dfs1 = [&](auto self, int x) -> void {
        siz[x] = 1;
        for (auto &y : adj[x]) {
            dep[y] = dep[x] + 1;
            self(self, y);
            siz[x] += siz[y];
            if (siz[y] > siz[adj[x][0]]) {
                std::swap(y, adj[x][0]);
            }
        }
    };
    dfs1(dfs1, 0);
    
    std::vector<std::multiset<std::pair<std::pair<int, int>, i64>>> chain(n);
    std::vector<std::multiset<std::pair<int, i64>>> val(n);
    
    auto get = [&](int x = 0) {
        return query(1, 0, n, in[x], in[bot[x]] + 1);
    };
    
    auto getmax = [&](const auto &s, const auto &v, int cnt = 1) {
        i64 ans = 0;
        auto it = s.upper_bound({v, inf});
        while (cnt-- && it != s.begin()) {
            it--;
            if (it->first == v) {
                ans += it->second;
            }
        }
        return ans;
    };
    
    auto add = [&](int x, int a, int c, i64 v) {
        i64 res = getmax(chain[x], std::make_pair(a, c), 2);
        val[x].extract({a, res});
        chain[x].emplace(std::make_pair(a, c), v);
        res = getmax(chain[x], std::make_pair(a, c), 2);
        if (res) {
            val[x].emplace(a, res);
        }
    };
    
    auto del = [&](int x, int a, int c, i64 v) {
        i64 res = getmax(chain[x], std::make_pair(a, c), 2);
        val[x].extract({a, res});
        chain[x].extract({std::make_pair(a, c), v});
        res = getmax(chain[x], std::make_pair(a, c), 2);
        if (res) {
            val[x].emplace(a, res);
        }
    };
    
    auto insert = [&](int x) {
        if (!x) {
            return;
        }
        int y = p[x];
        auto res = get(x);
        add(y, a[x], c[x], res.vl);
        if (res.ans) {
            val[y].emplace(-1, res.ans);
        }
    };
    
    auto erase = [&](int x) {
        if (!x) {
            return;
        }
        int y = p[x];
        auto res = get(x);
        del(y, a[x], c[x], res.vl);
        if (res.ans) {
            val[y].extract({-1, res.ans});
        }
    };
    
    auto update = [&](int x) {
        Info v;
        v.ans = std::max(getmax(val[x], a[x]), getmax(val[x], -1));
        if (!adj[x].empty()) {
            int y = adj[x][0];
            if (a[x] == a[y]) {
                v.vr = getmax(chain[x], std::make_pair(a[y], c[y]));
            }
            if (a[y] == a[x] && c[y] == c[x]) {
                v.len = w[x];
            }
        }
        v.vl = w[x] + getmax(chain[x], std::make_pair(a[x], c[x]));
        modify(1, 0, n, in[x], v);
    };
    
    int cur = 0;
    auto dfs2 = [&](auto self, int x) -> void {
        in[x] = cur++;
        for (auto y : adj[x]) {
            top[y] = y == adj[x][0] ? top[x] : y;
            self(self, y);
            if (y != adj[x][0]) {
                insert(y);
            }
        }
        bot[x] = adj[x].empty() ? x : bot[adj[x][0]];
        update(x);
    };
    dfs2(dfs2, 0);
    
    auto change = [&](int x, int y) {
        for (int i = x; i != -1; i = p[top[i]]) {
            erase(top[i]);
        }
        a[x] = y;
        if (top[x] != x) {
            update(p[x]);
        }
        for (int i = x; i != -1; i = p[top[i]]) {
            update(i);
            insert(top[i]);
        }
    };
    
    auto answer = [&]() {
        std::cout << get().ans << "\n";
    };
    
    answer();
    while (q--) {
        int x, y;
        std::cin >> x >> y;
        x--;
        
        change(x, y);
        
        answer();
    }
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3588kb

input:

5 5
5 4 3 4 5
1 2 3 1
2 2 2 2
4 9 2 6
2 5
4 5
5 4
3 5
2 1

output:

6
10
10
4
15
2

result:

ok 6 numbers

Test #2:

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

input:

13 21
1 2 1 2 4 4 2 1 4 2 3 6 1
1 1 2 3 2 6 7 8 9 10 8 8
2 13 1 1 1 2 2 1 2 1 2 1
472868230 94771637 209247951 483753517 822923242 938504499 413445582 328056598 487969741 355938152 902390974 28610378
2 4
7 4
10 1
8 4
2 3
5 2
11 4
9 3
6 2
6 1
4 1
6 1
2 3
8 2
5 2
6 2
8 4
8 2
1 4
11 4
12 2

output:

209247951
822923242
938504499
938504499
1351950081
1351950081
1351950081
1351950081
1351950081
413445582
413445582
413445582
413445582
413445582
94771637
94771637
94771637
413445582
94771637
0
0
902390974

result:

ok 22 numbers

Test #3:

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

input:

200000 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
1999164873
199...

result:

ok 200000 numbers

Test #4:

score: 0
Accepted
time: 1137ms
memory: 64320kb

input:

199999 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
1999993380
199...

result:

ok 199999 numbers

Test #5:

score: 0
Accepted
time: 1767ms
memory: 72500kb

input:

200000 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
1997943637
199...

result:

ok 200000 numbers

Test #6:

score: 0
Accepted
time: 1055ms
memory: 63504kb

input:

199999 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
1999990769
199...

result:

ok 200001 numbers

Test #7:

score: 0
Accepted
time: 1429ms
memory: 68304kb

input:

199999 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
1999694869
199...

result:

ok 200001 numbers

Test #8:

score: 0
Accepted
time: 1161ms
memory: 63980kb

input:

200000 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
1999975784
199...

result:

ok 199999 numbers

Test #9:

score: 0
Accepted
time: 1133ms
memory: 64040kb

input:

200000 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
1999979021
199...

result:

ok 200000 numbers

Test #10:

score: 0
Accepted
time: 1592ms
memory: 68824kb

input:

199998 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
1999727070
199...

result:

ok 200001 numbers

Test #11:

score: 0
Accepted
time: 1124ms
memory: 64572kb

input:

199999 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
1999998737
199...

result:

ok 199999 numbers

Test #12:

score: 0
Accepted
time: 1791ms
memory: 71708kb

input:

199999 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
1998690305
199...

result:

ok 199999 numbers

Test #13:

score: 0
Accepted
time: 1500ms
memory: 64608kb

input:

200000 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
10779640138
...

result:

ok 200001 numbers

Test #14:

score: 0
Accepted
time: 1489ms
memory: 64580kb

input:

199999 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
10233934986
...

result:

ok 199999 numbers

Test #15:

score: 0
Accepted
time: 1505ms
memory: 64648kb

input:

199999 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
10888368837
...

result:

ok 200000 numbers

Test #16:

score: 0
Accepted
time: 1525ms
memory: 64608kb

input:

200000 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
10145392799
...

result:

ok 199999 numbers

Test #17:

score: 0
Accepted
time: 1452ms
memory: 64540kb

input:

199998 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
12633249112
...

result:

ok 199999 numbers

Test #18:

score: 0
Accepted
time: 1454ms
memory: 64568kb

input:

199998 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
9731835557
973...

result:

ok 199999 numbers

Test #19:

score: 0
Accepted
time: 1486ms
memory: 64532kb

input:

199998 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
12966559168
...

result:

ok 200001 numbers

Test #20:

score: 0
Accepted
time: 1471ms
memory: 64596kb

input:

200000 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
10903605928
...

result:

ok 199999 numbers

Test #21:

score: 0
Accepted
time: 1494ms
memory: 64636kb

input:

199999 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
12327114808
...

result:

ok 199999 numbers

Test #22:

score: 0
Accepted
time: 1430ms
memory: 64608kb

input:

199999 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
10794900302
...

result:

ok 200001 numbers

Test #23:

score: 0
Accepted
time: 679ms
memory: 67048kb

input:

199998 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

6694759253332
6694759253332
6694759253332
6694759253332
6694759253332
6694759253332
6694759253332
6694759253332
6694759253332
6694759253332
5604670721548
5604670721548
5604670721548
5604670721548
5604670721548
5604670721548
5604670721548
5604670721548
5604670721548
5604670721548
5604670721548
560467...

result:

ok 200001 numbers

Test #24:

score: 0
Accepted
time: 710ms
memory: 67096kb

input:

199999 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

8730169189068
8730169189068
8730169189068
8730169189068
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6879673837193
6498003008733
6498003008733
649800...

result:

ok 199999 numbers

Test #25:

score: 0
Accepted
time: 713ms
memory: 66980kb

input:

199999 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

16964972670721
16390048684544
16390048684544
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
9913582115275
7849037632647
7849037632647
7849037632647
784...

result:

ok 200000 numbers

Test #26:

score: 0
Accepted
time: 678ms
memory: 67008kb

input:

200000 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10119248263503
10119248263503
10119248263503
10119248263503
10119248263503
8542130343519
8542130343519
8542130343519
8542130343519
6842138653779
6842138653779
6842138653779
6842138653779
6842138653779
6842138653779
6842138653779
6842138653779
6842138653779
6842138653779
6842138653779
6842138653779
6...

result:

ok 200000 numbers

Test #27:

score: 0
Accepted
time: 719ms
memory: 67028kb

input:

199998 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

16872130560892
16872130560892
16872130560892
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
15104243748166
...

result:

ok 200001 numbers

Test #28:

score: 0
Accepted
time: 693ms
memory: 67060kb

input:

199999 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

8838414514239
8838414514239
8838414514239
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
8373720423412
6995924779246
6995924779246
6995924779246
6995924779246
699592...

result:

ok 200000 numbers

Test #29:

score: 0
Accepted
time: 726ms
memory: 67056kb

input:

200000 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

7701141318718
7701141318718
7701141318718
7701141318718
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
4418870471250
441887...

result:

ok 199999 numbers

Test #30:

score: 0
Accepted
time: 719ms
memory: 67140kb

input:

199999 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

17022193248209
17022193248209
17022193248209
17022193248209
17022193248209
10792831394227
10792831394227
10792831394227
10792831394227
10792831394227
10792831394227
10792831394227
10792831394227
10792831394227
10792831394227
6123864764662
6123864764662
6123864764662
6123864764662
6123864764662
61238...

result:

ok 200000 numbers

Test #31:

score: 0
Accepted
time: 714ms
memory: 67144kb

input:

199999 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
15888329431172
11083692627808
11083692627808
11083692627808
11083692627808
11083692627808
...

result:

ok 200001 numbers

Test #32:

score: 0
Accepted
time: 715ms
memory: 66996kb

input:

199999 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

8839751622015
8839751622015
8839751622015
8839751622015
8839751622015
8839751622015
8839751622015
8127355953055
8127355953055
8127355953055
8127355953055
8127355953055
8127355953055
8127355953055
8127355953055
8127355953055
6876528315124
6876528315124
6876528315124
6876528315124
6876528315124
687652...

result:

ok 199999 numbers

Test #33:

score: 0
Accepted
time: 267ms
memory: 74964kb

input:

200000 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
9725472699
972...

result:

ok 200001 numbers

Test #34:

score: 0
Accepted
time: 285ms
memory: 75096kb

input:

199998 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
10876048367
...

result:

ok 200000 numbers

Test #35:

score: 0
Accepted
time: 259ms
memory: 75044kb

input:

199998 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
4757124594
475...

result:

ok 199999 numbers

Test #36:

score: 0
Accepted
time: 275ms
memory: 75100kb

input:

199999 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
10754456505
...

result:

ok 200000 numbers

Test #37:

score: 0
Accepted
time: 279ms
memory: 75084kb

input:

199999 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
10586909197
...

result:

ok 200001 numbers

Test #38:

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

input:

200000 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
15202297780
...

result:

ok 200000 numbers

Test #39:

score: 0
Accepted
time: 1807ms
memory: 69100kb

input:

200000 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
14045671356
...

result:

ok 200001 numbers

Test #40:

score: 0
Accepted
time: 1783ms
memory: 68780kb

input:

199998 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
13920420868
...

result:

ok 199999 numbers

Test #41:

score: 0
Accepted
time: 1833ms
memory: 69168kb

input:

199999 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
13749433620
...

result:

ok 200000 numbers

Test #42:

score: 0
Accepted
time: 1862ms
memory: 69096kb

input:

200000 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
13903763549
...

result:

ok 199999 numbers

Test #43:

score: 0
Accepted
time: 1799ms
memory: 68616kb

input:

200000 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
13828228862
...

result:

ok 200000 numbers

Test #44:

score: 0
Accepted
time: 1942ms
memory: 71752kb

input:

199999 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
5890088235
589...

result:

ok 200000 numbers

Test #45:

score: 0
Accepted
time: 1985ms
memory: 71996kb

input:

200000 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
4585029213
458...

result:

ok 200001 numbers

Test #46:

score: 0
Accepted
time: 1987ms
memory: 71712kb

input:

200000 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
5828176817
582...

result:

ok 200001 numbers

Test #47:

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

input:

199998 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
10818152720
...

result:

ok 200000 numbers

Test #48:

score: 0
Accepted
time: 2014ms
memory: 70352kb

input:

200000 199999
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
11176355739
...

result:

ok 200000 numbers

Test #49:

score: 0
Accepted
time: 2013ms
memory: 71700kb

input:

199998 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
6951297596
695...

result:

ok 199999 numbers

Test #50:

score: 0
Accepted
time: 1974ms
memory: 70948kb

input:

199998 200000
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
12892129784
...

result:

ok 200001 numbers

Test #51:

score: 0
Accepted
time: 1993ms
memory: 71404kb

input:

199999 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
8893665873
889...

result:

ok 199999 numbers

Test #52:

score: 0
Accepted
time: 1915ms
memory: 68852kb

input:

199998 199998
1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1064 1...

output:

13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
13933086708
...

result:

ok 199999 numbers

Test #53:

score: 0
Accepted
time: 1558ms
memory: 65744kb

input:

200000 199998
49441 37885 24128 648 776 55 32583 34146 15473 59281 3478 8998 15132 88193 8815 94360 22342 8413 19377 16187 38814 15720 33706 48309 1393 4424 10729 4675 4420 33459 15552 29757 32030 4361 16053 18663 22470 13941 7275 2255 8 47975 18888 38456 23806 80532 2893 1446 3890 34427 68534 32984...

output:

669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
669645996
...

result:

ok 199999 numbers

Test #54:

score: 0
Accepted
time: 1522ms
memory: 65664kb

input:

199999 199999
40518 8211 65911 33288 105868 65619 149729 113811 189467 173883 29621 110825 179103 93030 187332 14245 190242 111183 145983 140740 140034 61807 7766 78468 143624 135365 60429 62403 69629 35943 74390 120590 170604 115104 195260 45050 138351 67444 16049 79825 114806 27255 139603 49410 16...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 200000 numbers

Test #55:

score: 0
Accepted
time: 697ms
memory: 66300kb

input:

199998 200000
229 32 1283 61 797 225 5 1812 209 48 79 1 13 754 9 15 21 15 377 330 4 212 66 40 1899 20 3 1707 789 744 7 1812 355 6 85 285 1 4 664 442 2589 90 29 1574 855 83 26 160 601 973 3 136 100 51 989 7667 1361 790 21 13 72 3 263 1354 3749 32 248 64 9 11 2932 54 125 18 11 1480 12 540 11 195 239 2...

output:

999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
999197103
...

result:

ok 200001 numbers

Test #56:

score: 0
Accepted
time: 686ms
memory: 66344kb

input:

199999 199999
139 512 1541 6 409 3761 9 2 1607 38 1 17 64 245 1458 1 261 19 4 123 1276 870 97 1 206 142 31 6 312 4 41 92 21 376 40 2 10 946 26 16 96 4 405 1 3 21 1489 104 91 53 10 14 233 2062 3255 15 1 1939 483 81 8 6 100 283 676 30 864 58 117 19 12 84 98 11 162 1334 28 1 3 397 14 196 192 5332 23 8 ...

output:

999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
999889285
...

result:

ok 200000 numbers

Test #57:

score: 0
Accepted
time: 726ms
memory: 67248kb

input:

200000 199998
1 2 1 1 1 2 4 1 1 2 1 1 1 1 2 4 2 1 1 3 3 1 3 1 1 2 2 1 1 1 2 1 2 2 1 1 1 1 4 3 1 3 3 3 2 1 3 2 1 1 1 4 1 2 1 2 4 2 1 1 3 2 2 1 1 1 1 1 2 2 1 1 1 2 1 4 2 1 2 1 4 1 1 3 3 3 1 4 1 3 1 2 2 1 3 1 3 1 3 2 1 2 2 2 1 1 3 1 1 2 1 3 1 1 2 2 1 4 2 2 1 1 2 1 2 2 1 3 3 3 1 3 2 1 1 1 1 3 2 1 1 3 1 ...

output:

4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
4869794433
486...

result:

ok 199999 numbers

Test #58:

score: 0
Accepted
time: 1917ms
memory: 66896kb

input:

200000 199998
1 1 1 1 3 2 1 1 1 1 2 2 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 1 1 1 3 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 ...

output:

12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
12350643166
...

result:

ok 199999 numbers

Test #59:

score: 0
Accepted
time: 1954ms
memory: 70232kb

input:

199999 199999
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
11584589800
...

result:

ok 200000 numbers

Test #60:

score: 0
Accepted
time: 1855ms
memory: 67528kb

input:

200000 200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
14807286806
...

result:

ok 200001 numbers