QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#128477#2760. Simurghsomethingnew#51 219ms10488kbC++209.3kb2023-07-21 06:25:362024-07-04 00:50:43

Judging History

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

  • [2024-07-04 00:50:43]
  • 评测
  • 测评结果:51
  • 用时:219ms
  • 内存:10488kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-21 06:25:36]
  • 提交

answer

//  ↘ ⬇ ⬇ ⬇ ⬇ ⬇ ↙
//  ➡ @roadfromroi ⬅
//  ↗ ⬆ ⬆ ⬆ ⬆ ⬆ ↖
#include <iostream>
#include "vector"
#include "algorithm"
#include "numeric"
#include "climits"
#include "iomanip"
#include "bitset"
#include "cmath"
#include "map"
#include "deque"
#include "array"
#include "set"
#include "simurgh.h"
#define all(x) x.begin(), x.end()
using namespace std;
struct dsu {
    vector<int> p;
    dsu(int n) {
        p.assign(n, {});
        for (int i = 0; i < n; ++i) {
            p[i] = i;
        }
    }
    int getv(int v) {
        if (p[v] == v)
            return v;
        return p[v] = getv(p[v]);
    }
    bool merge(int a, int b) {
        a = getv(a);
        b = getv(b);
        if (a == b)
            return 0;
        p[a] = b;
        return 1;
    }
};
vector<array<int, 4>> bb;
vector<int> banned;
vector<int> inba(int n) {
    dsu usd(n);
    vector<int> vec;
    for (int i = 0; i < bb.size(); ++i) {
        if (!banned[i] and usd.merge(bb[i][0], bb[i][1])) {
            vec.push_back(i);

        }
    }
    return vec;
}
vector<int> getel(int n, vector<int> ind) {
    dsu usd(n);
    vector<int> vec;
    for (auto i : ind) {
        if (usd.merge(bb[i][0], bb[i][1])) {
            vec.push_back(i);
        }
    }
    return vec;
}
bool chk(int n, int v, vector<int> indexes) {
    dsu usd(n);
    int rb = 1;
    for (auto i : indexes) {
        if (v != i)
            rb += usd.merge(bb[i][0], bb[i][1]);
        if (rb == n)
            return 1;
    }
    return 0;
}
int cococo(vector<int> r) {
    for (auto &i : r)
        i = bb[i][3];
    return count_common_roads(r);
}
int countpls1(vector<int> r, int a) {
    r.push_back(a);
    return cococo(r);
}
int weightedask(vector<int> a) {
    //cout << "DD" << endl;
    int res = 0;
    for (auto i : a) {
        if (bb[i][2] != -1)
            res -= bb[i][2];
    }
    int vl = res + cococo(a);
    //cout << "EE" << endl;
    return vl;
}
int cmp(int n, int a, int b, vector<int> indexes) {
    dsu usd(n);
    int vv;
    if (bb[a][0] == bb[b][0] or bb[a][0] == bb[b][1]) {
        vv = bb[a][0];
    } else {
        vv = bb[a][1];
    }
    int nva = bb[a][0] + bb[a][1] - vv;
    int nvb = bb[b][0] + bb[b][1] - vv;
    int rb = 1;
    vector<int> tocmp;
    //cout << rb << ' ' << a << ' ' << b << endl;
    for (auto i : indexes) {
        //cout << i << endl;
        if (bb[i][0] != vv and bb[i][1] != vv and usd.merge(bb[i][0], bb[i][1])) {
            rb += 1;
            tocmp.push_back(i);
        }
    }
    for (auto i : indexes) {
        //cout << i << endl;
        if (bb[i][0] == vv or bb[i][1] == vv) {
            int vt = bb[i][0] + bb[i][1] - vv;
            if (usd.getv(vt) != usd.getv(nva) and usd.getv(vt) != usd.getv(nvb) and usd.merge(vv, vt)) {
                rb += 1;
                tocmp.push_back(i);
            }
        }
    }
    if (rb != n - 1)
        return -10;
    //cout << vv << endl;
    //cout << a << endl;
    int vl1 = countpls1(tocmp, a);
    int vl2 = countpls1(tocmp, b);
    // cout << a << ' ' << vl1 << ' ' << b << ' ' << vl2 << endl;
    return vl2 - vl1;
}
struct dsutype {
    vector<int> p;
    vector<int> tp;
    dsutype(int n, vector<int> tps) {
        p.assign(n, {});
        tp = tps;
        for (int i = 0; i < n; ++i) {
            p[i] = i;
        }
    }
    int getv(int v) {
        if (p[v] == v)
            return v;
        return p[v] = getv(p[v]);
    }
    bool merge(int n, int a, int b, vector<int> &indexes) {
        int aorig = a, borig = b;
        a = getv(a);
        b = getv(b);
        if (tp[a] == -1 or tp[b] == -1) {
            int quer = cmp(n, aorig, borig, indexes);
            if (quer == -10)
                return 0;
            int vl = max(tp[a], tp[b]);
            if (quer == 0) {
                p[b] = a;
                tp[a] = vl;
            }
            if (quer == 1) {
                tp[b] = 1;
                tp[a] = 0;
            }
            if (quer == -1) {
                tp[b] = 0;
                tp[a] = 1;
            }
            return 1;
        }
        return 0;
    }
};
int zprsmart(int n, vector<int> addp, vector<int> knw) {
    //cout << "ZPSt\n";
    dsu usd(n);
    vector<int> tocmp;
    for (auto i : addp) {
        tocmp.push_back(i);
        if (!usd.merge(bb[i][0], bb[i][1]))
            while (1);
    }
    for (auto i : knw) {
        if (usd.merge(bb[i][0], bb[i][1]))
            tocmp.push_back(i);
    }
    int vl = weightedask(tocmp);
    //cout << "ZPend\n";
    return vl;
}
std::vector<int> find_roads(int n, vector<int> u, vector<int> v) {
    bb.assign(u.size(), {});
    for (int i = 0; i < u.size(); ++i) {
        bb[i] = {u[i], v[i], -1, i};
    }
    for (int i = 0; i < bb.size(); ++i) {
        swap(bb[i], bb[rand() % bb.size()]);
    }
    banned.assign(u.size(), 0);
    /*vector<int> maybe(u.size());
    for (int i = 0; i < u.size(); ++i) {
        maybe[i] = i;
    }*/
    vector<int> maybe = inba(n);
    for (auto i : maybe)
        banned[i] = 1;
    for (int i = 0; i < 1; ++i) {
        vector<int> maybe2 = inba(n);
        for (auto i : maybe2) {
            //cerr << i << endl;
            maybe.push_back(i);
        }
    }

    vector<int> tpp(u.size(), -1);
    for (auto i : maybe) {
        if (!chk(n, i, maybe)) {
            bb[i][2] = 1;
            tpp[i] = 1;
        }
    }
    dsutype usd(tpp.size(), tpp);
    int cc = 0;
    for (auto i : maybe) {
        for (auto j : maybe) {
            if (i == j)
                break;
            if (bb[i][0] == bb[j][0] or bb[i][0] == bb[j][1] or bb[i][1] == bb[j][0] or bb[i][1] == bb[j][1]) {
                //cout << i << ' ' << j << endl;
                usd.merge(n, i, j, maybe);
            }
        }
        cc++;
    }
    vector<int> knowres2, knowres;
    for (auto i : maybe) {
        if (usd.getv(i) != i and usd.tp[usd.getv(i)] == -1) {
            usd.tp[usd.getv(i)] = 0;
        }
    }
    for (auto i : maybe) {
        if (usd.tp[usd.getv(i)] != -1) {
            bb[i][2] = usd.tp[usd.getv(i)];
            knowres2.push_back(i);
        }
    }
    knowres = getel(n, knowres2);
    if (knowres.size() != n - 1)
        while (1);
    vector<vector<int>> g(n);
    for (int i = 0; i < v.size(); ++i) {
        g[bb[i][0]].push_back(i);
        g[bb[i][1]].push_back(i);
    }
    for (int i = 0; i < n; ++i) {
        vector<int> clred;
        for (auto j : g[i]) {
            if (bb[j][2] == -1)
                clred.push_back(j);
        }
        int fr = -1;
        while (fr != clred.size()) {
            int l = fr, r = clred.size();
            while (l + 1 < r) {
                int m = l + r >> 1;
                vector<int> tepa;
                for (int j = fr+1; j <= m; ++j) {
                    tepa.push_back(clred[j]);
                }
                if (zprsmart(n, tepa, knowres)) {
                    r = m;
                } else {
                    l = m;
                }
            }
            fr = r;
            if (fr != clred.size()) {
                bb[clred[fr]][2] = 1;
            }
        }
        for (auto j : clred) {
            if (bb[j][2] == -1)
                bb[j][2] = 0;
        }
    }
    //cout << "DAAA" << endl;
    vector<int> resba;
    for (int i = 0; i < bb.size(); ++i) {
        if (bb[i][2] == 1)
            resba.push_back(bb[i][3]);
    }
    return resba;
}


