Submission #769554

# Submission time Handle Problem Language Result Execution time Memory
769554 2023-06-29T18:55:40 Z danikoynov Maze (JOI23_ho_t3) C++14
100 / 100
1680 ms 634860 KB
#include<bits/stdc++.h>
#define endl '\n'

using namespace std;
typedef long long ll;

void speed()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

const int maxn = 6e6 + 10, block = sqrt(maxn) + 10;

struct cell
{
    int x, y;

    cell(int _x = 0, int _y = 0)
    {
        x = _x;
        y = _y;
    }

    cell add(const cell &r) const
    {
        cell d;
        d.x = x + r.x;
        d.y = y + r.y;
        return d;
    }
};

cell neib[4] = {{0, 1}, {1, 0}, {-1, 0}, {0, -1}};

int n, m, h;

vector < int > a[block], tr[block], tl[block];
vector < int > tu[block], td[block];
vector < int > ver_idx[block];

int stx, sty, enx, eny;

int nxt;

int dist[5 * maxn];
int is_div[maxn];
void add_edges_row(int row, int i, int j, int ver, vector < int > &vec)
{
    if (j - i + 1 == 2 * h - 1)
    {
        vec.push_back(tr[row][i]);
        vec.push_back(tl[row][j]);
    }
    else
    {
        if (i == 1)
            vec.push_back(tl[row][j]);
        else
        {
            int to = i;
            if (!is_div[i])
                to = 2 * h - 1 - i % (2 * h - 1) + i;
            if (to >= j)
                vec.push_back(tr[row][i]);
            else
            {
                vec.push_back(tr[row][i]);
                vec.push_back(tl[row][j]);
            }
        }
    }
}



void add_edges_col(int col, int i, int j, int ver, vector < int > &vec)
{
    if (j - i + 1 == 2 * h - 1)
    {
        vec.push_back(td[i][col]);
        vec.push_back(tu[j][col]);
    }
    else
    {
        if (i == 1)
            vec.push_back(tu[j][col]);
        else
        {
            int to = i;
            if (!is_div[i])
                to = 2 * h - 1 - i % (2 * h - 1) + i;
            if (to >= j)
                vec.push_back(td[i][col]);
            else
            {
                vec.push_back(td[i][col]);
                vec.push_back(tu[j][col]);
            }
        }
    }
}

int type[5 * maxn];
pair < int, int > cor[5 * maxn];
void solve()
{
    cin >> n >> m >> h;
    cin >> stx >> sty;
    cin >> enx >> eny;
    for (int i = 0; i <= max(n, m); i ++)
    {
        if (i % (2 * h - 1) == 0)
            is_div[i] = 1;
    }
    for (int i = 1; i <= n; i ++)
    {
        a[i].resize(m + 2);
        tl[i].resize(m + 2);
        tr[i].resize(m + 2);
        td[i].resize(m + 2);
        tu[i].resize(m + 2);
        ver_idx[i].resize(m + 2);

        string s;
        cin >> s;
        char c;
        for (int j = 1; j <= m; j ++)
        {
            c = s[j - 1];
            if (c == '.')
                a[i][j] = 0;
            else
                a[i][j] = 1;
        }
    }

    int cnt = 0;
    nxt = n * m;
    for (int i = 1; i <= n; i ++)
    {
        for (int j = 1; j <= m; j ++)
        {
            ver_idx[i][j] = ++ cnt;
        }
    }

    for (int i = 1; i <= n; i ++)
    {
        for (int j = 1; j <= m; j ++)
        {
            tr[i][j] = ++ nxt;
            type[nxt] = 1;
            cor[nxt] = {i, j};
            tl[i][j] = ++ nxt;
            type[nxt] = 2;
            cor[nxt] = {i, j};
        }

    }

    for (int j = 1; j <= m; j ++)
    {
        for (int i = 1; i <= n; i ++)
        {
            tu[i][j] = ++ nxt;
            type[nxt] = 4;
            cor[nxt] = {i, j};
            td[i][j] = ++ nxt;
            type[nxt] = 3;
            cor[nxt] = {i, j};

        }
    }



    for (int i = 1; i <= nxt; i ++)
        dist[i] = 1e9;

    deque < int > dq;
    dq.push_back(ver_idx[stx][sty]);
    dist[ver_idx[stx][sty]] = 0;
    vector < int > sus;
    while(!dq.empty())
    {
        int cur = dq.front();
        dq.pop_front();
        if (cur == ver_idx[enx][eny])
        {
            cout << dist[cur] << endl;
            return;
        }
        if (cur <= n * m)
        {
            cell c(cur / m + 1, cur % m);
            if (cur % m == 0)
                c.x --, c.y = m;

            for (int i = 0; i < 4; i ++)
            {
                cell nb = neib[i].add(c);
                if (nb.x == 0 || nb.x == n + 1 || nb.y == 0 || nb.y == m + 1 || a[nb.x][nb.y] == 1)
                    continue;
                int u = ver_idx[nb.x][nb.y];
                int w = 0;
                if (dist[u] > dist[cur] + w)
                {
                    dist[u] = dist[cur] + w;
                    if (w == 0)
                        dq.push_front(u);
                    else
                        dq.push_back(u);
                }
            }
            int i = c.x;
            int j = c.y;
            sus.clear();

            int st_row = max(1, i - h), en_row = min(n, i + h);
            int st_col = max(1, j - h), en_col = min(m, j + h);
            int fs_row = st_row, ds_row = en_row;
            if (fs_row == i - h)
                fs_row ++;
            if (ds_row == i + h)
                ds_row --;

            bool f1 = false, f2 = false;
            if (st_row == i - h)
            {
                if (st_col == j - h)
                    st_col ++, f1 = true;
                if (en_col == j + h)
                    en_col --, f2 = true;
            }
            add_edges_row(st_row, st_col, en_col, ver_idx[i][j], sus);
            if (st_row == i - h)
            {
                if (f1)
                    st_col --;
                if (f2)
                    en_col ++;
            }


            f1 = f2 = false;
            if (en_row == i + h)
            {
                if (st_col == j - h)
                    st_col ++, f1 = true;
                if (en_col == j + h)
                    en_col --, f2 = true;
            }

            add_edges_row(en_row, st_col, en_col, ver_idx[i][j], sus);

            if (en_row == i + h)
            {
                if (f1)
                    st_col --;
                if (f2)
                    en_col ++;
            }



            f1 = f2 = false;
            if (st_col == j - h)
            {
                if (st_row == i - h)
                    st_row ++, f1 = true;
                if (en_row == i + h)
                    en_row --, f2 = true;
            }

            add_edges_col(st_col, st_row, en_row, ver_idx[i][j], sus);
            if (st_col == j - h)
            {
                if (f1)
                    st_row --;
                if (f2)
                    en_row ++;
            }

            /// right col
            f1 = f2 = false;
            if (en_col == j + h)
            {
                if (st_row == i - h)
                    st_row ++, f1 = true;
                if (en_row == i + h)
                    en_row --, f2 = true;
            }

            add_edges_col(en_col, st_row, en_row, ver_idx[i][j], sus);
            if (en_col == j + h)
            {
                if (f1)
                    st_row --;
                if (f2)
                    en_row ++;
            }

            for (int u : sus)
            {
                if (dist[u] > dist[cur] + 1)
                {
                    dist[u] = dist[cur] + 1;
                    dq.push_back(u);
                }
            }
        }
        if (type[cur] == 1)
        {
            int x = cor[cur].first, y = cor[cur].second;
            if (y != m && !is_div[y])
            {
                if (dist[tr[x][y + 1]] > dist[cur])
                {
                    dist[tr[x][y + 1]] = dist[cur];
                    dq.push_front(tr[x][y + 1]);
                }
            }
            if (dist[ver_idx[x][y]] > dist[cur])
            {
                dist[ver_idx[x][y]] = dist[cur];
                dq.push_front(ver_idx[x][y]);
            }
        }
        if (type[cur] == 2)
        {
            int x = cor[cur].first, y = cor[cur].second;
            if (!is_div[y - 1])
            {
                if (dist[tl[x][y - 1]] > dist[cur])
                {
                    dist[tl[x][y - 1]] = dist[cur];
                    dq.push_front(tl[x][y - 1]);
                }
            }
            if (dist[ver_idx[x][y]] > dist[cur])
            {
                dist[ver_idx[x][y]] = dist[cur];
                dq.push_front(ver_idx[x][y]);
            }
        }

        if (type[cur] == 3)
        {
            int x = cor[cur].first, y = cor[cur].second;
            if (x != n && !is_div[x])
            {
                if (dist[td[x + 1][y]] > dist[cur])
                {
                    dist[td[x + 1][y]] = dist[cur];
                    dq.push_front(td[x + 1][y]);
                }
            }
            if (dist[ver_idx[x][y]] > dist[cur])
            {
                dist[ver_idx[x][y]] = dist[cur];
                dq.push_front(ver_idx[x][y]);
            }
        }
        if (type[cur] == 4)
        {
            int x = cor[cur].first, y = cor[cur].second;
            if (!is_div[x - 1])
            {
                if (dist[tu[x - 1][y]] > dist[cur])
                {
                    dist[tu[x - 1][y]] = dist[cur];
                    dq.push_front(tu[x - 1][y]);
                }
            }
            if (dist[ver_idx[x][y]] > dist[cur])
            {
                dist[ver_idx[x][y]] = dist[cur];
                dq.push_front(ver_idx[x][y]);
            }
        }

    }
    /**for (int i = 1; i <= n; i ++, cout << endl)
        for (int j = 1; j <= m; j ++)
            cout << dist[ver_idx[i][j]] << " ";*/

    int ans = dist[ver_idx[enx][eny]];
    for (int i = 1; i <= n; i ++)
        for (int j = 1; j <= m; j ++)
        {
            if (abs(i - enx) <= h && abs(j - eny) <= h)
            {
                if (abs(i - enx) + abs(j - eny) != 2 * h)
                {
                    ans = min(ans, dist[ver_idx[i][j]] + 1);
                }
            }
        }
    cout << ans << endl;


}

