QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#608392#5278. Mex and CardsYshanqianAC ✓2098ms104300kbC++204.4kb2024-10-03 21:26:572024-10-03 21:26:58

Judging History

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

  • [2024-10-03 21:26:58]
  • 评测
  • 测评结果:AC
  • 用时:2098ms
  • 内存:104300kb
  • [2024-10-03 21:26:57]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define xx first
#define yy second
#define endl "\n"
#define pb push_back
#define int long long
#define ll long long
#define lowbit(x) x & (-x)
typedef pair<int, int> pii;
#define LF(x) fixed << setprecision(x)
#define Yshanqian ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
const int N = 4e5 + 10, M = 1010, inf = 0x3f3f3f3f, mod = 1e9 + 7, P = 13331;
int n;
int a[N], b[N], cnt[N];
multiset<int> st;
struct node
{
    int l, r;
    int mn, lazy;
} tr[N << 2];
void pushup(int u)
{
    tr[u].mn = min(tr[u << 1].mn, tr[u << 1 | 1].mn);
}
void build(int u, int l, int r)
{
    tr[u] = {l, r, 0, 0};
    if (l == r)
        return;
    int mid = l + r >> 1;
    build(u << 1, l, mid);
    build(u << 1 | 1, mid + 1, r);
}
void change(int u, int x)
{
    tr[u].mn += x;
    tr[u].lazy += x;
}
void pushdown(int u)
{
    if (tr[u].lazy)
    {
        change(u << 1, tr[u].lazy);
        change(u << 1 | 1, tr[u].lazy);
        tr[u].lazy = 0;
    }
}
void modify(int u, int l, int r, int x)
{
    if (tr[u].l >= l && tr[u].r <= r)
    {
        change(u, x);
        return;
    }
    pushdown(u);
    int mid = tr[u].l + tr[u].r >> 1;
    if (l <= mid)
        modify(u << 1, l, r, x);
    if (r > mid)
        modify(u << 1 | 1, l, r, x);
    pushup(u);
}
int ask(int u, int l, int r)
{
    if (tr[u].l >= l && tr[u].r <= r)
        return tr[u].mn;
    pushdown(u);
    int mid = tr[u].l + tr[u].r >> 1;
    int ans = inf;
    if (l <= mid)
        ans = min(ans, ask(u << 1, l, r));
    if (r > mid)
        ans = min(ans, ask(u << 1 | 1, l, r));
    return ans;
}
void solve()
{
    int ans = 0;
    cin >> n;
    build(1, 1, 3e5);
    int mn = inf;
    b[0] = inf;
    int lst = -1;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        b[i] = min(b[i - 1], a[i]);
        if (b[i] != 0)
            lst = i;
    }
    int s = 0;
    int pre = 0;
    for (int i = lst; i >= 1; i--)
    {
        if (b[i] != pre)
        {
            for (int j = 1; j <= b[i] - s; j++)
                st.insert(i), ans += i, cnt[i]++;
            pre = b[i], s += b[i] - s;
        }

        modify(1, i, i, a[i] - pre);
    }

    for (int i = lst + 1; i <= n; i++)
    {
        if (a[i])
            modify(1, i, i, a[i]);
    }

    cout << ans << endl;

    st.insert(0);
    int q;
    cin >> q;
    while (q--)
    {
        int op, x;
        cin >> op >> x;
        x++;

        if (op == 1) // 加一个数
        {
            if (st.find(x - 1) != st.end())
            {
                int l = 1, r = 2e5 + 10;
                while (l < r)
                {
                    int mid = l + r + 1 >> 1;
                    if (ask(1, x + 1, x + mid))
                        l = mid;
                    else
                        r = mid - 1;
                }
                if (ask(1, x + 1, x + 1))
                {
                    ans += r + 1;
                    modify(1, x + 1, x + r, -1);
                    cnt[x + r]++;
                    // if (cnt[x + r] == 1)
                    st.insert(x + r);
                }
                else
                {
                    ans++;
                    cnt[x]++;
                    // if (cnt[x] == 1)
                    st.insert(x);
                }
                if (x - 1 != 0)
                {
                    cnt[x - 1]--;
                    /// if (cnt[x - 1] == 0)
                    st.erase(st.find(x - 1));
                }
            }
            else
                modify(1, x, x, 1);
        }
        else
        {
            if (ask(1, x, x))
                modify(1, x, x, -1);
            else
            {
                auto it = st.lower_bound(x);
                int now = *it;
                ans -= now - x + 1;
                if (x != now)
                    modify(1, x + 1, now, 1);
                cnt[now]--;
                //  if (cnt[now] == 0)
                st.erase(it);
                cnt[x - 1]++;
                // if (cnt[x - 1] == 1)
                st.insert(x - 1);
            }
        }
        cout << ans << endl;
    }
}
signed main()
{
    Yshanqian;
    int T;
    T = 1;
    // cin >> T;
    for (int cases = 1; cases <= T; ++cases)
    {
        // cout<<"Case #"<<cases<<": ";
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 4ms
memory: 44440kb

input:

5
2 1 3 0 2
6
1 0
1 1
2 4
1 3
2 1
2 1

output:

4
5
7
7
9
7
3

result:

ok 7 numbers

Test #2:

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

input:

1
0
0

output:

0

result:

ok 1 number(s): "0"

Test #3:

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

input:

10
3 8 1 4 10 3 10 9 7 10
20
2 5
1 4
1 2
1 4
1 3
1 3
1 0
2 8
1 5
1 4
1 0
1 3
1 8
1 6
1 4
1 1
1 5
1 9
1 6
2 7

output:

14
14
14
22
22
22
22
24
24
24
24
26
26
26
26
26
26
26
26
26
26

result:

ok 21 numbers

Test #4:

score: 0
Accepted
time: 3ms
memory: 43384kb

input:

10
9 8 7 5 5 4 3 2 1 1
20
2 4
1 8
2 6
1 2
1 2
2 5
2 2
1 0
1 6
1 6
2 9
1 2
2 7
2 8
2 3
1 9
1 7
1 4
2 6
1 7

output:

45
44
45
44
45
45
44
44
45
46
46
45
45
43
43
42
43
44
44
44
45

result:

ok 21 numbers

Test #5:

score: 0
Accepted
time: 3ms
memory: 42712kb

input:

100
969 519 608 546 957 82 670 100 92 581 974 529 970 54 639 216 238 620 966 162 430 10 446 884 895 292 450 180 619 389 943 855 204 605 514 997 325 98 643 915 744 249 333 431 160 434 714 976 168 573 682 69 873 285 668 561 159 858 864 683 266 564 350 214 461 421 213 568 279 624 749 433 735 437 978 95...

output:

4923
4923
4923
4923
4923
4923
4923
4923
4923
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4927
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
4931
...

result:

ok 1001 numbers

Test #6:

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

input:

100
994 983 981 980 962 959 959 950 933 887 877 869 841 828 809 807 803 793 789 778 773 772 768 767 765 765 759 757 749 747 742 738 730 724 681 675 656 638 627 626 615 612 593 592 545 543 540 534 531 529 525 520 518 515 512 510 500 494 472 472 432 415 414 411 399 375 350 328 315 307 292 261 258 246 ...

output:

51041
51042
51041
51042
51043
51042
51043
51042
51040
51038
51037
51038
51039
51038
51039
51040
51039
51040
51039
51038
51037
51036
51037
51038
51037
51038
51037
51036
51035
51036
51037
51035
51034
51035
51034
51035
51036
51037
51036
51037
51039
51038
51037
51036
51035
51034
51033
51032
51031
51032
...

result:

ok 1001 numbers

Test #7:

score: 0
Accepted
time: 101ms
memory: 70044kb

input:

1000
549187 776775 748956 28001 575132 18015 112492 144497 206885 842190 403842 456113 424268 871411 648618 186832 693358 781526 443190 175126 586343 918652 923262 973941 509929 433837 392849 452585 497398 331180 118333 152788 959909 539943 747365 261855 819641 618091 801231 355664 285761 895793 398...

output:

6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317898
6317...

result:

ok 10001 numbers

Test #8:

score: 0
Accepted
time: 174ms
memory: 91336kb

input:

1000
999823 997756 997661 997567 995015 993681 993623 993621 993428 993163 990908 989370 987917 986483 984926 983477 982705 982330 982173 981725 981590 980871 980406 978064 976231 974657 969279 968447 968067 967307 966294 965934 965581 964707 964400 962842 962262 961936 961798 961105 958480 957851 9...

output:

515262961
515262960
515262959
515262958
515262959
515262960
515262961
515262960
515262961
515262962
515262963
515262964
515262963
515262964
515262963
515262964
515262965
515262964
515262965
515262966
515262965
515262966
515262967
515262966
515262967
515262968
515262969
515262968
515262967
515262966
...

result:

ok 10001 numbers

Test #9:

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

input:

10000
810601 729711 139357 433916 959178 573779 86115 773421 634334 59653 613563 529054 644885 727194 44262 709529 1681 469658 158976 628846 642964 486044 969568 598670 753102 925097 495487 506784 238141 791563 750457 218880 115527 944709 664199 321209 984344 317419 568689 296228 50862 458459 766006...

output:

6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625728
6625...

result:

ok 200001 numbers

Test #10:

score: 0
Accepted
time: 1345ms
memory: 92348kb

input:

10000
999881 999862 999854 999798 999750 999710 999412 999389 999270 998698 998592 998557 998315 998147 998082 998080 998006 997734 997662 997601 997508 997439 997415 997336 997118 997049 997037 996886 996794 996734 996724 996654 996654 996423 996381 996276 996179 995968 995639 995300 995289 995246 ...

output:

5011255149
5011255148
5011255147
5011255148
5011255149
5011255148
5011255147
5011255148
5011255149
5011255148
5011255147
5011255148
5011255149
5011255148
5011255149
5011255148
5011255147
5011255148
5011255149
5011255147
5011255146
5011255145
5011255146
5011255147
5011255146
5011255145
5011255144
501...

result:

ok 200001 numbers

Test #11:

score: 0
Accepted
time: 348ms
memory: 89800kb

input:

200000
954932 478728 762927 818548 978278 196477 518754 158676 100286 637040 576732 579262 510238 196651 497902 72985 69112 722929 769712 408173 559817 756434 192540 297097 772778 765866 552840 963172 596523 91866 316071 470277 918307 252349 439797 195172 659054 903280 874588 197108 881845 654102 49...

output:

8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828666
8828...

result:

ok 200001 numbers

Test #12:

score: 0
Accepted
time: 1247ms
memory: 91916kb

input:

200000
1000000 1000000 999994 999993 999992 999991 999978 999975 999973 999972 999959 999956 999955 999940 999937 999928 999928 999925 999923 999917 999916 999906 999904 999903 999894 999889 999888 999885 999883 999876 999875 999873 999871 999868 999862 999854 999850 999841 999831 999826 999815 9998...

output:

99850068284
99850068283
99850068284
99850068283
99850068282
99850068283
99850068284
99850068283
99850068284
99850068283
99850068282
99850068283
99850068284
99850068283
99850068282
99850068283
99850068284
99850068282
99850068280
99850068279
99850068278
99850068279
99850068278
99850068278
99850068279
...

result:

ok 200001 numbers

Test #13:

score: 0
Accepted
time: 296ms
memory: 74460kb

input:

200000
554429 815547 991851 877055 4532 462959 254230 849016 817417 522300 178108 87935 418464 198583 568638 156649 672927 961839 278499 102007 523645 288807 991952 147030 477770 977147 163962 984865 173912 276913 85410 762670 580034 737244 549479 937246 188784 443181 132471 156270 651436 9418 61925...

output:

10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
10904793
109...

result:

ok 200001 numbers

Test #14:

score: 0
Accepted
time: 578ms
memory: 92024kb

input:

200000
999996 999993 999992 999988 999987 999983 999983 999981 999977 999974 999966 999956 999949 999938 999929 999926 999926 999922 999914 999911 999901 999898 999898 999895 999894 999884 999882 999875 999872 999869 999860 999848 999835 999826 999814 999797 999788 999786 999781 999778 999768 999762...

output:

100097520798
100097520796
100097520795
100097520794
100097520793
100097520792
100097520791
100097520789
100097520788
100097520787
100097520786
100097520785
100097520784
100097520783
100097520782
100097520781
100097520780
100097520778
100097520777
100097520776
100097520775
100097520774
100097520773
1...

result:

ok 200001 numbers

Test #15:

score: 0
Accepted
time: 236ms
memory: 63788kb

input:

200000
395501 808050 24796 308616 250220 843848 709987 740492 754049 691635 159592 436497 742581 537843 994911 496052 511054 801461 866977 318572 301284 90981 721091 977254 108792 33583 320255 939412 163087 981014 87104 880366 441858 16628 791941 430163 740742 730081 710770 829061 648984 488080 2953...

output:

14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
14172681
141...

result:

ok 200001 numbers

Test #16:

score: 0
Accepted
time: 2098ms
memory: 94988kb

input:

200000
999996 999992 999984 999983 999972 999961 999955 999953 999948 999946 999945 999938 999936 999933 999919 999914 999907 999905 999900 999900 999899 999896 999894 999891 999889 999887 999885 999869 999849 999848 999847 999845 999844 999841 999836 999833 999829 999826 999823 999821 999819 999810...

output:

99858339546
99858339546
99858339547
99858339548
99858339549
99858339549
99858339550
99858339551
99858339552
99858339552
99858339553
99858339554
99858339555
99858339556
99858339557
99858339558
99858339559
99858339559
99858339560
99858339561
99858339562
99858339563
99858339564
99858339565
99858339566
...

result:

ok 200001 numbers

Test #17:

score: 0
Accepted
time: 125ms
memory: 46424kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 200001 numbers

Test #18:

score: 0
Accepted
time: 139ms
memory: 45000kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 200001 numbers

Test #19:

score: 0
Accepted
time: 152ms
memory: 46160kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 200001 numbers

Test #20:

score: 0
Accepted
time: 461ms
memory: 92148kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
199999823257
199999823257
199999821043
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999811360
199999800433
199999800433
199999800433
1...

result:

ok 200001 numbers

Test #21:

score: 0
Accepted
time: 448ms
memory: 94932kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
199999885708
199999838760
199999838760
199999838760
199999838760
199999838760
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
199999807636
1...

result:

ok 200001 numbers

Test #22:

score: 0
Accepted
time: 383ms
memory: 92296kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
2...

result:

ok 200001 numbers

Test #23:

score: 0
Accepted
time: 253ms
memory: 69428kb

input:

123456
520298 969614 843308 70988 364741 858960 112350 176117 611654 851763 608375 522173 3588 449071 828867 904600 296038 562844 308810 820490 852771 383086 249489 724071 369559 529481 771272 327557 642565 990230 771218 796179 690084 403460 364813 577663 262449 971014 140650 360127 94822 438855 222...

output:

7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529135
7529...

result:

ok 200001 numbers

Test #24:

score: 0
Accepted
time: 246ms
memory: 79468kb

input:

200000
734434 924122 396023 411283 799894 62291 320493 947599 104026 118500 802743 81442 660265 77809 387207 897493 594945 112589 897426 28452 706138 294396 4435 462427 876748 325649 297714 372162 311047 607282 230569 156484 926270 303843 868122 17579 887611 618691 943889 162362 709896 242143 111975...

output:

6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769211
6769...

result:

ok 123457 numbers

Test #25:

score: 0
Accepted
time: 944ms
memory: 104300kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
200000000001
200000000002
200000000003
200000000004
200000000005
200000000006
200000000007
200000000008
200000000009
200000000010
200000000011
200000000012
200000000013
200000000014
200000000015
200000000016
200000000017
200000000018
200000000019
200000000020
200000000021
200000000022
2...

result:

ok 200001 numbers

Test #26:

score: 0
Accepted
time: 364ms
memory: 95456kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
2...

result:

ok 200001 numbers

Test #27:

score: 0
Accepted
time: 330ms
memory: 94752kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
2...

result:

ok 200001 numbers

Test #28:

score: 0
Accepted
time: 358ms
memory: 95472kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
2...

result:

ok 200001 numbers

Test #29:

score: 0
Accepted
time: 326ms
memory: 94440kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
2...

result:

ok 200001 numbers

Test #30:

score: 0
Accepted
time: 336ms
memory: 95244kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
200000000000
2...

result:

ok 200001 numbers

Test #31:

score: 0
Accepted
time: 447ms
memory: 92304kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
199999800000
199999600000
199999400000
199999200000
199999000000
199998800000
199998600000
199998400000
199998200000
199998000000
199997800000
199997600000
199997400000
199997200000
199997000000
199996800000
199996600000
199996400000
199996200000
199996000000
199995800000
199995600000
1...

result:

ok 200001 numbers

Test #32:

score: 0
Accepted
time: 450ms
memory: 95304kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
199999800001
199999600002
199999400003
199999200004
199999000005
199998800006
199998600007
199998400008
199998200009
199998000010
199997800011
199997600012
199997400013
199997200014
199997000015
199996800016
199996600017
199996400018
199996200019
199996000020
199995800021
199995600022
1...

result:

ok 200001 numbers

Test #33:

score: 0
Accepted
time: 479ms
memory: 91900kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
199999801234
199999602468
199999403702
199999204936
199999006170
199998807404
199998608638
199998409872
199998211106
199998012340
199997813574
199997614808
199997416042
199997217276
199997018510
199996819744
199996620978
199996422212
199996223446
199996024680
199995825914
199995627148
1...

result:

ok 200001 numbers

Test #34:

score: 0
Accepted
time: 470ms
memory: 95136kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
199999923456
199999846912
199999770368
199999693824
199999617280
199999540736
199999464192
199999387648
199999311104
199999234560
199999158016
199999081472
199999004928
199998928384
199998851840
199998775296
199998698752
199998622208
199998545664
199998469120
199998392576
199998316032
1...

result:

ok 200001 numbers

Test #35:

score: 0
Accepted
time: 462ms
memory: 94840kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
199999999998
199999999996
199999999994
199999999992
199999999990
199999999988
199999999986
199999999984
199999999982
199999999980
199999999978
199999999976
199999999974
199999999972
199999999970
199999999968
199999999966
199999999964
199999999962
199999999960
199999999958
199999999956
1...

result:

ok 200001 numbers

Test #36:

score: 0
Accepted
time: 387ms
memory: 95228kb

input:

200000
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 10000...

output:

200000000000
199999999999
199999999998
199999999997
199999999996
199999999995
199999999994
199999999993
199999999992
199999999991
199999999990
199999999989
199999999988
199999999987
199999999986
199999999985
199999999984
199999999983
199999999982
199999999981
199999999980
199999999979
199999999978
1...

result:

ok 200001 numbers

Test #37:

score: 0
Accepted
time: 430ms
memory: 54296kb

input:

1
123456
200000
1 0
2 0
2 0
1 0
2 0
1 0
2 0
1 0
1 0
2 0
1 0
2 0
1 0
2 0
1 0
2 0
2 0
1 0
1 0
2 0
1 0
2 0
2 0
1 0
1 0
2 0
2 0
1 0
2 0
1 0
2 0
1 0
1 0
2 0
2 0
1 0
1 0
2 0
1 0
2 0
2 0
1 0
2 0
1 0
1 0
2 0
2 0
1 0
2 0
1 0
1 0
2 0
2 0
1 0
1 0
2 0
2 0
1 0
1 0
2 0
2 0
1 0
2 0
1 0
2 0
1 0
2 0
1 0
1 0
2 0
2 0
...

output:

123456
123457
123456
123455
123456
123455
123456
123455
123456
123457
123456
123457
123456
123457
123456
123457
123456
123455
123456
123457
123456
123457
123456
123455
123456
123457
123456
123455
123456
123455
123456
123455
123456
123457
123456
123455
123456
123457
123456
123457
123456
123455
123456...

result:

ok 200001 numbers

Test #38:

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

input:

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

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
8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
0
8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
0
0
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 200001 numbers

Test #39:

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

input:

100
1 0 5 3 9 9 7 2 10 7 3 9 3 7 8 10 7 0 2 2 6 4 2 3 9 3 6 6 1 3 10 9 4 5 4 8 5 1 6 0 7 9 10 3 5 8 9 10 4 8 1 9 6 1 1 2 8 5 9 8 9 7 2 9 2 6 0 1 3 5 5 2 8 0 8 8 2 2 2 4 3 7 8 2 2 1 7 6 3 3 0 3 3 7 2 2 1 5 9 3
200000
2 61
1 61
1 0
2 0
2 15
1 15
1 69
2 69
1 50
2 50
2 84
1 84
1 66
2 66
2 15
1 15
1 33
2...

output:

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

result:

ok 200001 numbers

Test #40:

score: 0
Accepted
time: 271ms
memory: 42632kb

input:

100
10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
200000
2 50
1 50
2 66
1 66
1 7
2 7
1 71
2 71
2 18
1 18
2 24
1 24
1 15
2 15
2 39
1 39
1 93...

output:

483
473
483
478
483
484
483
484
483
475
483
481
483
483
483
482
483
483
483
479
483
479
483
482
483
476
483
483
483
483
483
483
483
475
483
482
483
476
483
483
483
484
483
483
483
482
483
475
483
480
483
480
483
476
483
484
483
470
483
482
483
483
483
483
483
470
483
483
483
475
483
482
483
483
483
...

result:

ok 200001 numbers

Test #41:

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

input:

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

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

Test #42:

score: 0
Accepted
time: 317ms
memory: 43788kb

input:

1000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 9 9 ...

output:

5196
5129
5196
5196
5196
5196
5196
5196
5196
5189
5196
5196
5196
5196
5196
5160
5196
5166
5196
5196
5196
5137
5196
5196
5196
5108
5196
5111
5196
5196
5196
5196
5196
5196
5196
5112
5196
5118
5196
5137
5196
5196
5196
5196
5196
5196
5196
5196
5196
5127
5196
5148
5196
5196
5196
5153
5196
5196
5196
5152
...

result:

ok 200001 numbers

Test #43:

score: 0
Accepted
time: 95ms
memory: 43532kb

input:

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

output:

18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
...

result:

ok 200001 numbers

Test #44:

score: 0
Accepted
time: 377ms
memory: 44564kb

input:

10000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ...

output:

49956
49540
49956
49122
49956
49341
49956
49956
49956
49956
49956
49956
49956
49956
49956
49218
49956
49956
49956
49956
49956
49956
49956
49956
49956
49956
49956
49328
49956
49956
49956
49956
49956
49956
49956
49630
49956
49956
49956
49956
49956
49956
49956
49956
49956
49956
49956
49325
49956
49956
...

result:

ok 200001 numbers

Test #45:

score: 0
Accepted
time: 375ms
memory: 43164kb

input:

10000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...

output:

502056
502007
502056
502056
502056
502056
502056
502032
502056
502044
502056
501975
502056
502001
502056
502056
502056
501971
502056
502056
502056
501963
502056
501996
502056
502056
502056
502056
502056
502041
502056
501993
502056
502056
502056
502009
502056
502056
502056
502056
502056
502056
502056...

result:

ok 200001 numbers

Test #46:

score: 0
Accepted
time: 135ms
memory: 45548kb

input:

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

output:

54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
...

result:

ok 200001 numbers

Test #47:

score: 0
Accepted
time: 533ms
memory: 45044kb

input:

200000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10...

output:

997682
981019
997682
997682
997682
997682
997682
992736
997682
997562
997682
984936
997682
997682
997682
997682
997682
997682
997682
997682
997682
997682
997682
997682
997682
983892
997682
997682
997682
997682
997682
991772
997682
997682
997682
997682
997682
997682
997682
986393
997682
988006
997682...

result:

ok 200001 numbers

Test #48:

score: 0
Accepted
time: 442ms
memory: 48308kb

input:

200000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 1...

output:

9977120
9975098
9977120
9975987
9977120
9975830
9977120
9975393
9977120
9975819
9977120
9977120
9977120
9976084
9977120
9976844
9977120
9976330
9977120
9977120
9977120
9975692
9977120
9977120
9977120
9977120
9977120
9977120
9977120
9977120
9977120
9975416
9977120
9977120
9977120
9977120
9977120
9977...

result:

ok 200001 numbers

Test #49:

score: 0
Accepted
time: 441ms
memory: 45144kb

input:

200000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 100...

output:

99951271
99951209
99951271
99951271
99951271
99951271
99951271
99951271
99951271
99951271
99951271
99951271
99951271
99951222
99951271
99951272
99951271
99951271
99951271
99951271
99951271
99951080
99951271
99951117
99951271
99951211
99951271
99951206
99951271
99951271
99951271
99951271
99951271
999...

result:

ok 200001 numbers

Test #50:

score: 0
Accepted
time: 533ms
memory: 45568kb

input:

200000
10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9998 9998 9998 9998 9998 9998 9998 9998 9998 9998 9998 9998 9998 9998 9998 9998 9998 ...

output:

997733910
997733886
997733910
997733910
997733910
997733910
997733910
997733910
997733910
997733909
997733910
997733901
997733910
997733910
997733910
997733910
997733910
997733904
997733910
997733908
997733910
997733890
997733910
997733910
997733910
997733895
997733910
997733910
997733910
997733905
...

result:

ok 200001 numbers

Test #51:

score: 0
Accepted
time: 689ms
memory: 50068kb

input:

200000
100000 100000 99999 99998 99998 99998 99998 99997 99997 99996 99996 99996 99995 99994 99994 99994 99993 99993 99991 99991 99990 99990 99989 99989 99989 99989 99989 99989 99986 99986 99985 99984 99983 99983 99982 99982 99982 99982 99981 99981 99980 99980 99979 99979 99978 99978 99977 99976 999...

output:

10002648031
10002648032
10002648031
10002648031
10002648031
10002648029
10002648031
10002648032
10002648031
10002648027
10002648031
10002648029
10002648031
10002648032
10002648031
10002648030
10002648031
10002648029
10002648031
10002648032
10002648031
10002648027
10002648031
10002648032
10002648031
...

result:

ok 200001 numbers

Test #52:

score: 0
Accepted
time: 1063ms
memory: 94512kb

input:

200000
1000000 1000000 999994 999993 999992 999991 999978 999975 999973 999972 999959 999956 999955 999940 999937 999928 999928 999925 999923 999917 999916 999906 999904 999903 999894 999889 999888 999885 999883 999876 999875 999873 999871 999868 999862 999854 999850 999841 999831 999826 999815 9998...

output:

99850068284
99850068283
99850068284
99850068285
99850068284
99850068283
99850068284
99850068283
99850068284
99850068285
99850068284
99850068285
99850068284
99850068283
99850068284
99850068285
99850068284
99850068283
99850068284
99850068283
99850068284
99850068285
99850068284
99850068285
99850068284
...

result:

ok 200001 numbers

Test #53:

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

input:

200000
900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001...

output:

180000200000
180000200000
180000200000
180000200000
180000200000
180000006633
180000200000
180000093708
180000200000
180000029672
180000200000
180000200000
180000200000
180000200000
180000200000
180000185094
180000200000
180000088036
180000200000
180000198342
180000200000
180000056172
180000200000
1...

result:

ok 200001 numbers

Test #54:

score: 0
Accepted
time: 681ms
memory: 87288kb

input:

200000
900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002 900002...

output:

180000300036
180000300036
180000300036
180000238643
180000300036
180000225626
180000300036
180000291943
180000300036
180000300036
180000300036
180000257454
180000300036
180000268502
180000300036
180000246553
180000300036
180000269970
180000300036
180000252218
180000300036
180000300036
180000300036
1...

result:

ok 200001 numbers

Test #55:

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

input:

200000
900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005 900005...

output:

180000599938
180000599938
180000599938
180000599938
180000599938
180000599938
180000599938
180000591866
180000599938
180000599938
180000599938
180000599938
180000599938
180000599938
180000599938
180000599938
180000599938
180000599938
180000599938
180000574044
180000599938
180000599938
180000599938
1...

result:

ok 200001 numbers

Test #56:

score: 0
Accepted
time: 696ms
memory: 90584kb

input:

200000
900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014 900014...

output:

180001500816
180001490266
180001500816
180001494225
180001500816
180001497014
180001500816
180001491782
180001500816
180001497905
180001500816
180001500816
180001500816
180001500816
180001500816
180001500816
180001500816
180001500353
180001500816
180001500816
180001500816
180001494439
180001500816
1...

result:

ok 200001 numbers

Test #57:

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

input:

200000
900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042 900042...

output:

180004291829
180004291762
180004291829
180004291829
180004291829
180004291567
180004291829
180004291829
180004291829
180004291829
180004291829
180004291829
180004291829
180004289612
180004291829
180004288657
180004291829
180004290806
180004291829
180004291829
180004291829
180004290351
180004291829
1...

result:

ok 200001 numbers

Test #58:

score: 0
Accepted
time: 735ms
memory: 90780kb

input:

200000
900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132 900132...

output:

180013275281
180013274998
180013275281
180013274555
180013275281
180013274019
180013275281
180013274742
180013275281
180013275281
180013275281
180013274229
180013275281
180013275281
180013275281
180013275281
180013275281
180013274970
180013275281
180013275281
180013275281
180013275281
180013275281
1...

result:

ok 200001 numbers

Test #59:

score: 0
Accepted
time: 738ms
memory: 87228kb

input:

200000
900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429 900429...

output:

180043075110
180043074798
180043075110
180043075055
180043075110
180043075110
180043075110
180043075047
180043075110
180043075048
180043075110
180043075110
180043075110
180043074883
180043075110
180043074989
180043075110
180043074713
180043075110
180043075025
180043075110
180043074960
180043075110
1...

result:

ok 200001 numbers

Test #60:

score: 0
Accepted
time: 730ms
memory: 87756kb

input:

200000
901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500 901500...

output:

180150074867
180150074852
180150074867
180150074867
180150074867
180150074724
180150074867
180150074867
180150074867
180150074867
180150074867
180150074829
180150074867
180150074783
180150074867
180150074797
180150074867
180150074828
180150074867
180150074867
180150074867
180150074842
180150074867
1...

result:

ok 200001 numbers

Test #61:

score: 0
Accepted
time: 742ms
memory: 90696kb

input:

200000
904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444 904444...

output:

180444721758
180444721758
180444721758
180444721755
180444721758
180444721758
180444721758
180444721747
180444721758
180444721716
180444721758
180444721741
180444721758
180444721758
180444721758
180444721758
180444721758
180444721739
180444721758
180444721742
180444721758
180444721758
180444721758
1...

result:

ok 200001 numbers

Test #62:

score: 0
Accepted
time: 746ms
memory: 90800kb

input:

200000
910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 910000 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999 909999...

output:

181000385806
181000385794
181000385806
181000385806
181000385806
181000385799
181000385806
181000385805
181000385806
181000385806
181000385806
181000385807
181000385806
181000385806
181000385806
181000385805
181000385806
181000385789
181000385806
181000385806
181000385806
181000385805
181000385806
1...

result:

ok 200001 numbers

Test #63:

score: 0
Accepted
time: 819ms
memory: 91576kb

input:

200000
930000 930000 929999 929999 929999 929999 929998 929998 929998 929998 929998 929997 929997 929997 929997 929997 929997 929996 929996 929996 929996 929996 929996 929996 929995 929995 929995 929995 929995 929994 929994 929994 929994 929994 929994 929994 929993 929993 929993 929993 929993 929993...

output:

183003052806
183003052806
183003052806
183003052806
183003052806
183003052799
183003052806
183003052801
183003052806
183003052806
183003052806
183003052806
183003052806
183003052800
183003052806
183003052806
183003052806
183003052806
183003052806
183003052806
183003052806
183003052801
183003052806
1...

result:

ok 200001 numbers

Test #64:

score: 0
Accepted
time: 923ms
memory: 95448kb

input:

200000
1000000 1000000 999999 999999 999998 999998 999997 999997 999997 999996 999996 999995 999994 999994 999994 999994 999993 999992 999992 999991 999990 999990 999988 999988 999988 999988 999988 999987 999987 999986 999984 999984 999983 999982 999982 999982 999982 999981 999980 999980 999979 9999...

output:

189990575465
189990575465
189990575465
189990575466
189990575465
189990575463
189990575465
189990575458
189990575465
189990575466
189990575465
189990575464
189990575465
189990575466
189990575465
189990575463
189990575465
189990575464
189990575465
189990575466
189990575465
189990575462
189990575465
1...

result:

ok 200001 numbers

Test #65:

score: 0
Accepted
time: 666ms
memory: 89980kb

input:

200000
900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001 900001...

output:

180000200000
180000200000
180000200000
180000200000
180000200000
180000200000
180000200000
180000119908
180000200000
180000190901
180000200000
180000200000
180000200000
180000185421
180000200000
180000200000
180000200000
180000200000
180000200000
180000043846
180000200000
180000096304
180000200000
1...

result:

ok 200001 numbers

Test #66:

score: 0
Accepted
time: 533ms
memory: 87544kb

input:

200000
900001 900002 900001 900002 900002 900002 900001 900002 900001 900002 900001 900001 900001 900002 900001 900001 900001 900001 900001 900002 900001 900002 900002 900002 900002 900001 900002 900001 900002 900001 900002 900001 900001 900002 900002 900001 900002 900001 900001 900002 900002 900002...

output:

180000200000
180000200000
180000200000
180000059023
180000200000
180000085821
180000200000
180000200000
180000200000
180000200000
180000200000
180000200000
180000200000
180000200000
180000200000
180000044705
180000200000
180000026088
180000200000
180000110123
180000200000
180000200000
180000200000
1...

result:

ok 200001 numbers

Test #67:

score: 0
Accepted
time: 425ms
memory: 90104kb

input:

200000
900002 900004 900001 900004 900003 900002 900003 900002 900001 900004 900005 900002 900002 900004 900004 900002 900003 900001 900001 900004 900005 900003 900001 900002 900002 900004 900001 900004 900002 900004 900002 900002 900002 900002 900004 900003 900002 900003 900002 900004 900002 900004...

output:

180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000019851
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000200002
180000000729
180000200002
1...

result:

ok 200001 numbers

Test #68:

score: 0
Accepted
time: 380ms
memory: 87440kb

input:

200000
900009 900006 900005 900001 900009 900001 900005 900014 900007 900002 900009 900011 900007 900003 900007 900002 900002 900014 900002 900001 900008 900001 900004 900005 900001 900006 900005 900001 900001 900004 900014 900010 900006 900001 900001 900004 900008 900005 900008 900005 900008 900012...

output:

180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000177116
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
180000200017
1...

result:

ok 200001 numbers

Test #69:

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

input:

200000
900012 900004 900024 900006 900014 900040 900032 900009 900011 900025 900007 900037 900032 900006 900020 900006 900020 900031 900038 900004 900019 900004 900022 900002 900039 900041 900021 900016 900033 900009 900001 900033 900003 900025 900032 900034 900018 900034 900008 900028 900035 900035...

output:

180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
180000200084
1...

result:

ok 200001 numbers

Test #70:

score: 0
Accepted
time: 358ms
memory: 87224kb

input:

200000
900045 900073 900042 900130 900106 900064 900030 900031 900062 900093 900026 900049 900057 900037 900015 900091 900090 900112 900093 900066 900097 900107 900004 900029 900071 900087 900118 900121 900057 900085 900034 900114 900086 900081 900068 900124 900048 900021 900031 900120 900043 900132...

output:

180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
180000200715
1...

result:

ok 200001 numbers

Test #71:

score: 0
Accepted
time: 359ms
memory: 89936kb

input:

200000
900177 900212 900302 900044 900059 900293 900181 900406 900282 900200 900064 900296 900369 900260 900224 900022 900157 900186 900382 900175 900268 900284 900013 900286 900241 900095 900230 900089 900347 900368 900332 900189 900272 900188 900417 900337 900287 900265 900195 900406 900292 900376...

output:

180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000204328
180000070684
180000204328
1...

result:

ok 200001 numbers

Test #72:

score: 0
Accepted
time: 355ms
memory: 87324kb

input:

200000
900847 901111 900586 901010 900762 900439 901409 901242 900316 900970 900256 900153 900126 900607 901297 900110 900745 900329 900379 901385 900407 901409 901074 901476 900156 900937 900236 901182 900958 901328 901437 900327 900462 901232 901328 900439 900825 900699 901432 900235 901108 901322...

output:

180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
180000222953
1...

result:

ok 200001 numbers

Test #73:

score: 0
Accepted
time: 337ms
memory: 90924kb

input:

200000
902863 902411 900508 902382 901593 904013 904167 900630 903196 903328 900797 903568 901825 902900 900422 900045 902902 901827 901607 901506 903548 901634 903780 900127 902460 904382 903281 903954 901613 902244 903101 900404 900455 900469 902286 903312 902720 902174 901102 903911 902778 902661...

output:

180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
180000224316
1...

result:

ok 200001 numbers

Test #74:

score: 0
Accepted
time: 329ms
memory: 87700kb

input:

200000
908674 907131 904357 901346 906482 904674 901811 900334 905561 908897 908703 905701 908130 908741 904193 901568 909520 900031 900129 904634 904373 907718 905743 902146 907931 902196 907726 909918 903631 908709 903653 901043 902896 902555 908157 900862 908853 900892 908742 906798 903060 903314...

output:

180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
180000309958
1...

result:

ok 200001 numbers

Test #75:

score: 0
Accepted
time: 363ms
memory: 88156kb

input:

200000
918161 924607 910327 901992 929212 929719 903824 929074 916746 919098 926963 903823 924193 903351 917313 921498 921945 904464 927166 900382 900722 909597 925312 905964 910235 907063 915172 924393 916956 902398 907178 905309 904509 914740 923028 904485 911933 925232 909867 911537 915356 923692...

output:

180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
180000469102
1...

result:

ok 200001 numbers

Test #76:

score: 0
Accepted
time: 361ms
memory: 92260kb

input:

200000
945237 976890 994753 919679 996628 931305 977023 957903 995885 914471 943163 939802 920525 906490 996895 985172 962169 978337 975751 909986 965033 924939 993991 922943 957096 939006 990243 962331 948918 999249 924022 901463 947878 947825 922476 974442 908736 943136 991463 995519 994368 932561...

output:

180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
180001117232
1...

result:

ok 200001 numbers