/*
static int MAXQ = 30000;

static int n, m, q = 0;
static vector<int> u, v;
static vector<bool> goal;

static void wrong_answer() {
    printf("NO\n");
    exit(0);
}

static bool is_valid(const vector<int>& r) {
    if(int(r.size()) != n - 1)
        return false;

    for(int i = 0; i < n - 1; i++)
        if (r[i] < 0 || r[i] >= m)
            return false;

    return true;
}

static int _count_common_roads_internal(const vector<int>& r) {
    dsu usd(n);
    if(!is_valid(r)) {
        cout << "invalid query\n";
        for (auto i : r)
            cout << i << ' ';
        cout << endl;
        wrong_answer();
    }
    int rb = 1;
    for (auto i : r) {
        rb += usd.merge(u[i], v[i]);
    }
    if (rb != n) {
        cout << "invalid query\n";
        for (auto i : r)
            cout << i << ' ';
        cout << endl;
        wrong_answer();
    }
    int common = 0;
    for(int i = 0; i < n - 1; i++) {
        bool is_common = goal[r[i]];
        if (is_common)
            common++;
    }

    return common;
}

int count_common_roads(const vector<int>& r) {
    q++;
    if(q > MAXQ)
        wrong_answer();

    return _count_common_roads_internal(r);
}

int main() {
    assert(2 == scanf("%d %d", &n, &m));

    u.resize(m);
    v.resize(m);

    for(int i = 0; i < m; i++)
        assert(2 == scanf("%d %d", &u[i], &v[i]));

    goal.resize(m, false);

    for(int i = 0; i < n - 1; i++) {
        int id;
        assert(1 == scanf("%d", &id));
        goal[id] = true;
    }

    vector<int> res = find_roads(n, u, v);

    if(_count_common_roads_internal(res) != n - 1)
        wrong_answer();

    printf("YES\n");

    return 0;
}
*/

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 13
Accepted

Test #1:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 21 30000
2 0
0 1
5 2
2 6
1 3
3 0
6 0
4 5
3 2
4 0
1 4
0 5
4 3
4 6
6 1
2 1
5 3
2 4
5 6
5 1
6 3
7 10 9 13 12 17

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
7 13 10 9 12 17

result:

ok correct

Test #2:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 21 30000
4 6
1 6
2 3
0 3
2 1
2 6
5 6
6 3
0 2
1 0
4 2
1 3
5 2
5 0
0 6
5 3
4 5
5 1
3 4
1 4
4 0
4 16 10 0 20 18

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
4 16 10 0 20 18

result:

ok correct

Test #3:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 21 30000
2 5
0 4
4 5
4 3
5 3
1 3
3 6
4 1
6 0
5 6
6 2
6 1
6 4
3 2
2 1
1 0
0 2
5 0
5 1
4 2
0 3
20 17 15 9 2 19

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
15 9 20 17 19 2

result:

ok correct

Test #4:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 13 30000
2 4
4 3
3 2
0 3
0 4
6 3
6 1
4 5
6 2
1 3
5 6
6 0
6 4
3 9 12 7 0 4

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
9 3 12 4 7 0

result:

ok correct

Test #5:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
6 10 30000
5 2
0 1
1 2
0 3
3 2
1 4
0 5
3 5
4 3
1 3
5 0 7 2 1

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
2 5 0 1 7

result:

ok correct

Test #6:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 16 30000
3 4
2 5
2 1
0 5
1 5
0 2
2 6
6 1
4 6
0 1
2 3
6 3
3 1
1 4
4 5
3 5
0 9 5 15 3 11

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
0 15 5 9 11 3

result:

ok correct

Test #7:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
2 1 30000
0 1
0

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
0

result:

ok correct

Test #8:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
3 3 30000
0 1
2 0
1 2
2 0

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
2 0

result:

ok correct

Test #9:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
6 5 30000
2 4
5 4
4 0
4 1
3 4
3 1 4 0 2

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
0 1 2 4 3

result:

ok correct

Test #10:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
6 14 30000
4 2
1 3
4 5
4 1
0 4
0 1
2 3
2 1
0 3
5 3
0 5
0 2
5 2
1 5
13 8 10 7 3

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
8 3 7 13 10

result:

ok correct