int main()
{
    ///freopen("test.txt", "r", stdin);
    speed();
    solve();
    return 0;
}
/**
3 3 2
1 1
3 3
.#.
##.
...
*/
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 812 KB Output is correct
4 Correct 1 ms 724 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 1 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 1 ms 668 KB Output is correct
9 Correct 1 ms 596 KB Output is correct
10 Correct 1 ms 672 KB Output is correct
11 Correct 1 ms 596 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 1 ms 676 KB Output is correct
15 Correct 1 ms 596 KB Output is correct
16 Correct 1 ms 724 KB Output is correct
17 Correct 1 ms 724 KB Output is correct
18 Correct 1 ms 724 KB Output is correct
19 Correct 8 ms 6196 KB Output is correct
20 Correct 5 ms 5204 KB Output is correct
21 Correct 3 ms 6196 KB Output is correct
22 Correct 10 ms 6220 KB Output is correct
23 Correct 8 ms 6188 KB Output is correct
24 Correct 6 ms 6484 KB Output is correct
25 Correct 6 ms 6484 KB Output is correct
26 Correct 4 ms 6228 KB Output is correct
27 Correct 3 ms 6228 KB Output is correct
28 Correct 6 ms 6180 KB Output is correct
29 Correct 28 ms 14252 KB Output is correct
30 Correct 9 ms 6484 KB Output is correct
31 Correct 8 ms 14620 KB Output is correct
32 Correct 29 ms 14412 KB Output is correct
33 Correct 27 ms 14356 KB Output is correct
34 Correct 17 ms 14948 KB Output is correct
35 Correct 16 ms 15052 KB Output is correct
36 Correct 17 ms 14548 KB Output is correct
37 Correct 23 ms 14420 KB Output is correct
38 Correct 9 ms 14352 KB Output is correct
39 Correct 380 ms 136336 KB Output is correct
40 Correct 13 ms 16176 KB Output is correct
41 Correct 15 ms 18260 KB Output is correct
42 Correct 46 ms 20172 KB Output is correct
43 Correct 30 ms 23220 KB Output is correct
44 Correct 64 ms 68336 KB Output is correct
45 Correct 76 ms 74148 KB Output is correct
46 Correct 256 ms 159316 KB Output is correct
47 Correct 311 ms 136440 KB Output is correct
48 Correct 339 ms 136316 KB Output is correct
49 Correct 134 ms 142096 KB Output is correct
50 Correct 125 ms 142012 KB Output is correct
51 Correct 275 ms 137216 KB Output is correct
52 Correct 208 ms 136768 KB Output is correct
53 Correct 305 ms 136336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 1 ms 672 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 1 ms 596 KB Output is correct
7 Correct 1 ms 676 KB Output is correct
8 Correct 1 ms 724 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 1 ms 724 KB Output is correct
12 Correct 1 ms 724 KB Output is correct
13 Correct 1 ms 724 KB Output is correct
14 Correct 1 ms 800 KB Output is correct
15 Correct 1 ms 808 KB Output is correct
16 Correct 1 ms 724 KB Output is correct
17 Correct 1 ms 724 KB Output is correct
18 Correct 1 ms 596 KB Output is correct
19 Correct 1 ms 724 KB Output is correct
20 Correct 1 ms 724 KB Output is correct
21 Correct 1 ms 680 KB Output is correct
22 Correct 1 ms 680 KB Output is correct
23 Correct 1 ms 596 KB Output is correct
24 Correct 1 ms 596 KB Output is correct
25 Correct 1 ms 596 KB Output is correct
26 Correct 1 ms 596 KB Output is correct
27 Correct 1 ms 676 KB Output is correct
28 Correct 1 ms 724 KB Output is correct
29 Correct 1 ms 676 KB Output is correct
30 Correct 1 ms 724 KB Output is correct
31 Correct 1 ms 724 KB Output is correct
32 Correct 1 ms 724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 1 ms 596 KB Output is correct
5 Correct 1 ms 596 KB Output is correct
6 Correct 1 ms 596 KB Output is correct
7 Correct 1 ms 808 KB Output is correct
8 Correct 1 ms 804 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 1 ms 804 KB Output is correct
12 Correct 1 ms 724 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 1 ms 724 KB Output is correct
15 Correct 1 ms 596 KB Output is correct
16 Correct 1 ms 724 KB Output is correct
17 Correct 1 ms 676 KB Output is correct
18 Correct 1 ms 608 KB Output is correct
19 Correct 1 ms 596 KB Output is correct
20 Correct 1 ms 596 KB Output is correct
21 Correct 1 ms 724 KB Output is correct
22 Correct 1 ms 724 KB Output is correct
23 Correct 1 ms 808 KB Output is correct
24 Correct 1 ms 804 KB Output is correct
25 Correct 3 ms 4180 KB Output is correct
26 Correct 7 ms 6356 KB Output is correct
27 Correct 4 ms 6192 KB Output is correct
28 Correct 6 ms 6228 KB Output is correct
29 Correct 3 ms 6100 KB Output is correct
30 Correct 4 ms 6100 KB Output is correct
31 Correct 5 ms 6100 KB Output is correct
32 Correct 3 ms 6228 KB Output is correct
33 Correct 4 ms 6100 KB Output is correct
34 Correct 12 ms 12800 KB Output is correct
35 Correct 8 ms 14676 KB Output is correct
36 Correct 10 ms 14436 KB Output is correct
37 Correct 9 ms 14316 KB Output is correct
38 Correct 8 ms 14292 KB Output is correct
39 Correct 31 ms 41944 KB Output is correct
40 Correct 62 ms 116320 KB Output is correct
41 Correct 335 ms 159012 KB Output is correct
42 Correct 122 ms 138412 KB Output is correct
43 Correct 81 ms 136000 KB Output is correct
44 Correct 87 ms 136232 KB Output is correct
45 Correct 104 ms 136564 KB Output is correct
46 Correct 99 ms 136440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 1 ms 672 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 1 ms 596 KB Output is correct
7 Correct 1 ms 676 KB Output is correct
8 Correct 1 ms 724 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 1 ms 724 KB Output is correct
12 Correct 1 ms 724 KB Output is correct
13 Correct 1 ms 724 KB Output is correct
14 Correct 1 ms 800 KB Output is correct
15 Correct 1 ms 808 KB Output is correct
16 Correct 1 ms 724 KB Output is correct
17 Correct 1 ms 724 KB Output is correct
18 Correct 1 ms 596 KB Output is correct
19 Correct 1 ms 724 KB Output is correct
20 Correct 1 ms 724 KB Output is correct
21 Correct 1 ms 680 KB Output is correct
22 Correct 1 ms 680 KB Output is correct
23 Correct 1 ms 596 KB Output is correct
24 Correct 1 ms 596 KB Output is correct
25 Correct 1 ms 596 KB Output is correct
26 Correct 1 ms 596 KB Output is correct
27 Correct 1 ms 676 KB Output is correct
28 Correct 1 ms 724 KB Output is correct
29 Correct 1 ms 676 KB Output is correct
30 Correct 1 ms 724 KB Output is correct
31 Correct 1 ms 724 KB Output is correct
32 Correct 1 ms 724 KB Output is correct
33 Correct 8 ms 6100 KB Output is correct
34 Correct 1 ms 836 KB Output is correct
35 Correct 1 ms 1108 KB Output is correct
36 Correct 3 ms 4104 KB Output is correct
37 Correct 5 ms 5208 KB Output is correct
38 Correct 7 ms 6356 KB Output is correct
39 Correct 3 ms 6100 KB Output is correct
40 Correct 9 ms 6152 KB Output is correct
41 Correct 8 ms 6128 KB Output is correct
42 Correct 8 ms 6332 KB Output is correct
43 Correct 3 ms 6144 KB Output is correct
44 Correct 3 ms 6100 KB Output is correct
45 Correct 7 ms 6484 KB Output is correct
46 Correct 6 ms 6532 KB Output is correct
47 Correct 7 ms 6352 KB Output is correct
48 Correct 6 ms 6188 KB Output is correct
49 Correct 5 ms 6100 KB Output is correct
50 Correct 8 ms 6100 KB Output is correct
51 Correct 5 ms 6100 KB Output is correct
52 Correct 4 ms 6228 KB Output is correct
53 Correct 4 ms 6188 KB Output is correct
54 Correct 6 ms 6100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 1 ms 672 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 1 ms 596 KB Output is correct
7 Correct 1 ms 676 KB Output is correct
8 Correct 1 ms 724 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 1 ms 724 KB Output is correct
12 Correct 1 ms 724 KB Output is correct
13 Correct 1 ms 724 KB Output is correct
14 Correct 1 ms 800 KB Output is correct
15 Correct 1 ms 808 KB Output is correct
16 Correct 1 ms 724 KB Output is correct
17 Correct 1 ms 724 KB Output is correct
18 Correct 1 ms 596 KB Output is correct
19 Correct 1 ms 724 KB Output is correct
20 Correct 1 ms 724 KB Output is correct
21 Correct 1 ms 680 KB Output is correct
22 Correct 1 ms 680 KB Output is correct
23 Correct 1 ms 596 KB Output is correct
24 Correct 1 ms 596 KB Output is correct
25 Correct 1 ms 596 KB Output is correct
26 Correct 1 ms 596 KB Output is correct
27 Correct 1 ms 676 KB Output is correct
28 Correct 1 ms 724 KB Output is correct
29 Correct 1 ms 676 KB Output is correct
30 Correct 1 ms 724 KB Output is correct
31 Correct 1 ms 724 KB Output is correct
32 Correct 1 ms 724 KB Output is correct
33 Correct 8 ms 6100 KB Output is correct
34 Correct 1 ms 836 KB Output is correct
35 Correct 1 ms 1108 KB Output is correct
36 Correct 3 ms 4104 KB Output is correct
37 Correct 5 ms 5208 KB Output is correct
38 Correct 7 ms 6356 KB Output is correct
39 Correct 3 ms 6100 KB Output is correct
40 Correct 9 ms 6152 KB Output is correct
41 Correct 8 ms 6128 KB Output is correct
42 Correct 8 ms 6332 KB Output is correct
43 Correct 3 ms 6144 KB Output is correct
44 Correct 3 ms 6100 KB Output is correct
45 Correct 7 ms 6484 KB Output is correct
46 Correct 6 ms 6532 KB Output is correct
47 Correct 7 ms 6352 KB Output is correct
48 Correct 6 ms 6188 KB Output is correct
49 Correct 5 ms 6100 KB Output is correct
50 Correct 8 ms 6100 KB Output is correct
51 Correct 5 ms 6100 KB Output is correct
52 Correct 4 ms 6228 KB Output is correct
53 Correct 4 ms 6188 KB Output is correct
54 Correct 6 ms 6100 KB Output is correct
55 Correct 36 ms 14364 KB Output is correct
56 Correct 7 ms 6356 KB Output is correct
57 Correct 12 ms 12732 KB Output is correct
58 Correct 24 ms 13188 KB Output is correct
59 Correct 8 ms 14600 KB Output is correct
60 Correct 28 ms 14420 KB Output is correct
61 Correct 27 ms 14292 KB Output is correct
62 Correct 10 ms 14548 KB Output is correct
63 Correct 8 ms 14292 KB Output is correct
64 Correct 8 ms 14348 KB Output is correct
65 Correct 17 ms 15052 KB Output is correct
66 Correct 17 ms 15072 KB Output is correct
67 Correct 20 ms 14828 KB Output is correct
68 Correct 18 ms 14384 KB Output is correct
69 Correct 18 ms 14384 KB Output is correct
70 Correct 18 ms 14368 KB Output is correct
71 Correct 17 ms 14256 KB Output is correct
72 Correct 21 ms 14608 KB Output is correct
73 Correct 23 ms 14512 KB Output is correct
74 Correct 9 ms 14420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 812 KB Output is correct
4 Correct 1 ms 724 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 1 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 1 ms 668 KB Output is correct
9 Correct 1 ms 596 KB Output is correct
10 Correct 1 ms 672 KB Output is correct
11 Correct 1 ms 596 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 1 ms 676 KB Output is correct
15 Correct 1 ms 596 KB Output is correct
16 Correct 1 ms 724 KB Output is correct
17 Correct 1 ms 724 KB Output is correct
18 Correct 1 ms 724 KB Output is correct
19 Correct 8 ms 6196 KB Output is correct
20 Correct 5 ms 5204 KB Output is correct
21 Correct 3 ms 6196 KB Output is correct
22 Correct 10 ms 6220 KB Output is correct
23 Correct 8 ms 6188 KB Output is correct
24 Correct 6 ms 6484 KB Output is correct
25 Correct 6 ms 6484 KB Output is correct
26 Correct 4 ms 6228 KB Output is correct
27 Correct 3 ms 6228 KB Output is correct
28 Correct 6 ms 6180 KB Output is correct
29 Correct 28 ms 14252 KB Output is correct
30 Correct 9 ms 6484 KB Output is correct
31 Correct 8 ms 14620 KB Output is correct
32 Correct 29 ms 14412 KB Output is correct
33 Correct 27 ms 14356 KB Output is correct
34 Correct 17 ms 14948 KB Output is correct
35 Correct 16 ms 15052 KB Output is correct
36 Correct 17 ms 14548 KB Output is correct
37 Correct 23 ms 14420 KB Output is correct
38 Correct 9 ms 14352 KB Output is correct
39 Correct 380 ms 136336 KB Output is correct
40 Correct 13 ms 16176 KB Output is correct
41 Correct 15 ms 18260 KB Output is correct
42 Correct 46 ms 20172 KB Output is correct
43 Correct 30 ms 23220 KB Output is correct
44 Correct 64 ms 68336 KB Output is correct
45 Correct 76 ms 74148 KB Output is correct
46 Correct 256 ms 159316 KB Output is correct
47 Correct 311 ms 136440 KB Output is correct
48 Correct 339 ms 136316 KB Output is correct
49 Correct 134 ms 142096 KB Output is correct
50 Correct 125 ms 142012 KB Output is correct
51 Correct 275 ms 137216 KB Output is correct
52 Correct 208 ms 136768 KB Output is correct
53 Correct 305 ms 136336 KB Output is correct
54 Correct 1 ms 596 KB Output is correct
55 Correct 1 ms 596 KB Output is correct
56 Correct 1 ms 596 KB Output is correct
57 Correct 1 ms 672 KB Output is correct
58 Correct 1 ms 724 KB Output is correct
59 Correct 1 ms 596 KB Output is correct
60 Correct 1 ms 676 KB Output is correct
61 Correct 1 ms 724 KB Output is correct
62 Correct 1 ms 724 KB Output is correct
63 Correct 1 ms 724 KB Output is correct
64 Correct 1 ms 724 KB Output is correct
65 Correct 1 ms 724 KB Output is correct
66 Correct 1 ms 724 KB Output is correct
67 Correct 1 ms 800 KB Output is correct
68 Correct 1 ms 808 KB Output is correct
69 Correct 1 ms 724 KB Output is correct
70 Correct 1 ms 724 KB Output is correct
71 Correct 1 ms 596 KB Output is correct
72 Correct 1 ms 724 KB Output is correct
73 Correct 1 ms 724 KB Output is correct
74 Correct 1 ms 680 KB Output is correct
75 Correct 1 ms 680 KB Output is correct
76 Correct 1 ms 596 KB Output is correct
77 Correct 1 ms 596 KB Output is correct
78 Correct 1 ms 596 KB Output is correct
79 Correct 1 ms 596 KB Output is correct
80 Correct 1 ms 676 KB Output is correct
81 Correct 1 ms 724 KB Output is correct
82 Correct 1 ms 676 KB Output is correct
83 Correct 1 ms 724 KB Output is correct
84 Correct 1 ms 724 KB Output is correct
85 Correct 1 ms 724 KB Output is correct
86 Correct 1 ms 596 KB Output is correct
87 Correct 1 ms 596 KB Output is correct
88 Correct 1 ms 596 KB Output is correct
89 Correct 1 ms 596 KB Output is correct
90 Correct 1 ms 596 KB Output is correct
91 Correct 1 ms 596 KB Output is correct
92 Correct 1 ms 808 KB Output is correct
93 Correct 1 ms 804 KB Output is correct
94 Correct 1 ms 724 KB Output is correct
95 Correct 1 ms 724 KB Output is correct
96 Correct 1 ms 804 KB Output is correct
97 Correct 1 ms 724 KB Output is correct
98 Correct 1 ms 596 KB Output is correct
99 Correct 1 ms 724 KB Output is correct
100 Correct 1 ms 596 KB Output is correct
101 Correct 1 ms 724 KB Output is correct
102 Correct 1 ms 676 KB Output is correct
103 Correct 1 ms 608 KB Output is correct
104 Correct 1 ms 596 KB Output is correct
105 Correct 1 ms 596 KB Output is correct
106 Correct 1 ms 724 KB Output is correct
107 Correct 1 ms 724 KB Output is correct
108 Correct 1 ms 808 KB Output is correct
109 Correct 1 ms 804 KB Output is correct
110 Correct 3 ms 4180 KB Output is correct
111 Correct 7 ms 6356 KB Output is correct
112 Correct 4 ms 6192 KB Output is correct
113 Correct 6 ms 6228 KB Output is correct
114 Correct 3 ms 6100 KB Output is correct
115 Correct 4 ms 6100 KB Output is correct
116 Correct 5 ms 6100 KB Output is correct
117 Correct 3 ms 6228 KB Output is correct
118 Correct 4 ms 6100 KB Output is correct
119 Correct 12 ms 12800 KB Output is correct
120 Correct 8 ms 14676 KB Output is correct
121 Correct 10 ms 14436 KB Output is correct
122 Correct 9 ms 14316 KB Output is correct
123 Correct 8 ms 14292 KB Output is correct
124 Correct 31 ms 41944 KB Output is correct
125 Correct 62 ms 116320 KB Output is correct
126 Correct 335 ms 159012 KB Output is correct
127 Correct 122 ms 138412 KB Output is correct
128 Correct 81 ms 136000 KB Output is correct
129 Correct 87 ms 136232 KB Output is correct
130 Correct 104 ms 136564 KB Output is correct
131 Correct 99 ms 136440 KB Output is correct
132 Correct 8 ms 6100 KB Output is correct
133 Correct 1 ms 836 KB Output is correct
134 Correct 1 ms 1108 KB Output is correct
135 Correct 3 ms 4104 KB Output is correct
136 Correct 5 ms 5208 KB Output is correct
137 Correct 7 ms 6356 KB Output is correct
138 Correct 3 ms 6100 KB Output is correct
139 Correct 9 ms 6152 KB Output is correct
140 Correct 8 ms 6128 KB Output is correct
141 Correct 8 ms 6332 KB Output is correct
142 Correct 3 ms 6144 KB Output is correct
143 Correct 3 ms 6100 KB Output is correct
144 Correct 7 ms 6484 KB Output is correct
145 Correct 6 ms 6532 KB Output is correct
146 Correct 7 ms 6352 KB Output is correct
147 Correct 6 ms 6188 KB Output is correct
148 Correct 5 ms 6100 KB Output is correct
149 Correct 8 ms 6100 KB Output is correct
150 Correct 5 ms 6100 KB Output is correct
151 Correct 4 ms 6228 KB Output is correct
152 Correct 4 ms 6188 KB Output is correct
153 Correct 6 ms 6100 KB Output is correct
154 Correct 36 ms 14364 KB Output is correct
155 Correct 7 ms 6356 KB Output is correct
156 Correct 12 ms 12732 KB Output is correct
157 Correct 24 ms 13188 KB Output is correct
158 Correct 8 ms 14600 KB Output is correct
159 Correct 28 ms 14420 KB Output is correct
160 Correct 27 ms 14292 KB Output is correct
161 Correct 10 ms 14548 KB Output is correct
162 Correct 8 ms 14292 KB Output is correct
163 Correct 8 ms 14348 KB Output is correct
164 Correct 17 ms 15052 KB Output is correct
165 Correct 17 ms 15072 KB Output is correct
166 Correct 20 ms 14828 KB Output is correct
167 Correct 18 ms 14384 KB Output is correct
168 Correct 18 ms 14384 KB Output is correct
169 Correct 18 ms 14368 KB Output is correct
170 Correct 17 ms 14256 KB Output is correct
171 Correct 21 ms 14608 KB Output is correct
172 Correct 23 ms 14512 KB Output is correct
173 Correct 9 ms 14420 KB Output is correct
174 Correct 20 ms 18608 KB Output is correct
175 Correct 61 ms 31188 KB Output is correct
176 Correct 76 ms 70744 KB Output is correct
177 Correct 169 ms 91732 KB Output is correct
178 Correct 73 ms 119284 KB Output is correct
179 Correct 137 ms 136628 KB Output is correct
180 Correct 183 ms 136112 KB Output is correct
181 Correct 200 ms 136016 KB Output is correct
182 Correct 197 ms 136096 KB Output is correct
183 Correct 190 ms 136632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 812 KB Output is correct
4 Correct 1 ms 724 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 1 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 1 ms 668 KB Output is correct
9 Correct 1 ms 596 KB Output is correct
10 Correct 1 ms 672 KB Output is correct
11 Correct 1 ms 596 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 1 ms 676 KB Output is correct
15 Correct 1 ms 596 KB Output is correct
16 Correct 1 ms 724 KB Output is correct
17 Correct 1 ms 724 KB Output is correct
18 Correct 1 ms 724 KB Output is correct
19 Correct 8 ms 6196 KB Output is correct
20 Correct 5 ms 5204 KB Output is correct
21 Correct 3 ms 6196 KB Output is correct
22 Correct 10 ms 6220 KB Output is correct
23 Correct 8 ms 6188 KB Output is correct
24 Correct 6 ms 6484 KB Output is correct
25 Correct 6 ms 6484 KB Output is correct
26 Correct 4 ms 6228 KB Output is correct
27 Correct 3 ms 6228 KB Output is correct
28 Correct 6 ms 6180 KB Output is correct
29 Correct 28 ms 14252 KB Output is correct
30 Correct 9 ms 6484 KB Output is correct
31 Correct 8 ms 14620 KB Output is correct
32 Correct 29 ms 14412 KB Output is correct
33 Correct 27 ms 14356 KB Output is correct
34 Correct 17 ms 14948 KB Output is correct
35 Correct 16 ms 15052 KB Output is correct
36 Correct 17 ms 14548 KB Output is correct
37 Correct 23 ms 14420 KB Output is correct
38 Correct 9 ms 14352 KB Output is correct
39 Correct 380 ms 136336 KB Output is correct
40 Correct 13 ms 16176 KB Output is correct
41 Correct 15 ms 18260 KB Output is correct
42 Correct 46 ms 20172 KB Output is correct
43 Correct 30 ms 23220 KB Output is correct
44 Correct 64 ms 68336 KB Output is correct
45 Correct 76 ms 74148 KB Output is correct
46 Correct 256 ms 159316 KB Output is correct
47 Correct 311 ms 136440 KB Output is correct
48 Correct 339 ms 136316 KB Output is correct
49 Correct 134 ms 142096 KB Output is correct
50 Correct 125 ms 142012 KB Output is correct
51 Correct 275 ms 137216 KB Output is correct
52 Correct 208 ms 136768 KB Output is correct
53 Correct 305 ms 136336 KB Output is correct
54 Correct 1 ms 596 KB Output is correct
55 Correct 1 ms 596 KB Output is correct
56 Correct 1 ms 596 KB Output is correct
57 Correct 1 ms 672 KB Output is correct
58 Correct 1 ms 724 KB Output is correct
59 Correct 1 ms 596 KB Output is correct
60 Correct 1 ms 676 KB Output is correct
61 Correct 1 ms 724 KB Output is correct
62 Correct 1 ms 724 KB Output is correct
63 Correct 1 ms 724 KB Output is correct
64 Correct 1 ms 724 KB Output is correct
65 Correct 1 ms 724 KB Output is correct
66 Correct 1 ms 724 KB Output is correct
67 Correct 1 ms 800 KB Output is correct
68 Correct 1 ms 808 KB Output is correct
69 Correct 1 ms 724 KB Output is correct
70 Correct 1 ms 724 KB Output is correct
71 Correct 1 ms 596 KB Output is correct
72 Correct 1 ms 724 KB Output is correct
73 Correct 1 ms 724 KB Output is correct
74 Correct 1 ms 680 KB Output is correct
75 Correct 1 ms 680 KB Output is correct
76 Correct 1 ms 596 KB Output is correct
77 Correct 1 ms 596 KB Output is correct
78 Correct 1 ms 596 KB Output is correct
79 Correct 1 ms 596 KB Output is correct
80 Correct 1 ms 676 KB Output is correct
81 Correct 1 ms 724 KB Output is correct
82 Correct 1 ms 676 KB Output is correct
83 Correct 1 ms 724 KB Output is correct
84 Correct 1 ms 724 KB Output is correct
85 Correct 1 ms 724 KB Output is correct
86 Correct 1 ms 596 KB Output is correct
87 Correct 1 ms 596 KB Output is correct
88 Correct 1 ms 596 KB Output is correct
89 Correct 1 ms 596 KB Output is correct
90 Correct 1 ms 596 KB Output is correct
91 Correct 1 ms 596 KB Output is correct
92 Correct 1 ms 808 KB Output is correct
93 Correct 1 ms 804 KB Output is correct
94 Correct 1 ms 724 KB Output is correct
95 Correct 1 ms 724 KB Output is correct
96 Correct 1 ms 804 KB Output is correct
97 Correct 1 ms 724 KB Output is correct
98 Correct 1 ms 596 KB Output is correct
99 Correct 1 ms 724 KB Output is correct
100 Correct 1 ms 596 KB Output is correct
101 Correct 1 ms 724 KB Output is correct
102 Correct 1 ms 676 KB Output is correct
103 Correct 1 ms 608 KB Output is correct
104 Correct 1 ms 596 KB Output is correct
105 Correct 1 ms 596 KB Output is correct
106 Correct 1 ms 724 KB Output is correct
107 Correct 1 ms 724 KB Output is correct
108 Correct 1 ms 808 KB Output is correct
109 Correct 1 ms 804 KB Output is correct
110 Correct 3 ms 4180 KB Output is correct
111 Correct 7 ms 6356 KB Output is correct
112 Correct 4 ms 6192 KB Output is correct
113 Correct 6 ms 6228 KB Output is correct
114 Correct 3 ms 6100 KB Output is correct
115 Correct 4 ms 6100 KB Output is correct
116 Correct 5 ms 6100 KB Output is correct
117 Correct 3 ms 6228 KB Output is correct
118 Correct 4 ms 6100 KB Output is correct
119 Correct 12 ms 12800 KB Output is correct
120 Correct 8 ms 14676 KB Output is correct
121 Correct 10 ms 14436 KB Output is correct
122 Correct 9 ms 14316 KB Output is correct
123 Correct 8 ms 14292 KB Output is correct
124 Correct 31 ms 41944 KB Output is correct
125 Correct 62 ms 116320 KB Output is correct
126 Correct 335 ms 159012 KB Output is correct
127 Correct 122 ms 138412 KB Output is correct
128 Correct 81 ms 136000 KB Output is correct
129 Correct 87 ms 136232 KB Output is correct
130 Correct 104 ms 136564 KB Output is correct
131 Correct 99 ms 136440 KB Output is correct
132 Correct 8 ms 6100 KB Output is correct
133 Correct 1 ms 836 KB Output is correct
134 Correct 1 ms 1108 KB Output is correct
135 Correct 3 ms 4104 KB Output is correct
136 Correct 5 ms 5208 KB Output is correct
137 Correct 7 ms 6356 KB Output is correct
138 Correct 3 ms 6100 KB Output is correct
139 Correct 9 ms 6152 KB Output is correct
140 Correct 8 ms 6128 KB Output is correct
141 Correct 8 ms 6332 KB Output is correct
142 Correct 3 ms 6144 KB Output is correct
143 Correct 3 ms 6100 KB Output is correct
144 Correct 7 ms 6484 KB Output is correct
145 Correct 6 ms 6532 KB Output is correct
146 Correct 7 ms 6352 KB Output is correct
147 Correct 6 ms 6188 KB Output is correct
148 Correct 5 ms 6100 KB Output is correct
149 Correct 8 ms 6100 KB Output is correct
150 Correct 5 ms 6100 KB Output is correct
151 Correct 4 ms 6228 KB Output is correct
152 Correct 4 ms 6188 KB Output is correct
153 Correct 6 ms 6100 KB Output is correct
154 Correct 36 ms 14364 KB Output is correct
155 Correct 7 ms 6356 KB Output is correct
156 Correct 12 ms 12732 KB Output is correct
157 Correct 24 ms 13188 KB Output is correct
158 Correct 8 ms 14600 KB Output is correct
159 Correct 28 ms 14420 KB Output is correct
160 Correct 27 ms 14292 KB Output is correct
161 Correct 10 ms 14548 KB Output is correct
162 Correct 8 ms 14292 KB Output is correct
163 Correct 8 ms 14348 KB Output is correct
164 Correct 17 ms 15052 KB Output is correct
165 Correct 17 ms 15072 KB Output is correct
166 Correct 20 ms 14828 KB Output is correct
167 Correct 18 ms 14384 KB Output is correct
168 Correct 18 ms 14384 KB Output is correct
169 Correct 18 ms 14368 KB Output is correct
170 Correct 17 ms 14256 KB Output is correct
171 Correct 21 ms 14608 KB Output is correct
172 Correct 23 ms 14512 KB Output is correct
173 Correct 9 ms 14420 KB Output is correct
174 Correct 20 ms 18608 KB Output is correct
175 Correct 61 ms 31188 KB Output is correct
176 Correct 76 ms 70744 KB Output is correct
177 Correct 169 ms 91732 KB Output is correct
178 Correct 73 ms 119284 KB Output is correct
179 Correct 137 ms 136628 KB Output is correct
180 Correct 183 ms 136112 KB Output is correct
181 Correct 200 ms 136016 KB Output is correct
182 Correct 197 ms 136096 KB Output is correct
183 Correct 190 ms 136632 KB Output is correct
184 Correct 760 ms 271240 KB Output is correct
185 Correct 140 ms 151308 KB Output is correct
186 Correct 224 ms 182364 KB Output is correct
187 Correct 168 ms 196652 KB Output is correct
188 Correct 349 ms 305476 KB Output is correct
189 Correct 538 ms 274080 KB Output is correct
190 Correct 380 ms 273820 KB Output is correct
191 Correct 290 ms 279592 KB Output is correct
192 Correct 166 ms 273812 KB Output is correct
193 Correct 163 ms 273828 KB Output is correct
194 Correct 323 ms 285532 KB Output is correct
195 Correct 251 ms 285556 KB Output is correct
196 Correct 388 ms 274904 KB Output is correct
197 Correct 253 ms 274836 KB Output is correct
198 Correct 232 ms 273820 KB Output is correct
199 Correct 378 ms 273768 KB Output is correct
200 Correct 419 ms 275132 KB Output is correct
201 Correct 571 ms 274460 KB Output is correct
202 Correct 862 ms 274092 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 812 KB Output is correct
4 Correct 1 ms 724 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 1 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 1 ms 668 KB Output is correct
9 Correct 1 ms 596 KB Output is correct
10 Correct 1 ms 672 KB Output is correct
11 Correct 1 ms 596 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 1 ms 676 KB Output is correct
15 Correct 1 ms 596 KB Output is correct
16 Correct 1 ms 724 KB Output is correct
17 Correct 1 ms 724 KB Output is correct
18 Correct 1 ms 724 KB Output is correct
19 Correct 8 ms 6196 KB Output is correct
20 Correct 5 ms 5204 KB Output is correct
21 Correct 3 ms 6196 KB Output is correct
22 Correct 10 ms 6220 KB Output is correct
23 Correct 8 ms 6188 KB Output is correct
24 Correct 6 ms 6484 KB Output is correct
25 Correct 6 ms 6484 KB Output is correct
26 Correct 4 ms 6228 KB Output is correct
27 Correct 3 ms 6228 KB Output is correct
28 Correct 6 ms 6180 KB Output is correct
29 Correct 28 ms 14252 KB Output is correct
30 Correct 9 ms 6484 KB Output is correct
31 Correct 8 ms 14620 KB Output is correct
32 Correct 29 ms 14412 KB Output is correct
33 Correct 27 ms 14356 KB Output is correct
34 Correct 17 ms 14948 KB Output is correct
35 Correct 16 ms 15052 KB Output is correct
36 Correct 17 ms 14548 KB Output is correct
37 Correct 23 ms 14420 KB Output is correct
38 Correct 9 ms 14352 KB Output is correct
39 Correct 380 ms 136336 KB Output is correct
40 Correct 13 ms 16176 KB Output is correct
41 Correct 15 ms 18260 KB Output is correct
42 Correct 46 ms 20172 KB Output is correct
43 Correct 30 ms 23220 KB Output is correct
44 Correct 64 ms 68336 KB Output is correct
45 Correct 76 ms 74148 KB Output is correct
46 Correct 256 ms 159316 KB Output is correct
47 Correct 311 ms 136440 KB Output is correct
48 Correct 339 ms 136316 KB Output is correct
49 Correct 134 ms 142096 KB Output is correct
50 Correct 125 ms 142012 KB Output is correct
51 Correct 275 ms 137216 KB Output is correct
52 Correct 208 ms 136768 KB Output is correct
53 Correct 305 ms 136336 KB Output is correct
54 Correct 1 ms 596 KB Output is correct
55 Correct 1 ms 596 KB Output is correct
56 Correct 1 ms 596 KB Output is correct
57 Correct 1 ms 672 KB Output is correct
58 Correct 1 ms 724 KB Output is correct
59 Correct 1 ms 596 KB Output is correct
60 Correct 1 ms 676 KB Output is correct
61 Correct 1 ms 724 KB Output is correct
62 Correct 1 ms 724 KB Output is correct
63 Correct 1 ms 724 KB Output is correct
64 Correct 1 ms 724 KB Output is correct
65 Correct 1 ms 724 KB Output is correct
66 Correct 1 ms 724 KB Output is correct
67 Correct 1 ms 800 KB Output is correct
68 Correct 1 ms 808 KB Output is correct
69 Correct 1 ms 724 KB Output is correct
70 Correct 1 ms 724 KB Output is correct
71 Correct 1 ms 596 KB Output is correct
72 Correct 1 ms 724 KB Output is correct
73 Correct 1 ms 724 KB Output is correct
74 Correct 1 ms 680 KB Output is correct
75 Correct 1 ms 680 KB Output is correct
76 Correct 1 ms 596 KB Output is correct
77 Correct 1 ms 596 KB Output is correct
78 Correct 1 ms 596 KB Output is correct
79 Correct 1 ms 596 KB Output is correct
80 Correct 1 ms 676 KB Output is correct
81 Correct 1 ms 724 KB Output is correct
82 Correct 1 ms 676 KB Output is correct
83 Correct 1 ms 724 KB Output is correct
84 Correct 1 ms 724 KB Output is correct
85 Correct 1 ms 724 KB Output is correct
86 Correct 1 ms 596 KB Output is correct
87 Correct 1 ms 596 KB Output is correct
88 Correct 1 ms 596 KB Output is correct
89 Correct 1 ms 596 KB Output is correct
90 Correct 1 ms 596 KB Output is correct
91 Correct 1 ms 596 KB Output is correct
92 Correct 1 ms 808 KB Output is correct
93 Correct 1 ms 804 KB Output is correct
94 Correct 1 ms 724 KB Output is correct
95 Correct 1 ms 724 KB Output is correct
96 Correct 1 ms 804 KB Output is correct
97 Correct 1 ms 724 KB Output is correct
98 Correct 1 ms 596 KB Output is correct
99 Correct 1 ms 724 KB Output is correct
100 Correct 1 ms 596 KB Output is correct
101 Correct 1 ms 724 KB Output is correct
102 Correct 1 ms 676 KB Output is correct
103 Correct 1 ms 608 KB Output is correct
104 Correct 1 ms 596 KB Output is correct
105 Correct 1 ms 596 KB Output is correct
106 Correct 1 ms 724 KB Output is correct
107 Correct 1 ms 724 KB Output is correct
108 Correct 1 ms 808 KB Output is correct
109 Correct 1 ms 804 KB Output is correct
110 Correct 3 ms 4180 KB Output is correct
111 Correct 7 ms 6356 KB Output is correct
112 Correct 4 ms 6192 KB Output is correct
113 Correct 6 ms 6228 KB Output is correct
114 Correct 3 ms 6100 KB Output is correct
115 Correct 4 ms 6100 KB Output is correct
116 Correct 5 ms 6100 KB Output is correct
117 Correct 3 ms 6228 KB Output is correct
118 Correct 4 ms 6100 KB Output is correct
119 Correct 12 ms 12800 KB Output is correct
120 Correct 8 ms 14676 KB Output is correct
121 Correct 10 ms 14436 KB Output is correct
122 Correct 9 ms 14316 KB Output is correct
123 Correct 8 ms 14292 KB Output is correct
124 Correct 31 ms 41944 KB Output is correct
125 Correct 62 ms 116320 KB Output is correct
126 Correct 335 ms 159012 KB Output is correct
127 Correct 122 ms 138412 KB Output is correct
128 Correct 81 ms 136000 KB Output is correct
129 Correct 87 ms 136232 KB Output is correct
130 Correct 104 ms 136564 KB Output is correct
131 Correct 99 ms 136440 KB Output is correct
132 Correct 8 ms 6100 KB Output is correct
133 Correct 1 ms 836 KB Output is correct
134 Correct 1 ms 1108 KB Output is correct
135 Correct 3 ms 4104 KB Output is correct
136 Correct 5 ms 5208 KB Output is correct
137 Correct 7 ms 6356 KB Output is correct
138 Correct 3 ms 6100 KB Output is correct
139 Correct 9 ms 6152 KB Output is correct
140 Correct 8 ms 6128 KB Output is correct
141 Correct 8 ms 6332 KB Output is correct
142 Correct 3 ms 6144 KB Output is correct
143 Correct 3 ms 6100 KB Output is correct
144 Correct 7 ms 6484 KB Output is correct
145 Correct 6 ms 6532 KB Output is correct
146 Correct 7 ms 6352 KB Output is correct
147 Correct 6 ms 6188 KB Output is correct
148 Correct 5 ms 6100 KB Output is correct
149 Correct 8 ms 6100 KB Output is correct
150 Correct 5 ms 6100 KB Output is correct
151 Correct 4 ms 6228 KB Output is correct
152 Correct 4 ms 6188 KB Output is correct
153 Correct 6 ms 6100 KB Output is correct
154 Correct 36 ms 14364 KB Output is correct
155 Correct 7 ms 6356 KB Output is correct
156 Correct 12 ms 12732 KB Output is correct
157 Correct 24 ms 13188 KB Output is correct
158 Correct 8 ms 14600 KB Output is correct
159 Correct 28 ms 14420 KB Output is correct
160 Correct 27 ms 14292 KB Output is correct
161 Correct 10 ms 14548 KB Output is correct
162 Correct 8 ms 14292 KB Output is correct
163 Correct 8 ms 14348 KB Output is correct
164 Correct 17 ms 15052 KB Output is correct
165 Correct 17 ms 15072 KB Output is correct
166 Correct 20 ms 14828 KB Output is correct
167 Correct 18 ms 14384 KB Output is correct
168 Correct 18 ms 14384 KB Output is correct
169 Correct 18 ms 14368 KB Output is correct
170 Correct 17 ms 14256 KB Output is correct
171 Correct 21 ms 14608 KB Output is correct
172 Correct 23 ms 14512 KB Output is correct
173 Correct 9 ms 14420 KB Output is correct
174 Correct 20 ms 18608 KB Output is correct
175 Correct 61 ms 31188 KB Output is correct
176 Correct 76 ms 70744 KB Output is correct
177 Correct 169 ms 91732 KB Output is correct
178 Correct 73 ms 119284 KB Output is correct
179 Correct 137 ms 136628 KB Output is correct
180 Correct 183 ms 136112 KB Output is correct
181 Correct 200 ms 136016 KB Output is correct
182 Correct 197 ms 136096 KB Output is correct
183 Correct 190 ms 136632 KB Output is correct
184 Correct 760 ms 271240 KB Output is correct
185 Correct 140 ms 151308 KB Output is correct
186 Correct 224 ms 182364 KB Output is correct
187 Correct 168 ms 196652 KB Output is correct
188 Correct 349 ms 305476 KB Output is correct
189 Correct 538 ms 274080 KB Output is correct
190 Correct 380 ms 273820 KB Output is correct
191 Correct 290 ms 279592 KB Output is correct
192 Correct 166 ms 273812 KB Output is correct
193 Correct 163 ms 273828 KB Output is correct
194 Correct 323 ms 285532 KB Output is correct
195 Correct 251 ms 285556 KB Output is correct
196 Correct 388 ms 274904 KB Output is correct
197 Correct 253 ms 274836 KB Output is correct
198 Correct 232 ms 273820 KB Output is correct
199 Correct 378 ms 273768 KB Output is correct
200 Correct 419 ms 275132 KB Output is correct
201 Correct 571 ms 274460 KB Output is correct
202 Correct 862 ms 274092 KB Output is correct
203 Correct 1521 ms 547076 KB Output is correct
204 Correct 549 ms 284328 KB Output is correct
205 Correct 733 ms 334600 KB Output is correct
206 Correct 412 ms 544988 KB Output is correct
207 Correct 1106 ms 634860 KB Output is correct
208 Correct 1244 ms 547296 KB Output is correct
209 Correct 1680 ms 547108 KB Output is correct
210 Correct 510 ms 553952 KB Output is correct
211 Correct 359 ms 546932 KB Output is correct
212 Correct 380 ms 546984 KB Output is correct
213 Correct 498 ms 570212 KB Output is correct
214 Correct 614 ms 570316 KB Output is correct
215 Correct 802 ms 548340 KB Output is correct
216 Correct 732 ms 548708 KB Output is correct
217 Correct 760 ms 549708 KB Output is correct
218 Correct 636 ms 546904 KB Output is correct
219 Correct 619 ms 548720 KB Output is correct
220 Correct 317 ms 549332 KB Output is correct
221 Correct 312 ms 549840 KB Output is correct
222 Correct 816 ms 552152 KB Output is correct
223 Correct 1261 ms 548884 KB Output is correct
224 Correct 1328 ms 547880 KB Output is correct
225 Correct 973 ms 547192 KB Output is correct