Test #11:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 6 30000
3 0
3 5
4 0
5 6
0 2
1 3
3 4 1 5 0 2

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
1 0 3 4 5 2

result:

ok correct

Test #12:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
6 15 30000
4 3
2 3
3 5
2 0
5 2
1 3
1 4
0 5
3 0
4 0
1 0
2 1
4 5
4 2
5 1
9 13 12 6 0

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
13 0 6 12 9

result:

ok correct

Test #13:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 21 30000
0 2
2 5
3 4
0 3
5 4
4 2
2 1
4 6
5 3
0 1
4 0
1 6
3 6
1 3
1 5
5 0
0 6
4 1
6 5
3 2
2 6
16 3 18 17 4 6

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
4 16 6 3 17 18

result:

ok correct

Subtask #2:

score: 17
Accepted

Dependency #1:

100%
Accepted

Test #14:

score: 17
Accepted
time: 2ms
memory: 4160kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1225 30000
47 4
24 48
42 13
5 42
19 17
29 31
23 48
37 25
37 43
27 22
43 30
19 44
49 37
39 14
26 46
46 35
49 15
40 19
6 31
37 1
21 0
26 45
6 4
38 36
6 8
20 4
18 24
20 35
5 29
1 19
35 49
29 20
25 10
10 36
2 22
26 11
7 9
24 3
35 38
48 41
22...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
880 1033 497 377 860 584 851 277 1058 706 212 440 754 195 333 299 355 503 257 746 478 768 679 1042 1071 923 866 1107 591 127 760 509 119 770 221 1199 552 1205 322 458 795 166 397 61 638 24 848 62 1006

result:

ok correct

Test #15:

score: 0
Accepted
time: 2ms
memory: 3956kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1225 30000
44 29
11 44
39 16
20 31
6 3
9 27
49 27
12 0
27 1
48 49
46 12
35 36
35 11
49 13
23 20
28 26
12 1
42 37
5 15
28 32
6 10
16 7
4 43
4 31
49 34
9 14
2 46
44 30
40 17
14 29
41 18
27 44
13 3
23 40
47 24
16 3
6 26
45 18
24 42
11 10
23...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
577 1051 497 48 1173 1037 633 1185 97 279 95 196 256 88 496 1055 678 182 315 456 204 89 600 723 776 297 67 913 228 769 21 552 280 178 501 701 181 849 354 607 562 472 933 230 275 420 151 294 649

result:

ok correct

Test #16:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1225 30000
12 30
6 44
33 47
7 33
0 2
10 30
30 46
14 11
43 42
13 27
49 24
6 17
21 2
12 21
24 38
5 21
17 0
16 4
26 5
27 32
20 45
6 20
19 0
20 35
47 39
17 39
0 23
26 33
1 17
3 20
4 46
48 21
21 35
24 40
9 29
28 23
9 1
43 34
4 44
18 37
40 13
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
160 261 834 273 150 213 997 198 847 1048 917 966 513 882 524 535 93 470 290 374 95 438 841 894 204 222 482 874 67 382 859 610 1068 907 784 885 25 795 166 466 1064 790 1075 326 56 24 1141 948 1082

result:

ok correct

Test #17:

score: 0
Accepted
time: 2ms
memory: 3864kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1002 30000
35 6
20 23
17 3
16 48
49 29
31 32
38 3
10 39
16 4
47 13
0 19
24 25
42 39
48 44
39 32
1 42
18 8
17 15
19 32
33 23
21 18
7 13
6 0
26 35
34 22
39 13
48 47
6 21
44 7
21 13
43 16
41 43
36 6
25 14
3 49
3 33
47 29
25 45
45 13
12 13
3...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
614 28 90 304 174 4 401 351 221 823 436 357 685 112 116 266 308 591 941 559 828 875 440 712 213 837 783 801 560 135 898 841 372 229 237 858 403 313 963 670 370 636 402 808 420 668 20 348 96

result:

ok correct

Test #18:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 371 30000
20 0
5 9
13 38
4 3
12 23
20 42
43 12
27 28
1 42
23 42
14 41
39 9
2 9
10 13
14 32
18 30
6 7
32 3
39 38
12 34
33 0
10 41
32 30
15 43
13 6
2 30
20 14
36 21
17 2
0 28
24 29
19 7
25 15
10 48
21 49
31 7
2 44
7 44
28 40
38 17
33 48
18...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
233 0 300 82 101 234 38 21 74 102 156 239 45 129 62 18 212 309 35 193 294 16 277 131 210 135 139 224 290 257 105 140 279 14 349 24 93 238 89 274 46 344 121 237 364 152 27 216 314

result:

ok correct

Test #19:

score: 0
Accepted
time: 2ms
memory: 4120kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1027 30000
46 5
15 29
43 39
16 32
38 5
4 22
13 4
41 5
0 41
39 6
6 8
3 13
25 6
40 25
17 40
47 0
26 15
30 11
27 31
43 45
30 17
35 37
8 27
2 38
35 19
7 12
36 31
41 21
14 25
14 35
15 17
37 2
27 46
24 39
24 29
19 10
28 1
22 35
24 41
16 46
13 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
140 639 521 148 198 142 83 585 220 974 583 928 417 1005 196 497 487 571 77 313 674 488 1007 839 158 983 398 406 506 660 986 170 988 173 1021 230 1001 5 13 885 816 31 238 645 607 670 994 112 85

result:

ok correct

Test #20:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 965 30000
28 25
38 23
12 44
1 35
45 46
39 4
19 22
40 23
25 49
20 29
30 9
17 2
15 32
32 14
45 7
19 12
40 22
12 35
10 5
49 37
29 31
19 40
22 6
28 46
23 11
2 1
40 24
14 44
44 40
16 47
7 14
38 47
43 34
4 18
17 22
32 30
33 13
36 21
47 37
37 3...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
352 114 546 146 698 257 6 371 551 901 541 125 251 16 837 259 157 766 48 346 841 673 353 273 74 213 911 182 109 799 138 846 335 820 952 508 79 570 50 544 332 679 796 907 505 93 45 127 161

result:

ok correct

Test #21:

score: 0
Accepted
time: 2ms
memory: 4140kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 900 30000
25 47
5 46
35 22
46 22
15 35
37 46
27 46
29 20
0 7
7 14
8 19
28 38
11 7
9 16
28 0
38 29
30 47
23 11
26 10
3 38
30 49
28 13
45 3
7 17
42 0
30 1
48 2
47 22
18 49
26 34
12 20
40 9
12 38
46 16
24 16
40 30
31 33
45 34
16 25
14 31
4 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
566 590 530 557 533 423 763 211 288 196 870 605 561 404 298 645 360 745 704 351 291 323 805 252 816 433 703 653 498 40 877 32 65 575 699 487 502 78 751 300 428 727 430 46 256 27 897 524 551

result:

ok correct

Test #22:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 701 30000
1 47
37 0
2 41
32 33
15 40
38 42
5 27
0 9
0 8
10 36
26 42
5 25
41 35
27 2
21 15
40 28
0 15
43 29
37 3
28 18
9 3
47 27
32 38
48 47
28 13
34 32
27 23
40 8
38 15
46 7
24 14
12 46
47 28
20 43
2 48
2 28
22 45
14 27
23 42
30 35
26 18...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
86 32 18 76 2 70 62 39 10 477 3 22 13 46 15 84 8 21 61 6 51 24 42 26 23 0 9 30 4 17 16 12 57 5 31 1 33 28 37 14 19 11 29 60 7 56 36 25 55

result:

ok correct

Test #23:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 626 30000
49 25
30 31
0 3
6 11
25 10
19 13
10 49
43 31
7 19
24 28
39 31
15 7
32 30
27 41
18 23
31 13
26 40
19 41
42 30
47 28
5 4
41 24
42 27
15 45
29 14
29 37
42 6
2 42
45 13
27 32
32 20
4 29
4 21
20 24
16 44
14 12
28 6
25 37
10 22
8 48
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
44 13 25 39 18 49 46 47 19 10 17 30 24 7 8 37 41 20 5 32 2 21 35 43 11 27 77 61 31 3 9 51 4 0 12 52 56 34 54 97 1 26 38 23 16 14 66 91 15

result:

ok correct

Test #24:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 601 30000
28 10
43 16
22 35
42 20
8 39
34 33
47 44
47 49
3 9
10 32
34 5
4 14
9 18
19 33
29 38
31 25
8 2
5 4
5 8
40 23
27 21
36 23
10 6
14 26
39 27
44 36
29 47
6 1
2 46
21 15
43 13
28 38
1 23
41 45
3 49
26 15
39 2
11 17
22 0
45 47
48 46
4...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
18 23 8 25 59 40 29 15 39 65 20 24 60 26 37 52 34 0 50 12 38 31 19 21 30 33 6 13 7 1 44 47 17 2 11 9 10 70 22 16 4 130 27 3 49 14 56 28 5

result:

ok correct

Test #25:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 85 30000
33 16
22 4
21 25
32 42
13 46
7 38
18 16
38 33
44 27
19 2
3 2
30 24
0 47
49 12
20 47
17 32
23 26
45 28
35 8
31 20
40 34
25 36
25 43
5 40
11 46
24 1
49 35
30 9
17 41
33 29
11 13
28 19
9 32
6 48
11 39
15 23
16 29
31 0
6 38
27 4
3 0...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
3 12 10 46 25 82 21 5 19 2 45 84 44 27 11 20 52 13 24 16 32 47 14 0 35 18 9 17 29 40 33 41 70 4 1 61 26 6 28 23 8 69 34 7 15 31 39 38 22

result:

ok correct

Test #26:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 602 30000
23 30
14 19
2 28
37 21
18 35
1 24
35 1
2 7
11 14
41 11
15 30
6 47
16 25
27 21
14 31
26 30
36 14
43 8
47 7
1 15
18 14
38 31
16 10
19 45
49 27
40 4
25 13
31 3
43 26
19 39
47 27
30 1
2 27
34 33
43 36
45 18
4 37
39 23
11 17
37 44
2...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
15 47 10 19 0 30 11 41 7 27 56 17 51 67 4 38 21 71 18 25 9 44 28 42 14 22 39 16 96 1 12 6 40 5 93 45 75 29 13 20 23 33 2 26 3 24 218 8 36

result:

ok correct

Test #27:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 627 30000
2 46
48 6
42 10
35 38
19 24
47 39
37 7
12 39
12 31
6 43
9 5
25 28
12 26
30 16
41 48
45 11
44 31
47 15
31 32
36 37
32 43
36 15
7 48
27 28
26 20
0 6
31 18
45 35
37 3
9 20
5 20
40 2
7 43
35 33
39 15
40 27
0 39
28 42
0 38
17 46
6 7...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
38 13 27 17 42 35 10 93 21 28 45 11 20 49 18 4 76 9 16 104 23 19 0 33 39 8 14 1 12 25 31 84 89 24 56 26 15 53 29 2 6 72 37 5 59 3 74 48 7

result:

ok correct

Test #28:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 270 30000
20 36
24 11
20 31
45 48
12 16
11 10
36 8
19 31
3 49
6 45
31 33
37 20
41 46
19 33
45 13
44 26
23 20
49 16
40 27
46 45
19 26
33 28
15 25
28 26
43 16
1 31
9 16
19 36
30 9
13 41
0 48
15 49
13 21
28 35
25 49
35 1
47 14
21 41
16 25
1...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
21 62 77 8 86 159 36 87 32 17 75 24 0 2 31 14 9 5 16 7 57 44 4 3 15 10 173 19 51 18 22 33 55 6 56 217 72 25 30 76 43 11 26 12 20 135 28 65 1

result:

ok correct

Test #29:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 130 30000
26 14
28 25
10 31
20 12
12 39
12 28
41 19
48 5
20 24
27 4
21 43
21 45
11 29
14 46
29 13
36 27
40 11
0 30
32 34
22 30
27 46
6 22
34 40
46 4
13 15
6 49
22 8
49 22
46 36
42 5
45 43
16 32
30 9
26 27
21 37
27 14
2 30
34 23
18 42
21 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
12 26 21 1 31 46 45 17 7 70 10 14 3 13 29 47 43 53 4 19 32 16 25 39 49 15 34 24 18 48 22 6 54 51 9 64 118 5 83 20 65 11 37 2 38 8 123 36 0

result:

ok correct

Test #30:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 625 30000
34 44
19 12
6 24
31 33
30 11
10 40
7 43
46 39
47 4
36 15
8 27
42 21
35 16
26 48
17 29
2 1
0 25
23 14
20 3
32 18
49 13
41 37
22 9
28 38
5 45
17 7
32 0
26 19
19 43
34 45
48 37
48 3
23 37
39 12
22 37
32 49
17 38
19 11
46 26
24 27
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
40 29 14 23 30 2 4 36 22 26 7 25 11 24 5 8 28 39 16 6 0 18 45 13 20 17 33 35 37 75 12 41 31 15 27 3 42 9 54 1 34 19 10 21 58 55 32 46 64

result:

ok correct

Test #31:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 625 30000
37 43
38 19
3 37
27 46
35 26
15 7
47 34
25 49
2 45
5 20
28 44
11 22
33 1
36 31
16 42
40 32
43 24
6 8
12 14
18 4
9 21
23 48
41 30
13 29
10 0
42 27
20 26
20 9
24 0
32 39
11 10
14 21
11 28
20 46
24 14
18 34
13 18
42 30
43 41
16 9
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
40 29 14 23 30 2 4 36 51 22 26 7 25 11 24 5 8 50 52 28 61 72 16 6 0 18 45 13 20 17 33 35 37 12 48 31 15 27 3 49 43 42 9 1 34 19 10 21 32

result:

ok correct

Test #32:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 625 30000
25 29
39 24
9 31
10 34
16 41
7 30
46 36
11 27
42 22
18 8
14 20
35 13
5 21
4 26
1 29
0 44
33 43
37 15
38 6
19 32
2 48
23 17
45 40
49 28
47 25
8 35
1 38
4 49
5 14
41 28
16 34
8 41
22 4
44 21
8 37
45 44
14 24
13 32
1 27
31 11
40 0...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
29 67 14 23 30 2 96 4 36 22 26 7 25 11 24 5 8 62 28 39 16 6 0 18 45 13 20 17 33 35 37 12 41 31 15 27 3 43 42 9 1 34 19 10 21 38 58 32 46

result:

ok correct

Test #33:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 625 30000
43 10
21 5
12 24
8 3
16 18
32 28
41 39
26 40
1 7
47 48
42 43
44 29
6 35
9 22
37 33
27 23
10 19
25 45
46 2
17 15
38 34
0 31
20 49
13 11
36 4
6 36
8 48
36 16
15 49
22 17
7 32
34 29
19 13
30 18
7 0
26 29
15 8
43 6
22 25
12 10
6 8
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
40 29 59 14 23 30 2 4 36 22 26 7 25 11 24 5 8 28 39 16 6 0 18 13 20 17 33 35 37 75 12 41 31 15 27 3 47 57 43 42 9 1 34 19 10 21 38 32 46

result:

ok correct

Subtask #3:

score: 21
Accepted

Dependency #2:

100%
Accepted

Test #34:

score: 21
Accepted
time: 38ms
memory: 5292kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 28680 30000
77 105
206 25
9 149
62 63
186 223
157 69
181 222
103 184
97 50
227 3
60 109
51 3
188 65
213 224
33 209
133 213
84 23
189 158
138 141
191 195
221 106
44 49
195 86
90 231
202 204
83 43
192 37
46 21
76 34
126 234
59 213
197 41
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
1169 3758 10488 8170 4586 5414 18470 21165 3493 3704 13791 27914 13540 21971 2123 816 17698 1537 9381 27130 13341 23727 21950 17279 1263 23765 13080 1637 5847 10468 1344 11339 25018 27534 14604 11020 20578 3211 16164 14507 4281 17201 213...

result:

ok correct

Test #35:

score: 0
Accepted
time: 42ms
memory: 4924kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 27680 30000
200 15
124 32
165 159
220 160
218 108
124 92
144 70
107 93
63 84
18 154
3 94
100 133
214 205
58 89
206 16
17 141
122 155
140 199
37 195
165 236
162 136
142 124
3 168
205 149
99 61
210 89
81 100
185 15
131 179
106 5
11 215
16...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
23035 17192 5356 10076 10477 9154 5336 5041 21409 8189 18202 8232 23941 4114 19590 13702 9625 12207 25766 16787 17254 24009 3904 17785 455 10451 15156 7215 17644 1875 22996 26043 14695 19686 18500 15921 7691 6304 6932 4589 27299 20754 61...

result:

ok correct

Test #36:

score: 0
Accepted
time: 32ms
memory: 4696kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 19000 30000
202 130
117 5
108 72
44 63
37 77
174 221
63 193
228 218
176 98
37 131
174 32
212 211
70 131
238 213
186 170
78 17
214 46
132 50
224 48
182 84
117 187
219 25
26 7
64 117
57 213
32 193
223 205
92 110
238 142
125 98
26 126
156 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
16373 8568 8083 4220 10894 7225 10470 12422 12314 3583 7089 11014 14683 11315 13423 765 5256 14117 2380 633 911 9514 8697 13314 4056 3713 18330 870 9271 15381 13329 9999 7984 4232 5878 1885 14074 11567 10289 16351 3781 18103 12531 3554 7...

result:

ok correct

Test #37:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 1200 30000
69 37
167 58
236 35
109 163
146 70
157 29
171 159
21 97
160 87
0 175
66 39
67 105
44 23
28 19
68 239
191 21
206 176
16 4
147 217
5 213
162 9
235 23
29 24
88 37
154 79
120 30
37 113
40 136
188 83
62 65
83 115
186 228
89 177
84...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
457 548 518 503 427 429 1123 473 359 1077 767 998 276 854 1115 1182 1034 280 251 934 1018 412 1162 723 1012 241 1065 225 256 367 250 529 896 96 729 1177 891 696 112 158 154 289 63 904 983 999 118 6 636 1056 150 409 801 787 41 1185 298 73...

result:

ok correct

Test #38:

score: 0
Accepted
time: 43ms
memory: 5084kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 28500 30000
39 121
47 231
20 137
46 76
236 198
129 155
195 39
68 232
68 213
149 87
10 87
27 191
39 58
124 116
174 14
24 41
52 42
221 180
103 193
197 28
170 84
152 166
51 145
123 120
1 5
75 67
61 207
80 160
62 118
62 191
153 72
230 51
13...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
284 4421 4137 7483 16641 7874 10723 7952 1268 17343 5294 4853 99 2607 13662 22823 26698 9515 18122 21117 17527 4834 23558 18008 10662 100 21095 5911 3452 24694 13822 16870 17203 1481 11441 16589 8202 27777 11249 9436 26299 16791 2783 467...

result:

ok correct

Test #39:

score: 0
Accepted
time: 39ms
memory: 5116kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 24300 30000
224 91
45 219
129 54
171 116
139 153
2 122
62 154
136 43
138 86
228 85
88 18
146 135
116 0
230 107
165 42
142 137
152 10
191 238
76 196
196 90
181 187
150 232
166 24
32 213
59 89
87 52
102 79
167 119
89 202
111 19
142 20
142...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
22426 7867 8071 3229 3579 2310 4469 9096 981 4459 1267 4616 3492 5132 6289 19757 4793 10004 17439 8571 883 13309 5279 6576 7140 20437 16899 6628 3939 6830 8159 17279 8766 14286 22636 20191 5332 19846 9679 22597 22364 4848 15926 21031 696...

result:

ok correct

Test #40:

score: 0
Accepted
time: 37ms
memory: 4696kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 19000 30000
213 152
122 131
131 30
199 167
218 66
136 31
35 118
209 45
87 214
160 210
204 179
99 199
92 36
208 161
101 237
169 231
96 229
220 184
36 169
126 198
167 113
95 188
117 142
41 139
4 191
7 214
0 41
123 73
90 1
228 115
206 106
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
6298 3744 6397 12193 8819 7066 14519 11133 6340 17414 5471 2000 4559 4560 7174 4178 14002 9214 10415 9778 7712 2171 12421 18955 6436 2090 4408 10232 12378 5815 8805 5631 6538 9695 1834 11879 14570 9931 9227 9514 6090 733 4110 17549 18618...

result:

ok correct

Test #41:

score: 0
Accepted
time: 40ms
memory: 5008kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 28680 30000
152 222
33 34
198 107
131 148
28 9
147 195
21 176
229 96
33 199
123 227
88 224
228 154
150 4
105 49
37 54
19 127
103 55
132 157
87 167
223 129
223 47
121 21
16 83
80 112
94 21
219 161
233 23
15 4
143 104
163 107
54 77
25 32
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
17158 9111 16002 17401 6397 3083 23386 6142 4203 20829 14218 19747 11683 6720 13486 18292 4508 26141 12910 7845 14501 1760 14420 7125 18177 20191 7074 11599 4553 6513 16767 3132 10833 24433 20229 12249 2917 23047 14216 27321 10560 497 10...

result:

ok correct

Test #42:

score: 0
Accepted
time: 36ms
memory: 5028kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 28580 30000
94 118
196 100
226 142
45 93
169 133
226 104
28 139
183 27
83 150
109 15
163 94
15 81
19 127
77 131
163 19
140 123
210 183
77 186
137 217
209 34
213 10
105 10
237 62
215 21
117 165
98 226
39 155
137 91
80 122
109 36
179 192
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
27867 23442 10854 18604 4952 8150 13681 5132 9361 17037 9351 11514 9350 7906 8427 6681 17183 22470 3055 12515 5424 27547 2462 18002 23741 11976 19899 28102 12723 717 22280 24678 3393 10468 154 5786 20028 13457 1703 15211 24378 18172 1681...

result:

ok correct

Test #43:

score: 0
Accepted
time: 29ms
memory: 4524kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 15181 30000
85 75
184 0
175 129
194 123
142 28
187 46
144 198
122 72
30 184
93 92
24 173
123 104
26 49
27 41
12 210
160 151
112 138
229 205
43 200
81 85
0 97
74 161
110 185
164 186
122 127
219 181
32 213
192 49
4 211
19 115
180 227
52 1...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
217 312 182 6 153 186 10 18 76 22 143 29 123 53 176 108 106 177 84 174 565 304 212 490 380 193 180 33 154 62 94 72 118 255 40 50 216 138 161 82 169 79 122 46 93 73 105 243 85 210 224 147 77 271 368 248 86 127 124 109 13 102 150 159 107 1...

result:

ok correct

Test #44:

score: 0
Accepted
time: 26ms
memory: 4364kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 12182 30000
65 20
13 163
23 228
96 62
37 143
6 29
129 121
108 162
51 34
21 199
227 25
227 208
72 80
121 17
139 227
146 193
169 89
6 50
76 137
2 232
196 125
182 64
10 178
90 19
142 6
24 100
80 57
27 185
202 225
42 125
66 23
7 5
18 49
12 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
104 167 0 81 283 29 87 213 254 327 98 128 139 378 191 186 94 51 7 11 164 226 200 23 207 31 130 218 751 110 55 124 114 188 192 10 278 116 20 75 240 70 53 499 95 136 172 96 19 153 138 47 21 195 169 67 27 22 161 39 388 33 190 206 437 63 140...

result:

ok correct

Test #45:

score: 0
Accepted
time: 29ms
memory: 4400kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 14281 30000
185 117
86 83
197 227
78 60
119 134
10 88
216 206
9 74
89 237
21 57
99 6
47 53
214 100
140 237
141 131
210 234
183 206
196 235
37 91
161 144
63 112
227 72
0 3
59 10
231 1
223 67
94 56
86 57
155 133
120 134
232 160
168 180
78...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
264 163 142 116 119 126 19 490 20 56 212 285 28 23 93 48 111 5 13 149 192 148 144 89 92 17 55 201 22 194 2079 1 87 78 208 156 25 130 161 154 128 276 175 143 203 294 195 256 166 75 61 67 303 109 265 77 136 63 44 123 66 51 469 205 133 158 ...

result:

ok correct

Test #46:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 10682 30000
158 52
46 225
215 8
82 232
96 15
138 127
62 153
87 88
61 215
129 49
172 28
224 171
87 53
195 215
47 224
91 209
55 227
83 130
59 107
18 238
210 23
225 60
104 51
130 113
72 160
236 65
87 174
111 30
96 175
226 139
99 227
35 5
2...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
42 80 21 77 280 278 49 208 186 136 379 1094 31 446 23 28 2128 205 256 130 65 35 66 7 75 241 195 174 157 9 251 548 357 81 276 305 213 314 92 102 158 59 79 24 159 68 18 479 145 244 354 922 17 226 52 89 233 331 384 104 173 191 206 132 30 88...

result:

ok correct

Test #47:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 4685 30000
47 83
235 230
162 108
46 147
229 72
72 173
114 71
121 113
143 162
51 214
121 51
239 118
197 48
158 150
21 64
0 236
160 67
218 188
29 79
8 85
142 4
26 153
73 114
78 137
91 87
224 116
211 87
22 62
106 85
19 125
26 162
14 210
12...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
263 154 159 55 208 95 203 170 48 267 259 7 189 187 34 54 16 274 155 26 116 368 308 162 784 43 396 140 35 131 173 186 91 52 49 221 96 120 98 195 5 101 17 72 209 47 205 32 51 73 4 22 130 50 124 69 294 28 84 107 9 312 291 199 39 240 40 128 ...

result:

ok correct

Test #48:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 419 30000
117 72
112 209
19 107
171 168
236 144
123 226
96 126
67 51
63 121
234 169
154 97
222 37
52 211
160 36
179 177
234 36
182 59
93 218
64 8
207 215
27 16
208 73
214 157
218 199
154 28
68 239
41 150
184 59
63 147
37 210
134 148
132...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
181 286 26 112 229 108 159 31 302 107 35 187 82 66 173 41 166 47 29 139 23 105 113 180 183 142 253 303 370 7 177 282 147 52 235 17 3 122 111 256 247 36 22 81 121 50 71 171 149 160 268 4 16 203 54 103 68 97 8 404 48 215 129 154 212 42 18 ...

result:

ok correct

Test #49:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 1340 30000
100 43
227 35
6 89
210 126
155 31
166 168
19 80
210 107
5 209
79 33
122 24
171 39
84 94
163 42
78 84
38 51
34 121
85 95
90 178
152 59
82 26
7 118
206 163
229 124
184 19
179 176
159 189
203 11
1 43
18 203
15 21
205 220
40 26
2...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
611 153 45 331 143 51 59 1058 227 114 129 108 81 138 75 266 136 118 91 216 222 95 73 63 362 191 7 92 157 203 33 171 15 79 197 116 477 187 112 568 339 302 245 386 139 160 65 20 209 279 53 101 4 13 124 172 327 89 313 395 115 38 244 34 366 ...

result:

ok correct

Test #50:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 4686 30000
109 222
129 207
41 85
155 232
104 110
7 9
15 182
92 132
160 23
167 223
130 191
7 170
183 20
97 154
55 130
199 143
125 112
225 196
70 182
48 178
204 64
51 86
210 7
175 98
71 70
29 185
205 105
227 79
196 191
138 114
161 146
56 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
228 43 185 863 74 114 218 421 112 78 30 75 209 42 601 32 246 89 304 171 33 140 91 106 798 84 100 97 225 1 120 118 252 73 55 34 182 11 8 322 131 152 54 40 98 279 85 81 41 113 164 104 57 283 154 126 46 61 174 167 24 417 94 223 80 143 132 1...

result:

ok correct

Test #51:

score: 0
Accepted
time: 31ms
memory: 4356kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 14282 30000
196 64
31 209
73 50
28 224
168 66
104 116
85 67
125 143
226 195
211 55
58 22
113 45
89 51
214 152
38 110
25 83
156 192
162 233
217 203
94 234
59 139
109 107
144 223
104 73
102 196
175 192
61 238
118 46
152 40
16 149
148 155
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
168 231 101 183 105 196 350 214 460 501 294 95 115 1 245 99 125 71 57 55 237 51 226 48 672 132 224 127 277 112 195 724 230 7 109 203 12982 401 68 131 338 181 33 32 116 178 17 108 26 36 18 76 72 124 63 114 46 434 39 111 78 22 10 223 152 2...

result:

ok correct

Test #52:

score: 0
Accepted
time: 27ms
memory: 4280kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 12183 30000
142 57
209 190
111 176
210 233
189 107
185 47
168 179
156 83
91 35
176 84
68 78
169 103
212 93
222 81
112 170
14 238
113 215
159 122
116 173
132 27
137 139
203 212
137 238
129 2
108 70
35 106
20 128
221 198
170 106
52 66
128...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
25 66 241 396 957 2 33 101 168 303 109 15 46 85 422 80 89 58 20 490 235 59 34 193 53 251 482 328 94 84 341 2886 322 127 60 131 142 72 161 99 12 38 65 32 150 52 224 115 247 1 275 10397 216 169 106 5466 215 55 29 36 23 221 147 97 311 39 16...

result:

ok correct

Test #53:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 10683 30000
169 36
164 166
236 70
211 50
140 122
204 14
97 30
153 145
55 238
163 214
185 130
36 74
127 139
218 48
184 214
157 238
180 37
86 145
135 6
30 129
159 200
48 118
114 61
193 12
66 128
79 82
24 102
25 77
56 59
118 38
128 153
181...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
139 201 333 6 431 323 180 358 102 820 152 141 9 99 239 390 77 186 223 146 97 98 96 389 92 149 42 1 156 87 173 220 457 14 71 74 285 563 407 104 167 15 120 25 20 4 47 861 114 195 84 169 60 251 7 19 236 88 242 76 105 227 0 111 78 122 168 59...

result:

ok correct

Test #54:

score: 0
Accepted
time: 30ms
memory: 4528kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 15182 30000
173 21
231 223
56 97
175 160
1 181
205 59
177 0
158 194
220 0
90 31
104 239
181 204
29 221
9 169
106 38
196 48
119 141
213 48
25 104
35 175
126 160
149 70
110 131
14 172
37 35
162 110
149 121
13 231
40 191
79 102
64 2
98 156...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
3 484 216 341 151 105 13 81 138 139 147 108 38 93 61 69 5 144 367 58 225 66 158 87 306 77 184 73 96 164 50 100 200 246 11 43 156 76 220 103 218 127 285 131 83 358 515 74 64 191 194 125 160 60 79 29 202 316 80 70 30 82 642 55 109 359 169 ...

result:

ok correct

Test #55:

score: 0
Accepted
time: 30ms
memory: 4488kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 14400 30000
219 122
167 73
229 205
178 62
203 85
11 210
179 124
188 23
80 98
180 156
217 0
135 7
2 104
61 138
47 108
237 77
224 126
164 75
84 34
92 212
83 233
68 128
102 78
94 140
27 155
4 107
225 111
132 87
195 37
142 13
117 90
129 28
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
115 76 158 92 14 157 9 244 202 49 8 166 24 34 111 94 140 126 47 185 2 114 70 20 258 237 6 19 129 298 136 340 181 190 135 96 177 102 38 214 192 128 184 194 53 98 72 101 178 138 232 156 208 119 95 173 80 253 165 193 52 207 386 301 81 175 6...

result:

ok correct

Test #56:

score: 0
Accepted
time: 31ms
memory: 4404kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 14400 30000
175 171
220 96
214 27
48 205
75 200
8 166
76 10
213 67
62 168
31 69
39 4
128 36
6 79
178 107
224 104
20 185
49 45
60 160
119 72
148 159
141 226
24 35
194 54
2 15
209 232
44 228
149 50
234 66
57 172
25 196
195 239
144 115
100...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
115 76 158 92 14 157 9 49 8 166 24 34 111 94 140 126 47 185 221 2 114 70 20 258 237 6 19 129 136 181 190 268 135 96 228 102 38 214 201 128 184 194 53 98 72 101 178 138 232 156 208 225 119 95 173 80 291 165 193 52 207 81 175 67 174 271 59...

result:

ok correct

Test #57:

score: 0
Accepted
time: 30ms
memory: 4696kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 14400 30000
233 129
228 221
18 89
77 107
168 125
238 219
32 150
132 46
34 193
222 27
83 167
206 177
15 146
210 218
187 128
25 75
195 39
105 56
156 233
79 124
220 215
164 183
194 68
211 52
62 142
207 1
14 189
8 61
95 33
144 154
136 160
4...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
115 284 76 158 92 14 157 9 202 49 8 166 24 294 34 111 94 140 126 47 255 185 221 2 114 70 20 258 6 19 129 136 181 190 135 96 228 177 102 38 214 192 201 128 184 194 53 98 72 101 178 138 156 326 208 119 95 173 80 253 165 193 52 207 81 175 6...

result:

ok correct

Subtask #4:

score: 0
Wrong Answer

Test #58:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
2 1 12000
1 0
0

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
0

result:

ok correct

Test #59:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
10 45 12000
4 8
0 5
2 0
5 8
8 0
3 8
6 4
4 1
2 3
2 1
6 2
1 7
3 7
8 1
7 0
8 6
0 6
9 5
9 6
7 4
7 6
7 9
1 6
3 5
2 5
7 5
3 9
0 3
3 6
2 9
1 5
0 4
7 8
5 4
9 4
5 6
3 1
2 8
7 2
2 4
1 0
9 8
4 3
1 9
9 0
22 41 3 16 7 25 28 11 39

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
28 7 16 39 22 41 25 3 11

result:

ok correct

Test #60:

score: 0
Accepted
time: 131ms
memory: 7856kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
400 79800 12000
32 64
96 254
115 203
7 171
112 81
124 143
336 175
217 328
152 133
124 331
19 91
92 232
152 43
215 169
4 341
363 18
83 99
52 46
248 66
242 187
150 319
335 158
172 150
3 49
126 256
60 153
165 230
265 68
119 380
171 22
35 169
3...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
55092 14982 69006 16485 69452 53691 7949 48824 27810 50859 61264 32787 11182 77316 68868 9357 16673 37938 25942 24203 43283 28336 32188 1778 32341 25286 58449 46268 37559 59851 904 52878 44646 64677 75263 34232 7231 70475 2784 12198 6032...

result:

ok correct

Test #61:

score: 0
Accepted
time: 211ms
memory: 10488kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
500 124750 12000
81 373
318 76
428 363
341 147
361 355
210 392
305 286
311 54
101 386
387 55
233 144
275 414
328 304
360 389
471 417
152 385
65 468
53 127
376 100
498 472
241 462
259 452
62 224
139 280
42 454
353 455
289 191
5 376
479 277
2...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
9032 112428 38833 66794 88752 35257 28997 43682 46424 67720 40390 84292 53666 29373 84388 4755 25803 95087 110000 92232 7917 93666 78052 24956 123115 45616 81724 119621 109927 1433 97319 124254 34750 122786 110969 67145 47107 9281 8264 4...

result:

ok correct

Test #62:

score: 0
Accepted
time: 219ms
memory: 10284kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
500 124750 12000
46 114
300 154
29 338
393 146
238 239
371 22
27 445
366 429
28 425
441 111
67 216
468 477
398 199
487 185
192 234
357 110
211 177
219 292
45 496
237 416
122 116
109 293
402 45
395 409
432 178
42 252
100 372
422 92
25 18
208...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
101278 19072 106165 22461 8407 106543 118366 6358 115292 46522 48870 17455 30254 50414 61119 35734 32847 95598 35458 52090 84450 53834 69632 41182 113403 57117 30007 62318 110578 76216 28955 111479 120730 89023 41945 122457 10397 109389 ...

result:

ok correct

Test #63:

score: 0
Accepted
time: 211ms
memory: 10260kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
500 124750 12000
404 346
493 279
394 299
249 306
24 180
417 182
364 271
410 73
228 494
51 38
405 400
485 130
356 167
221 77
358 274
308 338
497 16
345 14
247 53
146 212
312 362
350 202
8 128
311 328
78 265
422 38
463 36
340 378
333 151
270 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
5726 110757 77362 102175 30876 37928 118010 13405 86678 71304 119593 61540 25931 62579 77329 36548 103854 20932 106979 59244 7785 8578 94337 106241 75342 71752 71045 5095 20334 93996 36558 59827 99508 105444 117178 67066 13127 73168 9489...

result:

ok correct

Test #64:

score: 0
Accepted
time: 196ms
memory: 10280kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
500 124750 12000
12 99
447 205
312 178
469 8
28 268
348 87
211 422
458 494
193 363
447 246
82 18
438 459
345 263
128 467
439 44
140 225
453 5
260 9
12 323
407 387
113 130
376 413
109 398
65 99
407 254
150 427
132 256
425 432
40 368
172 375
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
7536 7118 87951 43371 42497 30779 15034 70913 8376 47017 3938 11981 8236 15569 20115 10067 98462 30654 33669 79657 62731 41657 47210 94337 50178 86955 113292 38611 39121 40274 84682 30243 44757 100834 17764 124356 36384 95393 49183 66256...

result:

ok correct

Test #65:

score: 0
Accepted
time: 214ms
memory: 10232kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
500 124750 12000
128 41
159 483
111 238
13 123
279 81
65 219
169 137
446 493
488 259
481 383
181 158
210 237
139 330
16 161
96 494
385 323
222 14
19 426
63 194
18 84
11 364
28 297
129 321
20 420
232 28
139 478
103 3
473 457
38 310
181 171
4...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
49357 88904 110757 114623 85719 89677 107110 6845 118691 30090 121060 58364 13390 52809 42935 32876 14001 6502 73217 33150 100936 1482 97011 45067 4015 76320 60882 63706 81843 75603 9458 102551 71228 2872 64419 18016 304 51120 22300 6521...

result:

ok correct

Test #66:

score: 0
Accepted
time: 217ms
memory: 10364kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
500 124750 12000
120 418
278 467
158 189
488 359
239 281
320 463
340 248
292 409
79 351
430 43
103 233
18 57
308 404
124 289
204 469
23 192
388 139
136 360
169 303
205 68
96 440
473 188
283 355
495 480
144 183
434 490
200 229
33 352
79 107
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
77491 12340 30382 106654 60506 15519 105224 54899 17237 34584 111184 13397 8822 22650 62660 5755 89941 31208 43216 60518 75510 7981 52125 13875 40739 89255 90010 13031 71752 30038 105088 29062 4690 32248 109389 99506 27148 86336 74181 93...

result:

ok correct

Test #67:

score: -19
Wrong Answer
time: 217ms
memory: 10196kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
500 124750 12000
65 32
62 261
436 43
345 82
407 452
322 309
132 296
272 140
63 267
165 194
0 183
401 446
71 87
303 253
265 230
82 250
193 60
234 381
67 164
476 92
10 487
207 25
421 359
421 374
84 292
430 318
151 440
76 420
129 23
127 24
106...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
WA
NO

result:

wrong answer WA in grader: NO

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%