QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#719402#4740. Plan metranathan4690100 ✓218ms116556kbC++173.0kb2024-11-07 00:40:312024-11-07 00:40:32

Judging History

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

  • [2024-11-07 00:40:32]
  • 评测
  • 测评结果:100
  • 用时:218ms
  • 内存:116556kb
  • [2024-11-07 00:40:31]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define el cout << '\n'
#define f1(i,n) for(int i=1;i<=n;i++)
#define __file_name ""
using namespace std;
const ll maxn = 2e6+5, inf=1e18;

struct Edge{
    int u, v, w;
    Edge(){};
    Edge(int u, int v, int w): u(u), v(v), w(w){};
};

int n,d[maxn], l[maxn];
vector<int> mp[2*maxn], allv;
vector<Edge> ans;

bool cmp(int x, int y){
    return d[x] < d[y];
}

bool solve(int duv){
    for(int item: allv){
        mp[item + maxn].clear();
    }
    allv.clear();
    ans.clear();
    for(int i=2;i<n;i++){
        int diff = d[i] - l[i];
        if(mp[diff + maxn].empty()) allv.push_back(diff);
        mp[diff + maxn].push_back(i);
    }
//    int duv = 1e9;
//    for(int i=2;i<n;i++) duv = min(duv, d[i] + l[i]);
//    if(abs(*allv.begin()) == abs(*allv.rbegin()) && allv.size() <= 2) duv = abs(*allv.begin());
    if(mp[duv+maxn].empty()) allv.push_back(duv);
    if(mp[-duv+maxn].empty()) allv.push_back(-duv);
    mp[-duv+maxn].push_back(1); l[1] = duv;
    mp[duv+maxn].push_back(n); d[n] = duv;
    int rem2 = allv[0] & 1;
    for(int item: allv) {
        if((item & 1) != rem2) return false;
        sort(mp[item + maxn].begin(), mp[item + maxn].end(), cmp);
    }
    sort(allv.begin(), allv.end());
    int pre = 1, dst = 0;
    for(int item: allv){
        int u = mp[item + maxn][0];
//        cout << item << ' ' << u << ' ' << d[u] << ' ' << dst << endl;
//        for(Edge e: ans){
//            cout << e.u << ' ' << e.v << ' ' << e.w << '\n';
//        }
        if(u > 1){
            if(dst >= d[u]) return false;
            ans.push_back(Edge(pre, u, d[u] - dst));
            dst = d[u];
            if(duv - dst != l[u]) return false;
            pre = u;
        }
        if(dst > duv) return false;
        // int dst2 = dst;
        for(int i=1;i<mp[item+maxn].size();i++){
            int v = mp[item+maxn][i];
            if(d[v] <= dst) return false;
            ans.push_back(Edge(u, v, d[v] - dst));
            if(duv - dst + (d[v] - dst) != l[v]) return false;
        }
    }
    cout << "TAK\n";
    for(Edge e: ans){
        cout << e.u << ' ' << e.v << ' ' << e.w << '\n';
    }
    return true;
}

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    if(fopen(__file_name ".inp", "r")){
        freopen(__file_name ".inp","r",stdin);
        freopen(__file_name ".out","w",stdout);
    }
    // code here
    cin >> n;
    if(n == 2){
        cout << "TAK\n1 2 1\n";
        return 0;
    }
    for(int i=2;i<n;i++) cin >> d[i];
    for(int i=2;i<n;i++) cin >> l[i];
    for(int i=2;i<n;i++){
        int diff = d[i] - l[i];
        if(mp[diff + maxn].empty()) allv.push_back(diff);
        mp[diff + maxn].push_back(i);
    }
    sort(allv.begin(), allv.end());
    int duv = 1e9, duv2 = 1;
    for(int i=2;i<n;i++) duv = min(duv, d[i] + l[i]);
    duv2 = abs(*allv.begin());
    if(solve(duv)) return 0;
    if(solve(duv2)) return 0;
    cout << "NIE\n";
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 7ms
memory: 100432kb

input:

7
6 6 2 2 1
5 3 5 1 4

output:

TAK
1 6 1
1 4 2
1 5 2
5 2 4
5 7 1
7 3 3

result:

ok good solution

Test #2:

score: 11
Accepted
time: 6ms
memory: 100648kb

input:

10
31 89 20 19 19 20 19 164
70 88 20 20 20 19 20 125

output:

NIE

result:

ok no solution

Test #3:

score: 11
Accepted
time: 4ms
memory: 100580kb

input:

10
57 106 79 12 139 103 103 85
110 53 28 65 98 86 50 117

output:

NIE

result:

ok no solution

Test #4:

score: 11
Accepted
time: 12ms
memory: 100284kb

input:

10
13 62 24 125 13 15 54 94
1 76 14 113 1 1 68 82

output:

NIE

result:

ok no solution

Test #5:

score: 11
Accepted
time: 7ms
memory: 101196kb

input:

10
123 146 139 5 192 80 77 118
97 172 165 31 166 106 51 92

output:

TAK
1 5 5
1 7 80
1 4 139
1 3 146
1 10 26
10 8 51
10 9 92
10 2 97
10 6 166

result:

ok good solution

Test #6:

score: 11
Accepted
time: 14ms
memory: 99808kb

input:

10
112 67 152 16 6 28 1 8
111 82 137 31 21 41 14 7

output:

TAK
1 6 6
1 5 16
1 3 67
1 8 1
8 7 27
8 9 7
9 2 104
9 10 7
10 4 137

result:

ok good solution

Test #7:

score: 11
Accepted
time: 4ms
memory: 101204kb

input:

10
83 108 180 120 114 50 79 132
15 176 112 188 182 118 11 64

output:

TAK
1 7 50
1 3 108
1 6 114
1 5 120
1 10 68
10 8 11
10 2 15
10 9 64
10 4 112

result:

ok good solution

Test #8:

score: 11
Accepted
time: 11ms
memory: 99596kb

input:

10
65 149 150 119 51 90 64 172
66 150 151 120 52 91 65 173

output:

TAK
1 6 51
6 8 13
6 2 14
6 7 39
6 5 68
6 3 98
6 4 99
6 9 121
6 10 52

result:

ok good solution

Test #9:

score: 11
Accepted
time: 13ms
memory: 97372kb

input:

2



output:

TAK
1 2 1

result:

ok good solution

Test #10:

score: 11
Accepted
time: 7ms
memory: 101204kb

input:

10
46 145 46 19 165 20 145 99
47 146 47 112 76 112 146 6

output:

NIE

result:

ok no solution

Test #11:

score: 11
Accepted
time: 14ms
memory: 100228kb

input:

10
4 3 4 150 114 86 99 86
2 3 2 155 118 80 105 80

output:

NIE

result:

ok no solution

Test #12:

score: 11
Accepted
time: 16ms
memory: 101304kb

input:

10
6 7 12 168 171 12 7 7
6 5 14 180 159 14 6 5

output:

NIE

result:

ok no solution

Test #13:

score: 11
Accepted
time: 7ms
memory: 100852kb

input:

10
13 170 28 134 10 117 117 90
98 85 113 49 95 32 32 5

output:

TAK
1 6 10
1 2 13
1 4 28
1 10 85
10 9 5
10 7 32
10 8 32
10 5 49
10 3 85

result:

ok good solution

Test #14:

score: 11
Accepted
time: 10ms
memory: 101264kb

input:

10
90 2 53 53 158 58 1 114
89 1 54 54 161 59 2 111

output:

TAK
1 6 158
1 8 1
8 4 52
8 5 52
8 7 57
8 3 1
3 2 88
3 10 1
10 9 111

result:

ok good solution

Test #15:

score: 11
Accepted
time: 8ms
memory: 100144kb

input:

10
47 2 198 181 29 192 192 2
187 142 58 41 169 52 52 142

output:

TAK
1 3 2
1 9 2
1 6 29
1 2 47
1 10 140
10 5 41
10 7 52
10 8 52
10 4 58

result:

ok good solution

Test #16:

score: 11
Accepted
time: 3ms
memory: 101288kb

input:

10
78 128 140 162 140 110 191 70
79 129 141 163 141 111 192 71

output:

TAK
1 9 70
9 2 8
9 7 40
9 3 58
9 4 70
9 6 70
9 5 92
9 8 121
9 10 71

result:

ok good solution

Test #17:

score: 11
Accepted
time: 11ms
memory: 100276kb

input:

3
1
2

output:

TAK
1 2 1
2 3 2

result:

ok good solution

Subtask #2:

score: 22
Accepted

Dependency #1:

100%
Accepted

Test #18:

score: 22
Accepted
time: 4ms
memory: 100860kb

input:

1000
998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925...

output:

TAK
1 999 1
999 998 1
998 997 1
997 996 1
996 995 1
995 994 1
994 993 1
993 992 1
992 991 1
991 990 1
990 989 1
989 988 1
988 987 1
987 986 1
986 985 1
985 984 1
984 983 1
983 982 1
982 981 1
981 980 1
980 979 1
979 978 1
978 977 1
977 976 1
976 975 1
975 974 1
974 973 1
973 972 1
972 971 1
971 970 ...

result:

ok good solution

Test #19:

score: 22
Accepted
time: 11ms
memory: 103128kb

input:

1000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

TAK
1 2 1
2 3 1
2 4 2
2 5 3
2 6 4
2 7 5
2 8 6
2 9 7
2 10 8
2 11 9
2 12 10
2 13 11
2 14 12
2 15 13
2 16 14
2 17 15
2 18 16
2 19 17
2 20 18
2 21 19
2 22 20
2 23 21
2 24 22
2 25 23
2 26 24
2 27 25
2 28 26
2 29 27
2 30 28
2 31 29
2 32 30
2 33 31
2 34 32
2 35 33
2 36 34
2 37 35
2 38 36
2 39 37
2 40 38
2 ...

result:

ok good solution

Test #20:

score: 22
Accepted
time: 4ms
memory: 101188kb

input:

3000
3246 3738 4685 1539 2140 2026 4814 4815 2059 2686 4692 4403 2701 1596 4878 2470 3194 2272 2171 4120 2654 3349 1842 2046 4360 4529 4792 3250 1741 4766 4337 1559 1601 2362 2295 4463 4987 4119 3847 2272 1522 2882 4556 2484 2864 3002 1446 1772 3089 3092 2562 1461 3630 1879 1899 4881 2334 3189 1794 ...

output:

NIE

result:

ok no solution

Test #21:

score: 22
Accepted
time: 11ms
memory: 99580kb

input:

3000
4130 2457 3399 3125 2758 4911 615 1200 3017 4249 4344 2200 4005 876 4946 976 3067 2029 2158 2667 4183 1380 40 919 3377 2618 3007 1818 1033 227 4422 2971 3208 893 3079 1691 663 4139 2833 1218 4741 2450 789 4493 971 3215 4274 3039 2060 3742 2302 1506 4156 607 773 3151 2661 3913 4082 2956 4454 192...

output:

NIE

result:

ok no solution

Test #22:

score: 22
Accepted
time: 7ms
memory: 99656kb

input:

3000
954 3442 341 795 3138 3391 4895 1174 3801 2933 3695 3388 1743 2942 1572 1029 2173 1438 2270 724 4007 896 2465 4667 3054 249 246 4977 3675 2669 3911 339 2771 984 3399 1237 349 3190 1834 3114 4549 3675 4487 1586 881 2723 677 1290 2979 2710 4746 2994 2524 682 3646 2776 317 4457 2636 2524 3278 465 ...

output:

NIE

result:

ok no solution

Test #23:

score: 22
Accepted
time: 7ms
memory: 101032kb

input:

3000
1236 2492 766 600 2029 4796 1025 4509 3655 4410 1132 3591 2190 3687 3393 1965 4342 3081 4140 2178 476 425 3368 2239 3481 245 548 4122 2637 4282 2385 606 2502 1565 1925 1754 2384 4313 3465 1490 2259 4430 1678 1632 1938 2513 3731 1713 3283 3289 3403 1979 1846 668 2635 3797 4226 4092 614 2677 1977...

output:

TAK
1 1265 2
1 200 3
1 1737 4
1 2550 5
1 834 6
1 299 7
1 1328 8
1 1856 10
1 1747 15
1 2087 16
1 2862 17
1 1309 18
1 2362 19
1 1624 26
1 2307 27
1 1324 29
1 1190 30
1 2645 32
1 626 36
1 2007 39
1 994 42
1 612 46
1 580 48
1 1401 49
1 2418 50
1 2864 51
1 2723 52
1 2573 59
1 2966 60
1 526 64
1 2988 65
1...

result:

ok good solution

Test #24:

score: 22
Accepted
time: 7ms
memory: 101120kb

input:

3000
2567 1720 478 391 3422 4790 4949 2339 4239 919 1382 3856 4907 3545 4073 2037 3854 4075 2618 1578 2198 1964 2263 3825 2860 3242 2777 3795 2069 1280 1188 645 2323 4900 4781 4018 4425 4246 4049 2145 2096 1017 3644 3069 3423 3773 3587 4999 4324 1368 677 803 2346 4166 2428 4842 3374 2423 4618 2514 3...

output:

TAK
1 2559 5
1 2742 37
1 2133 97
1 1717 260
1 143 263
1 939 363
1 2756 381
1 2417 390
1 873 414
1 1728 532
1 1993 622
1 1801 669
1 1279 689
1 1905 751
1 457 766
1 53 803
1 168 837
1 2190 842
1 1235 881
1 1844 887
1 2476 972
1 1746 975
1 1433 999
1 819 1008
1 2615 1023
1 1794 1058
1 2317 1132
1 571 1...

result:

ok good solution

Test #25:

score: 22
Accepted
time: 22ms
memory: 100332kb

input:

3000
4989 4334 179 1994 2064 2545 1064 4694 1823 4758 688 3273 875 708 2573 451 2326 4205 4815 1534 3459 2928 3565 3638 1987 4345 1414 4035 2531 1228 1589 3596 4318 3415 4512 2953 2003 2151 1650 4365 1935 4182 1154 1660 1760 1644 2423 1301 3310 2072 3024 1718 4061 1106 2165 4436 2082 1667 3732 260 3...

output:

TAK
1 304 1
304 959 1
304 2292 6
304 2603 14
304 1611 15
304 936 16
304 2710 18
304 2092 19
304 650 20
304 2459 23
304 1790 25
304 1446 26
304 1154 34
304 1407 42
304 1854 50
304 2769 52
304 2471 53
304 2959 73
304 2432 79
304 2500 83
304 2287 86
304 838 87
304 699 89
304 740 95
304 1467 96
304 906 ...

result:

ok good solution

Test #26:

score: 22
Accepted
time: 11ms
memory: 100944kb

input:

3000
1352 2311 3356 3752 3704 2206 3802 2718 1693 3838 2439 1539 2157 2532 3342 2895 2380 1628 3603 3822 1283 4277 3128 4180 2361 3794 3853 4837 3991 4926 2307 4054 3399 3864 1265 2472 4890 1604 1800 4204 4133 4192 4630 3934 4785 3913 1573 4835 2828 3636 2702 2551 4335 2662 4159 2147 3808 3148 3371 ...

output:

TAK
1 2681 1260
2681 1296 9
2681 264 10
2681 1165 13
2681 686 37
2681 1349 46
2681 1744 57
2681 552 60
2681 2011 70
2681 1618 89
2681 2783 103
2681 748 107
2681 101 135
2681 254 167
2681 1917 168
2681 2616 194
2681 1872 204
2681 2116 215
2681 2818 218
2681 564 220
2681 1376 224
2681 2781 229
2681 22...

result:

ok good solution

Test #27:

score: 22
Accepted
time: 10ms
memory: 100088kb

input:

3000
3097 3903 4418 1796 1042 4657 1430 2005 2767 3209 4552 1943 4809 4841 1355 4449 1330 1489 4339 886 749 4199 4558 4731 4947 601 3155 2695 3142 962 3101 2429 737 1891 3333 4856 3247 2016 2097 2504 4465 4420 2036 3511 1433 3773 1896 4490 2307 1489 2123 4623 2931 840 2268 3805 1984 2726 1790 1120 4...

output:

NIE

result:

ok no solution

Test #28:

score: 22
Accepted
time: 11ms
memory: 100716kb

input:

3000
886 2441 1532 1519 993 2071 1533 706 3290 3577 2399 3107 1818 2494 4684 3579 1157 3779 2708 1157 2737 1792 967 3015 2289 2691 4486 2122 2800 2027 3277 4540 3785 1152 4885 2099 1008 2799 3230 1610 3568 4055 2860 1931 1482 4322 3415 3720 3930 3986 2518 1314 1596 1392 469 3657 1438 4159 2898 2654 ...

output:

NIE

result:

ok no solution

Test #29:

score: 22
Accepted
time: 15ms
memory: 99624kb

input:

3000
2696 919 556 3002 1270 4174 2500 353 1352 3944 635 3440 4641 1575 4667 3561 3900 3147 1359 3273 938 829 900 2902 83 1087 302 1109 1910 4061 966 2803 4023 3639 2809 1303 1344 3385 2796 1538 1498 4548 1707 1888 3827 69 2512 557 610 3502 3360 1799 4427 669 3527 2313 4578 4303 2867 1200 1568 488 28...

output:

NIE

result:

ok no solution

Test #30:

score: 22
Accepted
time: 11ms
memory: 101560kb

input:

3000
2853 4599 4265 4267 2411 1064 1784 2058 1150 2720 2494 4060 1681 2671 3694 2359 2568 717 3405 1 1969 791 2362 2547 386 1547 2175 650 3372 4654 2080 2451 2143 397 3823 339 1073 3915 1218 905 3584 1340 901 681 240 2919 2433 4199 4842 2488 3026 724 3660 1325 265 4696 2023 4322 4057 2231 2640 4469 ...

output:

TAK
1 21 1
21 856 3
21 620 4
21 2601 7
21 156 8
21 2125 9
21 525 10
21 1563 12
21 1344 16
21 995 23
21 2163 25
21 1804 27
21 2887 29
21 1865 30
21 739 32
21 101 35
21 1423 36
21 2377 37
21 199 38
21 1736 41
21 2129 42
21 2584 45
21 1652 48
21 2204 49
21 1691 50
21 532 54
21 2484 55
21 2303 56
21 268...

result:

ok good solution

Test #31:

score: 22
Accepted
time: 7ms
memory: 99788kb

input:

3000
2218 4876 1974 1767 390 3598 1346 2423 981 4265 1477 3160 1900 2063 4806 624 2391 4129 1166 3586 3094 1018 1384 2665 3668 2680 3722 3123 4195 3774 3897 1755 4422 1528 3473 3656 2016 992 4424 582 1797 1852 4493 3604 2722 1591 2900 2124 1375 4122 284 3011 4290 3482 4840 1712 2916 684 1624 1356 47...

output:

TAK
1 2526 7
1 1021 15
1 1700 34
1 2891 54
1 727 57
1 368 62
1 597 71
1 2974 95
1 2114 125
1 456 133
1 1114 134
1 2256 154
1 478 177
1 1719 200
1 2779 207
1 2634 238
1 2555 264
1 535 279
1 1546 287
1 1005 292
1 1237 308
1 284 363
1 2485 416
1 2839 465
1 2785 501
1 67 522
1 1142 531
1 254 559
1 2733 ...

result:

ok good solution

Test #32:

score: 22
Accepted
time: 11ms
memory: 100380kb

input:

3000
1091 3360 3940 2706 3309 1955 1031 4529 3713 3820 3280 1916 952 4104 262 4281 3753 3446 1426 3135 3016 50 4491 3646 1717 3391 3677 2804 3046 3658 342 4348 4900 3701 1141 4942 907 4024 1412 1922 2071 4306 3746 1073 2301 517 2824 3500 1580 105 2728 3224 4806 3607 4640 3007 4097 3525 2260 28 74 13...

output:

TAK
1 483 1
483 1362 1
483 1936 3
483 2086 5
483 2594 7
483 1611 8
483 1983 11
483 476 13
483 2042 15
483 2548 18
483 1082 20
483 2241 21
483 2308 22
483 408 23
483 2407 25
483 2157 26
483 61 27
483 2692 29
483 2177 30
483 2679 34
483 1737 36
483 2717 37
483 236 41
483 397 42
483 222 44
483 525 45
4...

result:

ok good solution

Test #33:

score: 22
Accepted
time: 16ms
memory: 99892kb

input:

3000
3066 4794 1434 2322 1630 2913 1767 2035 4692 1441 3958 1787 2971 4301 3880 2889 3648 3292 3412 3012 2637 3888 4310 4986 4854 1983 2463 3127 4270 4277 3117 4782 4979 4226 3572 2153 4973 4226 2459 2092 4055 4711 1362 4527 1967 4794 1576 4563 3917 3941 2122 2808 1769 2958 4199 1431 4698 4117 4978 ...

output:

TAK
1 1445 1270
1445 1558 35
1445 2254 40
1445 2218 289
1445 1023 379
1445 2087 898
1445 1748 1613
1445 1679 1849
1445 2182 1926
1445 823 2505
1445 2993 2683
1445 848 2937
1445 1104 3083
1445 757 3387
1445 1041 3675
1445 2733 1
2733 1472 86
2733 2884 118
2733 2703 260
2733 2347 289
2733 2089 295
273...

result:

ok good solution

Test #34:

score: 22
Accepted
time: 15ms
memory: 101028kb

input:

3000
3007 4339 2713 1682 3269 896 4912 1719 4017 2821 4716 4834 3914 2774 4564 1041 3359 1294 2362 3216 811 4452 4433 4144 1481 1748 3833 1420 1847 1424 1051 2678 2486 2506 2275 2397 3745 612 2430 3651 2980 3630 2386 3229 4982 3356 4081 4489 2604 4456 3572 1906 2670 3437 4940 2119 4182 4332 2324 368...

output:

NIE

result:

ok no solution

Test #35:

score: 22
Accepted
time: 11ms
memory: 99792kb

input:

3000
2113 2877 3332 1103 4221 1402 4988 3090 4447 3216 1214 2798 955 3564 3217 1640 3071 535 3509 1280 2014 2438 4628 1313 4929 3109 2404 4673 3314 1876 2131 4980 1943 2809 3748 3561 3790 1597 1120 2025 2927 2952 3810 1676 2214 3217 2319 1247 4407 2023 3757 1276 983 3849 2859 4187 2397 1631 1041 341...

output:

NIE

result:

ok no solution

Test #36:

score: 22
Accepted
time: 7ms
memory: 100888kb

input:

3000
1941 4646 2168 786 3079 4598 455 2861 4243 3087 3829 1626 2823 2402 4194 1680 3570 2198 1509 269 4882 99 3402 90 847 4219 3347 1955 757 88 134 2186 363 683 4604 1303 4488 2916 4352 551 2002 2107 4420 4418 4068 4754 3143 449 2727 2952 2414 3510 2293 2404 1223 1883 2098 2705 2223 3573 1742 4892 8...

output:

NIE

result:

ok no solution

Test #37:

score: 22
Accepted
time: 19ms
memory: 100888kb

input:

3000
4823 3370 3546 689 4392 2253 1309 1492 3406 3625 1540 1996 4594 1050 1342 2511 1137 1314 3871 693 1583 4453 2136 4567 2421 3968 956 4538 2083 534 537 1435 4836 3214 4443 607 3882 2646 171 1212 3325 4061 4967 4678 1267 3035 542 748 1552 8 851 2456 1224 210 2791 3160 257 4498 2664 2658 1450 3532 ...

output:

TAK
1 941 1
1 126 5
1 51 8
1 392 13
1 119 14
1 275 16
1 1254 29
1 2461 30
1 2162 34
1 1363 35
1 2440 36
1 2262 37
1 2763 43
1 450 44
1 2259 47
1 2210 49
1 878 52
1 67 59
1 2087 60
1 1165 63
1 1737 65
1 241 67
1 2229 68
1 732 73
1 495 77
1 640 80
1 2242 82
1 78 83
1 846 85
1 1671 86
1 1436 88
1 1433 ...

result:

ok good solution

Test #38:

score: 22
Accepted
time: 21ms
memory: 101456kb

input:

3000
3332 756 2055 1288 1561 1514 2953 536 3784 2353 423 4776 2334 2892 2112 1377 4588 1432 999 3987 3063 1186 945 696 1028 1459 3404 147 4055 467 721 3838 2162 793 3748 3218 1458 2074 3532 2710 768 452 2784 1080 4603 953 1112 4307 2720 1891 2228 726 2429 1093 1606 2130 4564 1780 2546 1829 1373 1104...

output:

TAK
1 1111 7
1 1724 17
1 2729 18
1 1741 26
1 1520 29
1 1259 36
1 565 48
1 2556 81
1 269 87
1 2125 103
1 1729 131
1 2985 141
1 1629 143
1 29 147
1 1117 152
1 2761 157
1 2284 159
1 2285 172
1 827 173
1 87 177
1 2553 182
1 517 184
1 1809 197
1 703 202
1 883 207
1 2260 210
1 914 216
1 2689 237
1 2304 23...

result:

ok good solution

Test #39:

score: 22
Accepted
time: 19ms
memory: 101056kb

input:

3000
610 1799 1393 878 3099 1418 555 4169 1562 4823 4392 1525 2214 4168 975 4890 2034 1330 1266 946 2075 307 1229 2186 2106 473 3813 1702 309 1364 1328 956 906 2762 2254 4157 1434 2144 4442 3727 645 231 1985 4331 1625 544 602 1530 820 2125 909 1635 331 2216 1040 2794 1910 1764 4207 37 4032 4231 3354...

output:

TAK
1 2586 1
1 531 2
1 2498 3
1 2738 4
1 2315 6
1 2136 7
1 2777 8
1 922 9
1 2984 10
1 2424 11
1 2282 12
1 1103 13
1 430 14
1 2760 15
1 890 16
1 623 17
1 2702 18
1 2068 19
1 2431 20
1 852 21
1 127 22
1 258 23
1 345 24
1 1482 25
1 2639 26
1 1875 29
1 1904 30
1 2875 31
1 1107 32
1 770 33
1 2493 34
1 71...

result:

ok good solution

Test #40:

score: 22
Accepted
time: 7ms
memory: 100712kb

input:

3000
4392 2140 1762 1461 3944 3373 4608 2697 4508 3925 2016 1302 1448 1844 3854 4939 4992 2464 2034 3218 2114 1842 4347 3542 2030 4337 4016 3264 3751 1853 4686 1828 4083 4348 2692 4589 4107 3632 3108 2720 3526 3300 2029 3304 4522 1722 3600 4343 2664 3156 4156 1738 2972 3083 2460 2676 4999 1868 4196 ...

output:

TAK
1 1220 1270
1220 1089 3
1220 1168 7
1220 1443 11
1220 2153 12
1220 1480 43
1220 184 74
1220 1033 75
1220 111 92
1220 2415 133
1220 440 170
1220 1410 181
1220 2579 199
1220 936 208
1220 91 216
1220 541 220
1220 1183 222
1220 1956 235
1220 1907 248
1220 1555 267
1220 703 277
1220 2434 289
1220 281...

result:

ok good solution

Test #41:

score: 22
Accepted
time: 7ms
memory: 100716kb

input:

3000
3776 3020 74 3836 4635 2332 3602 1143 1563 561 2317 1552 3531 1627 1560 3621 4104 4827 4065 1455 1113 4256 3436 107 3547 4420 1826 3772 4563 3927 4787 2141 3872 2726 607 2231 741 1769 4393 1596 2722 3962 3138 2631 4816 2958 4416 1539 1622 4220 1251 4873 4258 1589 3411 3298 2222 3702 1461 899 62...

output:

NIE

result:

ok no solution

Test #42:

score: 22
Accepted
time: 7ms
memory: 100316kb

input:

3000
3417 1286 2330 2910 1263 1904 2737 441 2043 2538 2191 3631 735 4281 1323 23 2407 2205 2405 2006 1822 2649 2622 526 1686 404 2569 3775 1194 3323 3357 2468 2466 374 1775 2699 1300 4548 2725 2306 4895 3011 4969 3321 1057 1716 3863 3360 3212 1994 4246 1212 644 3247 1964 962 2590 2942 818 2489 4223 ...

output:

NIE

result:

ok no solution

Test #43:

score: 22
Accepted
time: 12ms
memory: 101412kb

input:

3000
2126 1360 2131 843 4339 3597 4621 4533 4809 1878 4303 4777 2153 263 4424 1155 3541 1201 902 718 1277 2918 3751 2585 706 507 3311 4920 1164 1080 3461 4868 970 1274 625 3964 511 2880 2594 4673 3685 4602 510 1459 4702 1565 94 3545 255 3943 591 327 18 4823 1373 4165 1833 4489 1202 717 2532 4699 142...

output:

NIE

result:

ok no solution

Test #44:

score: 22
Accepted
time: 7ms
memory: 99736kb

input:

3000
1149 3550 1728 2850 1560 200 3630 4848 2568 1394 3044 2947 2576 589 2523 4333 3635 1043 3508 580 2380 2902 4838 4531 1484 4328 654 4418 2761 506 1862 498 2891 4653 2062 4698 4399 1389 1167 62 2304 329 1904 1142 2031 3770 3005 4208 668 453 468 2324 1741 823 3262 4403 1424 2565 4335 2592 3324 802...

output:

TAK
1 1019 9
1 1948 18
1 2208 25
1 969 25
1 1771 25
1 779 30
1 1260 41
1 2137 41
1 272 48
1 2830 54
1 2648 54
1 452 54
1 340 58
1 2357 58
1 1197 63
1 2620 68
1 891 68
1 322 68
1 77 86
1 2867 99
1 2025 106
1 796 106
1 1704 108
1 1527 115
1 1404 119
1 465 119
1 2828 119
1 2116 119
1 1617 119
1 2287 12...

result:

ok good solution

Test #45:

score: 22
Accepted
time: 14ms
memory: 100128kb

input:

3000
1635 282 203 1698 4542 4581 66 4702 4313 1436 2957 1820 4475 3991 1646 864 1367 4202 2545 1317 2712 1529 1371 370 1656 1932 654 3311 372 3257 844 4365 2111 2359 1379 405 3050 2395 29 3467 3429 3417 554 2911 2615 3735 2696 4529 2573 4394 3925 3605 3212 2655 469 1981 465 1141 1791 2303 4758 333 1...

output:

TAK
1 2708 60
1 474 64
1 2985 107
1 163 142
1 2391 155
1 1697 170
1 4 203
1 1558 214
1 1704 215
1 2779 216
1 2421 221
1 293 322
1 30 372
1 1884 374
1 2457 375
1 469 381
1 1346 403
1 1706 415
1 2107 435
1 328 445
1 724 463
1 407 465
1 635 473
1 1455 526
1 2901 565
1 920 579
1 532 601
1 2679 616
1 130...

result:

ok good solution

Test #46:

score: 22
Accepted
time: 7ms
memory: 101264kb

input:

3000
3095 3686 2303 4864 4525 4973 686 2608 2702 3043 1530 398 971 2975 249 3931 1914 2949 2100 1211 636 270 735 172 799 1903 4870 2863 504 1980 1613 2760 2753 96 3261 2262 2965 1590 3374 2417 618 1414 3734 2313 4838 855 3014 403 4064 405 2692 4503 4068 3962 255 2631 4061 2216 1937 2683 1290 590 545...

output:

TAK
1 2279 5
1 1048 8
1 2556 8
1 2846 9
1 513 11
1 1671 13
1 1138 15
1 348 17
1 874 18
1 916 19
1 1002 20
1 2233 21
1 599 22
1 1499 26
1 86 27
1 2908 31
1 574 35
1 1891 36
1 2903 37
1 2941 39
1 2770 40
1 1164 43
1 2724 44
1 1535 46
1 2217 46
1 1972 48
1 933 51
1 176 56
1 652 57
1 2736 59
1 957 63
1 ...

result:

ok good solution

Test #47:

score: 22
Accepted
time: 7ms
memory: 100056kb

input:

3000
3150 1836 3172 4068 4876 2943 3457 2989 2031 4298 3147 2187 3949 1874 3444 3509 3477 3857 4473 4688 4270 3254 2633 2539 2586 2095 4295 2717 2061 3175 2604 3459 3514 2929 4280 2896 4154 4187 4400 1897 4733 1450 2311 2971 4025 2366 3119 1779 1624 3743 2393 2767 4341 3316 1467 2982 3749 3553 3430 ...

output:

TAK
1 2891 1321
2891 1164 1
2891 1758 9
2891 2627 15
2891 1264 22
2891 306 32
2891 637 54
2891 443 69
2891 2646 76
2891 2970 103
2891 2846 116
2891 191 126
2891 865 127
2891 2097 137
2891 56 146
2891 2874 148
2891 2661 156
2891 1036 169
2891 238 176
2891 1196 181
2891 578 182
2891 616 196
2891 1110 ...

result:

ok good solution

Subtask #3:

score: 16
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #48:

score: 16
Accepted
time: 7ms
memory: 101344kb

input:

3000
33632 494127 696342 350424 494687 244029 34205 358600 33589 33688 33654 363547 917716 709668 34132 209516 647123 33932 459553 338587 344502 34173 33962 959639 186658 432587 751908 196121 831694 938534 375210 34215 33945 496720 944120 717068 359228 823700 795101 264198 894106 166421 878905 56096...

output:

NIE

result:

ok no solution

Test #49:

score: 16
Accepted
time: 18ms
memory: 101312kb

input:

3000
719501 190371 419469 530974 227226 585792 231123 604640 810638 945824 81162 234692 81417 470485 81514 904536 160555 81120 458883 833590 292427 298463 696428 991251 803836 290845 81271 164910 812817 311546 346303 182445 988478 81452 141870 399912 573781 113364 81366 707078 81447 579746 652421 74...

output:

NIE

result:

ok no solution

Test #50:

score: 16
Accepted
time: 7ms
memory: 100412kb

input:

3000
33367 117225 986863 489993 459134 848608 659883 682415 386653 418414 25671 596199 603604 686775 61167 861049 479739 998241 526134 349446 175511 428454 577920 180611 399767 519572 413504 675392 691762 456302 401104 641737 992570 216016 396301 671015 937784 490764 151444 958516 175964 611128 5533...

output:

NIE

result:

ok no solution

Test #51:

score: 16
Accepted
time: 12ms
memory: 99796kb

input:

3000
260266 727761 367878 933399 741131 526721 356038 469953 595663 297117 360534 710090 328255 86691 112505 523756 449413 409669 321665 538883 631287 870029 374437 621113 243200 488734 528312 245165 63888 469460 162819 286313 659751 375112 725042 852767 50740 335486 612512 698770 344877 461833 3401...

output:

TAK
1 244 1024
1 2572 1191
1 2206 2604
1 359 2631
1 1425 3247
1 474 4688
1 2829 5714
1 1696 6565
1 112 6574
1 2143 7441
1 809 8470
1 134 8918
1 922 9660
1 73 11198
1 767 11786
1 722 12647
1 1455 13110
1 1560 13232
1 2058 14743
1 2104 14777
1 1183 15617
1 1788 16407
1 2552 16780
1 181 17194
1 962 172...

result:

ok good solution

Test #52:

score: 16
Accepted
time: 7ms
memory: 101504kb

input:

3000
990602 644534 718130 852792 816707 576523 58111 482057 102335 439369 73379 670012 929674 479443 361759 70928 79563 613769 853718 167957 655511 263428 76069 534776 73859 214474 58816 163198 518911 871410 518783 482805 378241 481322 213457 58326 434589 506037 323789 931785 657187 697710 40451 325...

output:

TAK
1 2926 1700
1 1282 3606
1 654 4681
1 301 6593
1 2594 7075
1 512 8651
1 1609 10123
1 167 10301
1 2675 11012
1 1559 11712
1 1101 12425
1 949 13202
1 1300 14537
1 1102 15016
1 2912 16611
1 2403 17933
1 411 18358
1 2654 19329
1 2462 21592
1 1477 21882
1 2953 24681
1 2930 24835
1 2189 24907
1 2308 25...

result:

ok good solution

Test #53:

score: 16
Accepted
time: 8ms
memory: 99768kb

input:

3000
123371 312195 835995 149637 799487 170772 195292 648627 476326 803490 674499 244504 429531 806106 255448 371496 627676 780092 473422 303011 943356 44364 430413 893362 706897 367434 126526 297689 257900 841409 228421 592559 817799 53260 349853 208307 3859 708783 827617 707957 652158 62545 147155...

output:

TAK
1 997 322
1 2756 1211
1 1769 1823
1 490 2172
1 38 3859
1 1126 6023
1 1478 6280
1 686 6503
1 776 7225
1 1680 8118
1 2604 8214
1 976 8915
1 1827 8927
1 667 9597
1 200 9813
1 655 9878
1 2841 9968
1 228 10316
1 2610 10888
1 1387 10889
1 2386 11000
1 1211 11697
1 909 12507
1 1849 12821
1 1946 13015
1...

result:

ok good solution

Test #54:

score: 16
Accepted
time: 15ms
memory: 101388kb

input:

3000
704276 595819 568590 836740 981560 800902 584618 694682 933504 974612 414162 378635 951690 459865 651877 937255 771192 697635 745645 614206 558771 409173 874112 760798 801123 668957 436923 787718 511406 483169 378210 847039 812786 739322 999151 816301 783567 639619 903009 667105 988812 488588 4...

output:

TAK
1 1474 363709
1474 2028 1
2028 1820 437
2028 2000 2585
2028 2372 4314
2028 392 5990
2028 489 7659
2028 2652 10056
2028 1071 10500
2028 1985 12133
2028 2510 12932
2028 2718 13850
2028 1026 16602
2028 189 16826
2028 303 22732
2028 324 25922
2028 369 26573
2028 800 29383
2028 1193 29532
2028 2943 3...

result:

ok good solution

Test #55:

score: 16
Accepted
time: 11ms
memory: 99672kb

input:

3
1000000
1000000

output:

TAK
1 2 1000000
2 3 1000000

result:

ok good solution

Test #56:

score: 16
Accepted
time: 5ms
memory: 99624kb

input:

3000
27101 27983 193378 657093 26818 582247 27954 896701 26832 26964 27154 27378 897450 27446 28201 26712 27074 27462 26668 576438 27163 27578 27786 27207 728499 27651 648949 967139 27257 26891 28024 28232 27404 27067 476498 239642 27530 27823 27523 26797 26811 953213 405305 27636 293694 665456 3310...

output:

NIE

result:

ok no solution

Test #57:

score: 16
Accepted
time: 7ms
memory: 100660kb

input:

3000
537112 103838 832868 830790 677585 659891 740326 252361 686559 651870 326268 145324 136382 298958 219533 355420 245302 601455 417307 926830 602452 599847 648943 139897 531894 756503 978725 909009 409585 916592 517693 661310 221309 741779 837024 238513 929589 808890 512579 363468 498002 809345 8...

output:

NIE

result:

ok no solution

Test #58:

score: 16
Accepted
time: 15ms
memory: 100772kb

input:

3000
991921 585293 542720 18525 480227 709619 847291 105630 565857 799501 308455 491502 624191 767273 671319 421201 642691 106134 400479 63986 235649 212633 325475 235877 433366 426394 334065 642273 426190 41017 507218 348107 600047 423854 976051 447957 857087 461509 916016 580192 980835 955627 8198...

output:

NIE

result:

ok no solution

Test #59:

score: 16
Accepted
time: 11ms
memory: 100148kb

input:

3000
697884 570622 241819 900495 464741 78272 953627 926656 159040 748364 675506 244571 359302 431515 168816 131152 97687 385149 404339 468702 315173 293798 578602 493224 648731 217412 472269 43894 308667 407331 224954 941937 677131 692419 252121 283252 270771 531187 751486 446050 761826 795926 4426...

output:

TAK
1 2685 803
1 1284 1229
1 1608 1697
1 1459 4370
1 487 5600
1 1911 5967
1 1757 6092
1 2743 6250
1 1395 6857
1 2188 7148
1 1827 7418
1 541 7814
1 260 8273
1 83 8446
1 2977 9026
1 1660 9122
1 1394 11074
1 1918 11288
1 2044 11477
1 690 11876
1 1632 11975
1 2819 12606
1 1155 12640
1 2508 12944
1 2929 ...

result:

ok good solution

Test #60:

score: 16
Accepted
time: 11ms
memory: 100328kb

input:

3000
307838 358602 49735 302647 593319 117587 328601 987296 267770 907439 674952 832723 93519 201538 968152 876115 238734 867922 360015 411639 919148 378541 45812 216062 486655 345283 617897 951353 925030 562132 292774 128846 642902 71545 426038 21725 973771 581790 163196 449900 459681 8258 776928 3...

output:

TAK
1 704 5648
1 709 6242
1 2336 11959
1 2947 14868
1 1905 29657
1 1592 30802
1 2782 37468
1 1178 39478
1 2061 42457
1 1578 42897
1 1767 50521
1 430 55851
1 2706 81249
1 444 83862
1 1430 85062
1 2737 92328
1 617 92803
1 153 104000
1 500 119060
1 1723 120101
1 2725 125340
1 1485 192767
1 2689 201534
...

result:

ok good solution

Test #61:

score: 16
Accepted
time: 7ms
memory: 99860kb

input:

3000
166414 871840 137934 886504 196581 562439 801561 565428 728076 760260 181697 595415 283545 999940 62920 444518 822135 50733 749639 335008 839611 426682 735978 814746 313373 813828 938298 756292 801277 475252 748124 324149 475297 820802 903704 485954 224145 768084 29558 423821 956820 519682 3564...

output:

TAK
1 1071 889
1 1975 3187
1 2217 4359
1 993 6001
1 1895 6622
1 1210 6988
1 1416 7053
1 1059 7450
1 324 9557
1 1611 11598
1 1663 13758
1 189 13956
1 2041 15025
1 2892 15901
1 2304 16823
1 1778 19754
1 720 20370
1 396 21106
1 1739 21543
1 1499 22072
1 371 23915
1 1809 27841
1 2526 27868
1 40 29558
1 ...

result:

ok good solution

Test #62:

score: 16
Accepted
time: 13ms
memory: 101540kb

input:

3000
721450 597466 646554 601431 855464 782681 963513 875992 785906 383940 442776 879631 384499 969947 389826 637712 721693 811372 738039 683456 737871 467574 924234 535092 719108 861836 840676 723386 860907 850142 671514 882765 366681 851885 557551 846579 942567 647968 909603 704946 499304 429153 9...

output:

TAK
1 1162 285278
1162 1422 632
1162 2104 870
1162 2826 3856
1162 464 4584
1162 239 5027
1162 1679 5336
1162 2341 7014
1162 1627 7106
1162 2676 7151
1162 235 10559
1162 2818 18540
1162 2737 20223
1162 2702 21645
1162 1099 21674
1162 996 22924
1162 2569 23635
1162 170 25875
1162 817 27275
1162 264 30...

result:

ok good solution

Test #63:

score: 16
Accepted
time: 20ms
memory: 100084kb

input:

3000
473738 815133 745850 184285 575674 644352 378025 554473 184277 184293 445661 702130 925518 872029 619452 535894 483933 447368 376325 548345 240584 268543 888464 953777 376892 726063 641865 475367 721552 538018 633708 462743 390489 553370 382971 859037 733927 592313 495940 578653 724130 342469 7...

output:

NIE

result:

ok no solution

Test #64:

score: 16
Accepted
time: 7ms
memory: 100308kb

input:

3000
113146 205398 480860 411505 620634 358238 615045 403557 887039 201203 570311 176484 664526 991741 680592 405209 120459 88699 948415 173428 81742 388006 298591 513129 574518 808667 439161 227583 919128 519576 629930 672354 238459 226005 801315 814560 396280 998117 273814 935845 548366 846275 860...

output:

NIE

result:

ok no solution

Test #65:

score: 16
Accepted
time: 12ms
memory: 101348kb

input:

3000
892289 178934 632248 7584 672665 790021 713633 242070 512707 142322 847647 272840 990371 770894 651491 447478 295050 594637 739718 102518 908490 702008 745317 596945 526418 22343 560051 893064 299592 858019 630089 390792 82409 600030 672327 235410 264827 777043 148216 215347 157613 862174 13251...

output:

NIE

result:

ok no solution

Test #66:

score: 16
Accepted
time: 3ms
memory: 101432kb

input:

3000
85497 782516 440617 122737 498723 530740 618744 669858 803431 384680 924773 121723 471502 578003 48506 991262 618935 794554 550952 687780 280595 698132 795442 968818 416209 612154 964367 400849 581175 456465 805944 907680 680473 75523 935021 733692 141130 973798 91801 243824 421696 243208 48266...

output:

TAK
1 2679 133
1 1413 934
1 1573 942
1 2548 942
1 110 2290
1 255 2426
1 1334 2984
1 1574 3584
1 1064 3685
1 2872 3711
1 2937 3823
1 1650 4106
1 810 4848
1 118 5885
1 1043 6056
1 235 7065
1 606 9011
1 1028 9039
1 553 9067
1 2499 9461
1 2880 9545
1 2035 10968
1 972 11656
1 2218 12119
1 2424 13166
1 12...

result:

ok good solution

Test #67:

score: 16
Accepted
time: 4ms
memory: 101368kb

input:

3000
331569 320335 732683 330711 328048 151764 38202 8416 154487 413668 61405 711786 963841 783778 26951 201366 603171 68679 730606 400397 247463 767459 12777 987072 369773 797826 299662 60926 96047 764493 878790 877841 541952 88643 521699 525689 690768 826397 721998 347879 80796 324516 874650 10658...

output:

TAK
1 1333 7
1 2648 762
1 2365 1761
1 656 2227
1 2098 4334
1 678 4711
1 1523 4988
1 85 7804
1 155 7980
1 1328 8952
1 2159 11058
1 770 11058
1 537 12736
1 1247 13102
1 814 14418
1 1352 14771
1 468 15053
1 2374 15235
1 798 15235
1 1699 16312
1 1956 18152
1 1856 18152
1 2844 18181
1 1938 18447
1 787 20...

result:

ok good solution

Test #68:

score: 16
Accepted
time: 7ms
memory: 99784kb

input:

3000
548182 740314 631064 192542 164200 531146 106418 983122 974332 129868 698936 615288 777559 321404 253908 383134 523947 416670 308886 341321 476121 70281 718792 629602 28162 601366 451204 269989 545667 751947 826307 446280 527548 26727 398541 587717 635146 703519 624210 375574 130718 235403 7811...

output:

TAK
1 1404 1067
1 1261 1067
1 1174 1306
1 447 1654
1 65 1983
1 2365 2477
1 803 2477
1 1236 3015
1 2044 3261
1 2028 3312
1 2542 3312
1 325 3554
1 2865 4553
1 537 5444
1 2578 6174
1 676 6174
1 200 6577
1 2140 6691
1 1754 7650
1 1476 7947
1 908 8184
1 1265 8447
1 2697 9022
1 2034 9022
1 1626 9332
1 247...

result:

ok good solution

Test #69:

score: 16
Accepted
time: 11ms
memory: 99616kb

input:

3000
742646 897641 802380 899948 905956 639096 703135 757737 754345 317900 774107 395408 490989 658133 573512 889024 983515 324485 814191 348011 741582 831684 961240 712121 373360 959766 842411 363278 831111 988393 671162 457602 565366 451740 366471 601336 824537 693783 325012 376500 977593 819894 4...

output:

TAK
1 264 302278
264 1096 954
264 272 3466
264 1556 4276
264 2971 5221
264 1063 5636
264 2638 9818
264 2765 10141
264 987 11337
264 2277 18308
264 182 20385
264 2218 20566
264 2123 22486
264 40 22734
264 2479 26956
264 2589 27787
264 548 30954
264 1222 33734
264 1130 33881
264 579 36091
264 2157 423...

result:

ok good solution

Subtask #4:

score: 33
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #70:

score: 33
Accepted
time: 29ms
memory: 104472kb

input:

100000
881920 696247 189234 495545 188761 373014 199791 168987 191605 201736 907451 427051 356912 461898 536499 170776 378997 172047 774231 799185 996450 599835 288996 192846 371945 823647 983555 978285 739473 852317 198417 938871 181975 194608 485685 201973 167902 898743 186129 584228 407225 358850...

output:

NIE

result:

ok no solution

Test #71:

score: 33
Accepted
time: 33ms
memory: 101072kb

input:

100000
92316 769709 343358 629401 604167 293907 687931 521411 31820 186019 563967 339580 348256 388924 820250 418704 945127 257027 422694 655287 839717 728729 650694 279172 219655 828513 194351 322775 429687 722729 571860 153908 694417 792667 545406 206590 597060 269760 756100 200081 225850 733911 7...

output:

NIE

result:

ok no solution

Test #72:

score: 33
Accepted
time: 34ms
memory: 103040kb

input:

100000
801047 906028 898965 907497 29765 205398 956 961001 60261 828933 343075 88720 194743 781037 214480 56958 231138 209707 10462 957788 330213 119347 21804 81978 889203 335634 330146 348271 269644 21194 865382 145646 164454 90253 137428 147526 116217 209926 842296 88578 522181 714103 413389 55975...

output:

NIE

result:

ok no solution

Test #73:

score: 33
Accepted
time: 52ms
memory: 101764kb

input:

100000
832000 61235 836159 888831 751978 30532 906985 393271 747372 290700 828247 35630 500107 403962 832660 635064 900713 672614 478665 747849 303240 116923 478840 821191 191303 978515 906506 504491 456986 783479 866177 49871 216678 296084 672984 416638 396597 526234 670155 896511 242650 469235 706...

output:

TAK
1 92064 12
1 4847 14
1 46782 24
1 14727 47
1 29619 58
1 62798 65
1 80266 68
1 73169 79
1 71907 89
1 25264 102
1 46974 126
1 25868 133
1 30013 137
1 15234 143
1 46546 147
1 10215 174
1 61909 180
1 43801 188
1 32646 194
1 92164 198
1 66858 199
1 30581 215
1 39802 238
1 72530 243
1 38493 280
1 4867...

result:

ok good solution

Test #74:

score: 33
Accepted
time: 37ms
memory: 102860kb

input:

100000
497424 200926 306192 808523 780650 761288 444472 386647 386986 111702 204934 437555 627179 802522 783843 603654 667694 164210 928428 96783 647176 414133 540991 180319 343064 581954 210998 571259 393450 229631 653805 770122 698943 255225 498617 691034 691433 627830 490562 340785 963898 501292 ...

output:

TAK
1 35069 151
1 64667 999
1 55851 1136
1 93567 5420
1 34775 5711
1 85121 5808
1 88214 11667
1 90722 12283
1 46170 13855
1 27416 15343
1 12606 17328
1 50969 17343
1 91692 18213
1 57189 19481
1 62977 19879
1 66587 21982
1 42245 23900
1 48743 24762
1 11525 25841
1 51778 26024
1 31268 28020
1 26004 32...

result:

ok good solution

Test #75:

score: 33
Accepted
time: 49ms
memory: 102468kb

input:

100000
38358 80051 456892 958973 634985 543228 835442 623769 759626 737545 234556 262933 727320 311809 276468 566475 192897 133986 434342 732048 108552 500704 245970 190965 537649 501410 812789 969153 603058 240676 829629 915175 161887 363404 393857 105629 897674 954799 595138 869031 368757 442198 5...

output:

TAK
1 31031 9
1 46582 11
1 67576 47
1 19994 76
1 69646 91
1 3680 98
1 55524 105
1 64094 116
1 39010 126
1 54399 191
1 20623 215
1 14420 234
1 14860 269
1 35544 315
1 87901 366
1 40159 420
1 68788 455
1 78774 469
1 83721 505
1 89606 534
1 38466 574
1 20683 577
1 44141 580
1 47775 596
1 76064 605
1 83...

result:

ok good solution

Test #76:

score: 33
Accepted
time: 35ms
memory: 102760kb

input:

100000
544772 581716 319762 599570 300454 610539 585213 867092 632966 932399 517314 908630 655161 339749 623252 719621 670251 860668 288551 710376 641466 470892 547455 897267 802560 431504 764992 543148 334966 671391 659807 331392 987079 475226 375117 498842 680626 350924 648515 864473 973035 633529...

output:

TAK
1 36285 279223
36285 76703 35
36285 554 136
36285 44310 170
36285 2914 205
36285 85468 214
36285 39610 342
36285 85362 358
36285 85320 503
36285 22029 571
36285 25933 602
36285 43513 732
36285 86854 736
36285 16911 766
36285 777 833
36285 8009 840
36285 603 868
36285 89242 890
36285 45871 893
36...

result:

ok good solution

Test #77:

score: 33
Accepted
time: 27ms
memory: 102204kb

input:

100000
943207 631888 252370 853723 523395 980930 499842 957656 213050 304434 122801 616804 937076 970757 384438 479956 566854 693154 730501 333814 847245 473448 329449 435737 575981 225905 228724 55755 29374 476546 526379 573475 463255 794050 625341 26168 977556 533548 63902 106685 447864 955426 412...

output:

NIE

result:

ok no solution

Test #78:

score: 33
Accepted
time: 33ms
memory: 100456kb

input:

100000
59706 108540 766457 657085 887526 316507 491398 59417 771565 948950 897734 362811 700501 931450 619260 698875 27907 853461 654568 668640 772555 781571 774893 592341 551177 867606 938065 628835 739294 543460 575855 904114 96773 145944 426985 490933 406382 379476 864499 367739 911579 871908 789...

output:

NIE

result:

ok no solution

Test #79:

score: 33
Accepted
time: 50ms
memory: 102792kb

input:

100000
47714 8276 63332 527885 12456 6068 572343 9398 13814 36678 35854 10369 13502 21088 28756 864546 34006 27144 787368 11809 81928 202719 30259 87311 22735 69469 54137 50693 23687 31509 35521 87226 38620 27013 119653 63936 62204 11657 7279 60831 66682 60906 6869 489203 87558 79440 213105 15512 37...

output:

NIE

result:

ok no solution

Test #80:

score: 33
Accepted
time: 47ms
memory: 102668kb

input:

100000
876781 641890 384413 628571 640670 259317 588405 296365 274405 71868 180090 546858 451548 497740 581274 238969 909560 734373 697474 844767 312202 627140 732350 997088 164403 385854 847261 426776 167330 911479 735085 757842 193834 281666 823351 878483 448819 899953 570399 977354 528798 833240 ...

output:

TAK
1 59731 5
1 7604 8
1 46088 65
1 23005 93
1 68150 107
1 24656 118
1 48715 120
1 71708 188
1 80764 235
1 26336 274
1 2803 300
1 3492 321
1 82166 327
1 13280 335
1 10821 338
1 99745 341
1 14880 342
1 56057 363
1 42964 382
1 69933 385
1 36551 391
1 73609 404
1 58901 446
1 17171 450
1 49076 474
1 215...

result:

ok good solution

Test #81:

score: 33
Accepted
time: 42ms
memory: 105804kb

input:

100000
320373 40200 280459 32380 270139 693000 867666 39068 400045 37080 278231 862996 234160 474157 824822 8388 24002 557652 32310 595471 833064 377904 193849 39628 28162 217462 536435 225752 476204 16763 474307 19615 10045 19853 40033 694968 943060 22351 256063 130500 3937 907247 30141 708588 4112...

output:

TAK
1 59024 2867
1 45129 3616
1 20415 5120
1 14128 6686
1 30356 7056
1 38021 11807
1 28598 12358
1 30156 13773
1 67009 13788
1 80763 14368
1 62563 18811
1 11963 19035
1 25879 22107
1 31469 23911
1 23442 23963
1 30900 26329
1 62747 28000
1 10110 32815
1 79430 34557
1 47661 35970
1 17152 36551
1 65281...

result:

ok good solution

Test #82:

score: 33
Accepted
time: 48ms
memory: 105008kb

input:

100000
153532 600751 117607 385147 363219 488053 648298 703127 17249 849350 84958 186748 631851 543128 909553 246393 574998 137426 483994 545348 240217 403567 164161 940460 99675 402601 654474 580181 6870 428836 582630 480368 202641 513035 670944 903548 347710 828070 218148 127322 461176 857128 7166...

output:

TAK
1 70273 18
1 57353 34
1 53405 47
1 1596 67
1 80908 74
1 32349 96
1 4425 104
1 45349 117
1 77334 122
1 61173 128
1 12720 133
1 78121 138
1 9327 148
1 17639 162
1 62574 173
1 60827 175
1 29425 183
1 49117 185
1 88622 192
1 21032 197
1 723 225
1 749 249
1 31362 250
1 1434 255
1 93231 272
1 77024 27...

result:

ok good solution

Test #83:

score: 33
Accepted
time: 38ms
memory: 105184kb

input:

100000
316502 661922 955611 622710 266892 770339 772974 728221 297555 438150 900420 816111 392364 312034 481989 362330 395314 610075 569754 989254 621336 848306 844738 940446 890336 535754 353760 692999 956433 990528 853792 397527 716886 333841 664326 924698 419218 789651 327901 919801 607869 309898...

output:

TAK
1 67273 260851
67273 59877 31
67273 59847 58
67273 3919 81
67273 52502 294
67273 7983 309
67273 78392 320
67273 3210 501
67273 53040 529
67273 99506 577
67273 88993 767
67273 12872 792
67273 24780 856
67273 90692 896
67273 55826 964
67273 1705 1015
67273 64152 1036
67273 44024 1062
67273 3285 12...

result:

ok good solution

Test #84:

score: 33
Accepted
time: 32ms
memory: 102724kb

input:

100000
298602 719304 105586 172102 574769 460650 516757 870523 705426 213621 193183 436390 336140 52605 48860 748449 459323 42382 91191 832425 38444 48699 944592 824850 898189 5260 53022 716642 52685 50067 682689 523508 704101 130193 504616 595016 104728 430777 363401 775247 942694 725844 238965 229...

output:

NIE

result:

ok no solution

Test #85:

score: 33
Accepted
time: 32ms
memory: 102224kb

input:

100000
403756 308137 529594 685272 62734 679409 357669 80729 684657 831240 923837 497701 543363 389660 495162 323986 29235 727811 131272 825400 509363 375734 698919 393492 783510 149587 961437 619618 661530 510887 665163 962596 121089 920481 313373 783951 62911 389792 573173 429896 520120 835343 748...

output:

NIE

result:

ok no solution

Test #86:

score: 33
Accepted
time: 25ms
memory: 101176kb

input:

100000
327349 194575 153828 344691 711077 421821 801523 867896 943362 44779 505482 832589 708403 419293 851178 291526 400665 330708 6603 255666 280729 339468 8871 363034 629268 111756 901694 106072 449842 238150 465220 965540 328681 882466 224349 589448 832116 894618 446345 868334 483818 503408 7609...

output:

NIE

result:

ok no solution

Test #87:

score: 33
Accepted
time: 71ms
memory: 101960kb

input:

100000
424914 158335 666838 989418 209066 383655 696133 210217 198707 714909 882796 794668 134518 208121 930674 135888 88810 708747 659186 79163 81714 98539 661251 751645 527084 168180 130405 391329 76816 295439 244316 593018 298477 676438 341814 966564 864623 865714 490644 307446 295395 120930 1460...

output:

TAK
1 77949 32
1 65489 62
1 14483 73
1 8621 134
1 31910 158
1 64508 180
1 61253 245
1 71418 254
1 39447 257
1 97720 317
1 32152 341
1 35247 343
1 3623 347
1 22039 352
1 99946 427
1 43386 441
1 14321 552
1 98406 566
1 49213 611
1 86481 644
1 92052 719
1 75862 746
1 30185 750
1 23894 783
1 81361 792
1...

result:

ok good solution

Test #88:

score: 33
Accepted
time: 39ms
memory: 105000kb

input:

100000
390001 491097 374534 183026 728054 662043 383822 472359 39653 930572 382598 411249 81130 656269 480889 276554 830593 246113 116520 174528 303104 587058 751166 180037 736477 480930 91604 295662 701400 981339 378353 318829 399041 51191 172913 416557 678680 453046 286343 291285 784799 617941 950...

output:

TAK
1 28087 19
1 54697 47
1 26669 82
1 65740 112
1 43282 134
1 26943 169
1 47567 479
1 48021 496
1 67564 499
1 87338 565
1 60382 729
1 54226 790
1 84232 965
1 6296 993
1 450 1054
1 77584 1102
1 36463 1295
1 33559 1313
1 83897 1317
1 8528 1420
1 83036 1508
1 97840 1625
1 77461 1719
1 6712 1752
1 1938...

result:

ok good solution

Test #89:

score: 33
Accepted
time: 48ms
memory: 102392kb

input:

100000
736034 613828 667374 724216 622387 447531 194860 509487 438273 77648 636158 773411 94063 589995 944705 74747 478156 395393 815143 488170 645164 719289 306536 885028 672556 923874 50253 262877 734053 896948 571863 715864 498305 978785 617733 781041 826814 602094 906669 423959 610072 971156 637...

output:

TAK
1 56068 10
1 83339 12
1 62718 87
1 75372 106
1 31301 175
1 17951 187
1 28247 199
1 41335 208
1 34707 219
1 78856 242
1 12305 300
1 19147 308
1 34032 331
1 84988 342
1 28218 395
1 25523 432
1 94782 467
1 63604 511
1 23762 512
1 73214 516
1 44937 525
1 30100 597
1 74106 618
1 51746 632
1 78086 668...

result:

ok good solution

Test #90:

score: 33
Accepted
time: 36ms
memory: 105340kb

input:

100000
755018 598061 336766 949557 931628 286691 334141 547495 428404 321171 995313 917041 783307 979586 620100 956955 752143 919270 393025 731491 632395 534700 530662 905975 306393 564341 788257 881025 372577 914152 318136 966896 637230 535598 801907 562097 972655 745849 427569 876891 666396 761081...

output:

TAK
1 65794 250684
65794 71157 136
65794 18393 393
65794 88988 507
65794 7082 567
65794 33884 743
65794 92579 934
65794 17826 1405
65794 96973 1622
65794 61953 1932
65794 93510 2024
65794 84814 2160
65794 5486 2258
65794 87402 2415
65794 11873 2547
65794 68447 2672
65794 99438 2758
65794 77592 2978
...

result:

ok good solution

Test #91:

score: 33
Accepted
time: 28ms
memory: 104084kb

input:

100000
663804 488471 769548 921960 178444 27725 746538 237913 731341 61073 632927 173752 814546 995139 428226 123700 907771 279186 907621 580298 535022 748850 545750 251547 181498 452113 628308 937658 123490 971092 332430 719883 820719 567350 279122 512943 63150 853688 979833 970571 909086 938689 93...

output:

NIE

result:

ok no solution

Test #92:

score: 33
Accepted
time: 39ms
memory: 100344kb

input:

100000
469562 978032 845494 65062 87865 758301 731659 229342 911159 903392 979064 158553 775642 555165 105822 638268 464945 196002 665280 192126 899993 308913 298701 457740 820879 649887 207361 152447 769246 407745 29335 669334 465042 501205 629786 332789 606189 262097 237156 862131 395511 416587 18...

output:

NIE

result:

ok no solution

Test #93:

score: 33
Accepted
time: 33ms
memory: 101004kb

input:

100000
62018 795061 726441 66032 384228 828466 579582 152329 363575 243514 273572 64781 258688 352266 590031 851681 882920 321564 694807 303373 437641 529677 834364 319955 434588 931932 963367 868186 126514 62734 86620 893307 65612 163986 480022 302202 697348 535032 769906 563596 322652 777482 68493...

output:

NIE

result:

ok no solution

Test #94:

score: 33
Accepted
time: 44ms
memory: 102608kb

input:

100000
208975 670453 757888 63754 162482 388956 185922 36019 96563 218382 515745 907825 704737 328309 847914 136747 804934 156025 275635 276652 232612 257697 383627 408240 453998 240263 121625 503857 503992 775982 633734 100834 194105 990213 217360 818825 942174 812749 748344 69739 713052 284734 709...

output:

TAK
1 61510 13
1 2734 17
1 30362 20
1 91300 29
1 48876 33
1 53906 38
1 18236 46
1 70580 64
1 67164 78
1 92237 82
1 11533 107
1 17840 115
1 58266 124
1 14469 140
1 1538 146
1 18270 156
1 33131 159
1 36147 162
1 50686 164
1 85137 174
1 88677 177
1 34934 178
1 60842 188
1 63433 193
1 60427 194
1 33443 ...

result:

ok good solution

Test #95:

score: 33
Accepted
time: 41ms
memory: 102496kb

input:

100000
304783 744212 750198 4605 546584 676594 867905 674068 855685 221204 522506 42304 792309 574181 12691 168030 668631 799032 828679 580392 942226 565092 706420 4057 54347 391308 847134 804629 608922 691991 229552 523117 74866 562779 345077 48325 744710 42949 287505 183410 863178 607790 55640 652...

output:

TAK
1 70391 78
1 56911 524
1 87880 539
1 43382 623
1 64975 637
1 20203 948
1 10230 1019
1 13434 1074
1 1900 1232
1 68572 1319
1 65593 1325
1 53371 1441
1 32685 1736
1 47098 1842
1 57060 2240
1 93505 2357
1 1266 2402
1 4274 2404
1 3699 2581
1 63548 2901
1 63672 3225
1 53011 3320
1 15738 3467
1 71882 ...

result:

ok good solution

Test #96:

score: 33
Accepted
time: 44ms
memory: 103336kb

input:

100000
208785 786215 988648 218590 630261 56554 520857 623813 278716 430522 128681 84019 453627 622138 132504 131558 798247 87431 612798 661155 600936 772896 210738 691386 24421 238302 708662 741771 378195 674261 443952 886804 255784 402510 68224 200549 813059 688830 1868 887546 827253 344195 446096...

output:

TAK
1 29078 14
1 20560 37
1 9072 43
1 19342 44
1 15047 73
1 91661 89
1 16848 97
1 64749 98
1 95234 103
1 16735 122
1 46497 135
1 60898 176
1 571 187
1 92281 214
1 88541 217
1 74991 221
1 44901 223
1 63059 226
1 73825 244
1 49528 275
1 51921 287
1 67530 315
1 40638 321
1 59343 329
1 80729 333
1 5458 ...

result:

ok good solution

Test #97:

score: 33
Accepted
time: 31ms
memory: 105028kb

input:

100000
817561 617490 393322 588837 441535 616039 618160 625033 512957 944352 899443 572980 659935 372205 841742 627314 551633 418806 283724 805306 597771 792858 397335 414598 790255 510707 820152 976918 702379 349967 421019 641032 561187 649328 613559 759800 316322 838238 357222 384077 871254 692188...

output:

TAK
1 47720 252875
47720 25478 388
47720 1064 399
47720 77470 411
47720 17435 428
47720 13708 535
47720 93280 590
47720 70019 667
47720 4761 682
47720 89913 767
47720 61863 829
47720 7817 1044
47720 75058 1078
47720 36343 1087
47720 28024 1136
47720 21408 1142
47720 25990 1189
47720 78760 1215
47720...

result:

ok good solution

Test #98:

score: 33
Accepted
time: 31ms
memory: 101292kb

input:

100000
885005 377719 693159 151473 826903 936858 511224 892768 995158 676100 568411 472801 750179 201642 936030 979853 502886 717895 367693 437170 381970 507193 352054 530346 187416 610559 910874 412187 209417 842036 882094 231127 140507 345178 630856 608640 894236 527672 137855 836872 656030 522124...

output:

NIE

result:

ok no solution

Test #99:

score: 33
Accepted
time: 40ms
memory: 100456kb

input:

100000
485545 649936 718666 618924 559760 618215 171708 243616 547462 557017 816282 218493 140522 897932 868661 322138 278874 744947 122886 631759 106597 333659 889983 200742 489465 699436 164433 777236 746272 933549 709491 707344 706019 463888 474030 361568 576936 801968 132246 201318 577130 874373...

output:

NIE

result:

ok no solution

Test #100:

score: 33
Accepted
time: 27ms
memory: 101144kb

input:

100000
785898 326326 901750 390474 45807 403299 715351 398206 43607 155831 48486 944197 609939 390476 841559 349460 964635 836564 749912 994182 36041 15269 382860 541496 775785 628981 215231 819743 81834 688482 861744 700182 772004 596497 329267 866058 359469 7055 835004 372439 714386 230432 621870 ...

output:

NIE

result:

ok no solution

Test #101:

score: 33
Accepted
time: 54ms
memory: 105028kb

input:

100000
671870 837394 399613 8935 791740 304513 283801 423657 327125 435354 72521 357433 743585 496963 886061 182894 419099 731665 877512 923312 354155 265433 690405 582878 866528 153339 693789 131463 203542 687468 351829 12555 340499 623702 549933 240258 599816 673025 522350 330843 313657 29036 4141...

output:

TAK
1 31589 5
1 81606 32
1 15178 50
1 34875 82
1 59380 99
1 82333 112
1 77657 159
1 47110 177
1 76485 179
1 31300 194
1 49614 203
1 52786 267
1 85540 286
1 74326 287
1 64422 311
1 50652 329
1 53450 333
1 45998 390
1 45967 408
1 2536 410
1 37070 425
1 52491 449
1 24843 467
1 6385 479
1 40454 485
1 33...

result:

ok good solution

Test #102:

score: 33
Accepted
time: 39ms
memory: 103072kb

input:

100000
150183 296631 225226 851643 706822 138398 350202 742668 218556 801505 153348 692951 70460 592495 265176 564093 45280 305195 83392 872040 75009 793591 702460 916448 60291 903489 87230 906985 151949 514443 752068 837448 123297 884270 596278 432913 91186 601494 30378 666804 911882 558177 636581 ...

output:

TAK
1 62728 646
1 27036 2242
1 97713 2458
1 43029 5200
1 92732 5432
1 52324 5453
1 80367 6395
1 53199 6853
1 1109 6853
1 50969 8746
1 46204 9681
1 31298 9855
1 10501 10835
1 95513 11792
1 4414 12201
1 32117 12770
1 55728 13605
1 82275 16210
1 61069 16630
1 58000 17273
1 65454 17656
1 75561 18158
1 9...

result:

ok good solution

Test #103:

score: 33
Accepted
time: 40ms
memory: 105344kb

input:

100000
532347 314768 753014 546278 318270 576521 451783 377307 692263 781151 697918 992853 166179 384950 962659 218383 148231 148894 372770 354864 318208 858453 499884 809049 980459 213466 608863 219863 434558 489606 360541 99648 785021 782192 426070 424455 538371 262533 441025 573031 664322 314534 ...

output:

TAK
1 84750 13
1 49171 62
1 38328 62
1 19046 62
1 98397 87
1 79024 146
1 88678 146
1 34592 146
1 9134 146
1 98412 146
1 40191 230
1 93992 333
1 77763 394
1 25174 394
1 47459 560
1 69206 560
1 60027 602
1 2238 602
1 60777 602
1 25574 602
1 5612 604
1 97749 620
1 37836 723
1 88192 723
1 54794 791
1 51...

result:

ok good solution

Test #104:

score: 33
Accepted
time: 43ms
memory: 105264kb

input:

100000
631868 656656 685293 781189 932466 626225 724659 487511 819377 657880 558773 776975 612265 536555 396524 303081 297334 809237 339743 625989 489675 592635 431124 630513 350836 336879 967021 383111 942577 362485 521321 618098 263843 565708 278144 896007 850086 551954 749889 293542 749359 494444...

output:

TAK
1 564 260753
564 36307 7
564 11274 80
564 31721 115
564 792 267
564 66746 271
564 64881 453
564 50476 562
564 90818 907
564 90432 907
564 84187 911
564 99173 1129
564 69515 1250
564 57166 1269
564 11777 1272
564 56678 1393
564 5097 1404
564 53571 1484
564 94916 1572
564 9829 1600
564 41485 1653
...

result:

ok good solution

Test #105:

score: 33
Accepted
time: 39ms
memory: 104352kb

input:

100000
653226 659918 839624 144176 788751 45924 46329 254076 812027 339176 187272 318075 175483 494553 505628 201349 419589 201115 795655 846441 207392 115791 389177 253090 36660 47482 867375 159798 379564 511302 832030 137323 401711 735698 827310 2497 941944 418672 23830 197218 780717 619801 798349...

output:

NIE

result:

ok no solution

Test #106:

score: 33
Accepted
time: 29ms
memory: 100656kb

input:

100000
800322 409074 657521 187322 463151 671253 237262 867931 379100 552253 489580 895194 642833 67636 469262 638683 143313 477874 418191 64304 373146 96702 128462 771196 626348 196846 687202 367147 243662 698062 933361 35141 629016 116764 36795 533686 23838 69255 975089 472302 932650 541549 599305...

output:

NIE

result:

ok no solution

Test #107:

score: 33
Accepted
time: 31ms
memory: 100848kb

input:

100000
891297 597427 995205 454073 169305 225952 781536 169564 2678 555776 506713 970084 367663 511475 833007 510174 452342 566875 537113 778652 163118 930172 524690 4223 282046 693820 787246 656848 73833 138834 528790 849298 39670 909380 829058 947629 484090 436133 228732 776315 815177 297707 2366 ...

output:

NIE

result:

ok no solution

Test #108:

score: 33
Accepted
time: 41ms
memory: 102560kb

input:

100000
39771 269851 474386 39679 291593 426923 32030 202720 688261 303883 607594 425522 668162 446473 44392 143499 863807 234397 371197 613161 561294 510932 898646 53339 729886 112812 181640 994629 702944 351456 119016 763830 274483 550495 273646 782166 389431 722110 252840 518825 211646 474478 7253...

output:

TAK
1 4051 3
1 21349 5
1 33282 6
1 20437 7
1 23277 19
1 29181 31
1 68483 32
1 68322 33
1 68533 35
1 30918 42
1 28041 49
1 48984 61
1 16666 79
1 70183 85
1 45656 93
1 30511 105
1 29172 126
1 48526 148
1 1491 149
1 83036 156
1 57660 158
1 16915 193
1 22358 195
1 5424 217
1 95336 220
1 20833 225
1 2367...

result:

ok good solution

Test #109:

score: 33
Accepted
time: 24ms
memory: 103404kb

input:

100000
719451 882536 737092 800969 290031 115759 348682 606361 840012 684307 278159 372015 700894 458955 417805 905581 727159 777561 708520 146911 175706 187668 612859 656585 908815 853034 849754 502733 272732 895828 101762 441956 137354 623227 499432 483975 7121 511784 110530 554822 101756 897577 7...

output:

TAK
1 40765 303
1 87107 355
1 96242 558
1 89354 697
1 43236 756
1 54692 822
1 93737 970
1 3399 1069
1 70724 1222
1 12642 1232
1 59005 1309
1 48637 1452
1 39204 1461
1 64534 1660
1 5541 1679
1 83280 1693
1 44717 1833
1 96631 1873
1 81206 1884
1 85415 2310
1 92585 2490
1 23314 2603
1 85885 2610
1 8049...

result:

ok good solution

Test #110:

score: 33
Accepted
time: 56ms
memory: 103496kb

input:

100000
226049 306625 110642 351325 642054 647271 890936 590786 710119 484175 329661 59621 580588 132673 593773 413136 298373 42530 433077 459645 502399 447636 978479 464644 608353 666382 521463 348080 29556 511247 720610 275639 561418 623772 501426 98357 856813 14744 471308 400414 491396 661052 4434...

output:

TAK
1 93895 17
1 15131 40
1 84378 95
1 51508 114
1 6386 131
1 56490 147
1 74436 153
1 96462 174
1 2409 197
1 27021 205
1 8128 348
1 99435 389
1 38956 391
1 98063 391
1 91794 399
1 41504 480
1 32820 489
1 36094 489
1 42389 515
1 47723 544
1 12494 573
1 53740 617
1 52773 620
1 56915 659
1 63880 671
1 ...

result:

ok good solution

Test #111:

score: 33
Accepted
time: 33ms
memory: 104944kb

input:

100000
803180 949362 494930 296481 505308 540200 899040 317587 668400 527499 979673 766670 874613 875055 504482 849724 564859 407682 992990 717962 611259 702013 486600 657085 468292 489343 466509 949604 646395 286020 446998 417110 643591 895675 460765 817972 809300 539197 269153 301226 681297 272361...

output:

TAK
1 8571 269149
8571 80529 171
8571 71469 177
8571 4372 277
8571 73680 360
8571 5026 517
8571 56025 646
8571 45806 717
8571 10918 717
8571 93983 804
8571 58475 842
8571 6970 893
8571 27490 947
8571 25486 947
8571 79441 978
8571 9609 1141
8571 60756 1158
8571 7817 1185
8571 93896 1259
8571 10663 12...

result:

ok good solution

Test #112:

score: 33
Accepted
time: 12ms
memory: 100848kb

input:

14002
998678 998658 998574 998590 998695 998645 998578 998571 998658 998650 998627 998657 998742 998614 998618 998676 998565 998665 998668 998684 998572 998701 998611 998625 998660 998558 998623 998528 998554 998618 998674 998579 998569 998667 998639 998682 998707 998550 998577 998649 998687 998666 ...

output:

TAK
1 8882 998520
8882 9276 1
8882 2860 2
8882 4294 3
8882 13940 4
8882 13523 5
8882 1468 6
8882 7107 7
8882 8636 8
8882 9752 9
8882 2365 10
8882 11814 11
8882 1727 12
8882 7382 13
8882 3640 14
8882 2095 15
8882 3941 16
8882 10504 17
8882 1809 18
8882 757 19
8882 739 20
8882 4192 21
8882 11849 22
88...

result:

ok good solution

Subtask #5:

score: 18
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #113:

score: 18
Accepted
time: 123ms
memory: 108728kb

input:

500000
236169 952990 757241 146742 599039 478356 523004 140015 962826 562178 368742 549108 86158 944559 806255 131335 644413 528997 923995 745466 498441 463083 475468 530030 288457 969119 204418 373072 774354 390782 522540 990951 356157 559786 195839 714717 754794 350818 129892 889335 168572 901579 ...

output:

NIE

result:

ok no solution

Test #114:

score: 18
Accepted
time: 152ms
memory: 110004kb

input:

500000
88582 167165 377150 604094 609178 987269 854551 652632 882447 565876 564043 579510 426040 601819 488829 996565 684356 271099 589034 522686 872238 679237 428054 249693 668403 492182 448207 441393 789845 495235 403837 720434 878704 418664 451785 834404 556233 266739 268418 304694 349219 488002 ...

output:

NIE

result:

ok no solution

Test #115:

score: 18
Accepted
time: 125ms
memory: 108224kb

input:

500000
395706 121511 550790 354978 906422 271416 97401 288434 462632 295720 208982 620701 849667 741649 675452 511229 114201 707494 792121 903781 809874 470998 574089 410486 485789 258276 629523 72359 468037 302967 760158 646476 415999 416805 197662 255727 562261 281909 588031 964827 994928 370101 8...

output:

NIE

result:

ok no solution

Test #116:

score: 18
Accepted
time: 213ms
memory: 114012kb

input:

500000
788907 725472 947004 173276 881965 593666 108597 803006 835535 405697 963744 568150 890915 905522 932398 686679 120619 92645 244984 516889 93762 459689 605157 615050 92627 548667 877309 781981 742752 142203 485348 144792 765381 739696 51754 434736 54311 619686 909904 532748 349589 536326 9863...

output:

TAK
1 158177 2
1 25485 5
1 487739 7
1 320229 10
1 173553 18
1 55134 19
1 99997 20
1 360867 21
1 183928 23
1 30891 24
1 417430 25
1 422872 26
1 433776 28
1 491656 29
1 53353 30
1 174115 33
1 253614 37
1 228121 38
1 218579 42
1 342276 43
1 57960 45
1 117745 46
1 360192 48
1 17613 50
1 316875 55
1 2927...

result:

ok good solution

Test #117:

score: 18
Accepted
time: 169ms
memory: 116556kb

input:

500000
505537 355397 75217 499831 663806 564712 709314 206220 175949 877910 948833 412438 421741 63813 87874 114532 191002 200605 904534 65009 249701 705040 578822 605497 754780 713250 238519 393998 69356 240966 422687 457340 481823 919481 418729 55380 916731 433830 876456 56430 725191 864012 841158...

output:

TAK
1 340651 16
1 81479 133
1 409674 161
1 270831 255
1 341152 277
1 5003 308
1 226468 310
1 98777 362
1 151655 399
1 460635 407
1 34132 493
1 119052 508
1 211821 517
1 460517 562
1 448574 564
1 186283 598
1 371347 616
1 113708 645
1 296321 694
1 242889 715
1 58082 761
1 382166 964
1 151227 1011
1 1...

result:

ok good solution

Test #118:

score: 18
Accepted
time: 204ms
memory: 114196kb

input:

500000
574621 859976 531511 632664 566027 155810 429999 303849 305552 478101 608869 42205 221809 533532 245372 613372 152931 426578 96908 835581 350867 888939 32453 291622 363226 343931 800362 887803 335194 592336 73580 243780 397212 560247 518573 717640 56350 425068 198162 338732 729483 590620 8975...

output:

TAK
1 368 2
1 345516 7
1 26096 9
1 224326 10
1 74908 11
1 499017 13
1 4667 15
1 315361 19
1 397915 28
1 299400 29
1 69895 40
1 278517 41
1 8711 45
1 236418 47
1 277692 49
1 27500 50
1 127070 57
1 101170 59
1 58091 62
1 267091 65
1 402226 66
1 443771 67
1 291262 70
1 472797 75
1 393125 76
1 227427 79...

result:

ok good solution

Test #119:

score: 18
Accepted
time: 148ms
memory: 113160kb

input:

500000
651963 836393 437856 525793 904266 798251 277883 386794 307721 683563 614085 499613 829032 336030 495980 766316 515451 385250 912181 415836 779780 760259 364546 781283 942237 724817 401002 593087 862555 461385 901457 928812 910270 293208 272570 271260 718896 427984 764917 806920 802083 842493...

output:

TAK
1 490711 268260
490711 407264 1
490711 474479 16
490711 484402 23
490711 148488 46
490711 95918 50
490711 255468 82
490711 272028 101
490711 289619 111
490711 334090 128
490711 446656 147
490711 466515 154
490711 164762 191
490711 185859 203
490711 279252 217
490711 106193 253
490711 391186 272
...

result:

ok good solution

Test #120:

score: 18
Accepted
time: 123ms
memory: 109916kb

input:

500000
398812 655030 737717 408782 139331 772560 137285 448003 653137 453447 243942 273305 937252 911739 879927 383174 655280 156536 93537 64221 96623 142158 764677 915554 872909 501321 450891 81996 389284 103136 963237 626808 680846 438895 314266 935567 826608 287466 308443 436758 253521 611620 193...

output:

NIE

result:

ok no solution

Test #121:

score: 18
Accepted
time: 155ms
memory: 111416kb

input:

500000
179561 660110 705425 832096 582500 934162 425886 641897 643844 78937 748488 481458 532910 992050 617403 762233 293173 725278 29188 246662 517978 568493 304979 564587 159694 339967 329352 729788 621493 852978 590005 497690 266474 255173 305678 611639 689942 185894 516456 187894 285035 885088 1...

output:

NIE

result:

ok no solution

Test #122:

score: 18
Accepted
time: 123ms
memory: 106740kb

input:

500000
745777 86056 417144 334475 880085 339689 76081 729015 343238 693829 675190 133289 134760 866869 837107 965665 200328 906080 86311 869565 601121 818378 942502 830513 829122 582141 156992 434219 127712 466084 388701 670105 37513 500994 65916 680921 217095 302453 889363 627463 858926 49542 49263...

output:

NIE

result:

ok no solution

Test #123:

score: 18
Accepted
time: 208ms
memory: 113376kb

input:

500000
151464 163747 298203 218584 244402 920338 814442 518332 268019 567391 567675 223527 692031 558847 837459 111820 625091 840866 652496 532994 877369 457852 222716 149233 504308 162266 744547 611193 594166 696830 481934 631269 358987 627461 616921 212607 682793 440797 373443 669848 59479 382413 ...

output:

TAK
1 493201 12
1 360414 12
1 205225 12
1 278237 12
1 327694 17
1 425317 18
1 118647 18
1 483095 19
1 403763 21
1 19262 21
1 134436 22
1 388537 22
1 223924 22
1 416462 35
1 488485 35
1 365416 36
1 186737 43
1 79555 45
1 419370 54
1 402047 61
1 130586 61
1 98176 63
1 474794 63
1 29715 63
1 354351 70
...

result:

ok good solution

Test #124:

score: 18
Accepted
time: 145ms
memory: 113640kb

input:

500000
704613 846101 196328 723528 539983 527581 835115 642305 290174 227222 786925 464653 484096 713914 446226 823556 353670 303814 879612 766504 336269 819905 438367 143676 149835 829117 725699 548477 854280 624305 559276 356763 543220 921242 16883 828021 402736 565144 895214 859020 900943 113634 ...

output:

TAK
1 477977 301
1 400378 301
1 384012 908
1 167 1012
1 52592 1012
1 416706 1468
1 374863 1468
1 305630 2020
1 97268 2020
1 339850 2355
1 457283 2533
1 152170 2758
1 103643 2790
1 253319 2790
1 295777 2790
1 205798 2790
1 123002 3129
1 484593 3294
1 491253 3294
1 464969 3500
1 276341 3603
1 138787 3...

result:

ok good solution

Test #125:

score: 18
Accepted
time: 218ms
memory: 113060kb

input:

500000
575640 974431 119793 345460 324989 986283 118096 61949 602742 105107 697462 613618 770331 833198 207737 821076 66133 710795 401563 369969 926058 517347 29363 422348 393771 261195 543718 623633 163164 710739 924942 596481 97970 945670 276142 231171 92899 238063 92472 23779 355459 193079 996436...

output:

TAK
1 114666 2
1 292019 7
1 120984 7
1 52955 7
1 449452 16
1 147741 23
1 53717 23
1 396742 29
1 394943 32
1 123234 34
1 219864 39
1 307166 46
1 11821 54
1 139235 55
1 350617 58
1 451649 62
1 171079 62
1 252827 64
1 160847 64
1 173463 67
1 396933 69
1 427981 69
1 166439 75
1 57491 75
1 189269 78
1 11...

result:

ok good solution

Test #126:

score: 18
Accepted
time: 158ms
memory: 113804kb

input:

500000
486664 919154 435522 863537 294666 564226 451732 623046 384433 517995 634007 550806 385279 479570 312545 646647 262306 710102 678119 369565 620333 525706 690783 515289 556480 614026 941545 751579 359573 739275 351378 271158 792378 507362 763249 660767 871304 469180 259290 297887 768575 672592...

output:

TAK
1 126785 252950
126785 439366 7184
126785 100071 30831
126785 98781 60602
126785 224341 64527
126785 296823 79849
126785 290392 80957
126785 389102 90402
126785 252819 112099
126785 356077 116483
126785 92165 125575
126785 397821 125575
126785 474131 152296
126785 356736 153353
126785 435934 154...

result:

ok good solution

Test #127:

score: 18
Accepted
time: 129ms
memory: 107792kb

input:

500000
779291 990049 217668 777047 9737 867200 737186 707561 323285 983091 355593 749252 962925 956852 858304 845476 832528 765328 435154 798572 707198 358340 205907 833890 710256 575468 617227 728472 914256 631405 492680 987241 950929 360677 381621 987720 645798 914530 794419 927841 648729 362535 9...

output:

NIE

result:

ok no solution

Test #128:

score: 18
Accepted
time: 162ms
memory: 107948kb

input:

500000
430454 568651 486619 880827 262492 245950 304864 257194 307788 931015 276004 987877 481275 420801 895928 730522 423665 47553 501326 422533 126431 833775 501354 42958 270841 966990 99598 876403 276883 401109 286204 370541 495185 541175 933980 241124 223426 546429 517055 515854 785365 374024 87...

output:

NIE

result:

ok no solution

Test #129:

score: 18
Accepted
time: 143ms
memory: 110028kb

input:

500000
725133 529120 125547 696168 298620 279208 96819 565477 138126 970399 662174 809929 587113 707585 729417 38256 340155 76759 8774 281256 479127 660082 499831 847952 532148 546489 567892 417738 152148 626909 772601 917509 287477 320498 887272 153666 444917 457726 83424 907218 489748 554562 56000...

output:

NIE

result:

ok no solution

Test #130:

score: 18
Accepted
time: 213ms
memory: 116380kb

input:

500000
663342 22125 535270 249725 183665 993876 401293 436299 977351 724935 312470 244932 497397 740509 240445 447341 528374 675826 272164 198949 539449 730973 28277 615977 940191 612444 893801 635948 665546 537469 56255 687985 594958 56469 95387 415687 144461 228793 242887 230773 203516 783420 9588...

output:

TAK
1 253427 1
1 355470 2
1 10733 4
1 447074 5
1 355292 6
1 189521 7
1 238097 8
1 208103 11
1 480855 13
1 60920 15
1 220077 16
1 276154 17
1 38282 18
1 427941 19
1 379685 20
1 54927 21
1 254468 22
1 84138 23
1 337173 26
1 93052 27
1 458167 31
1 341869 33
1 409947 36
1 451788 38
1 79211 39
1 326735 4...

result:

ok good solution

Test #131:

score: 18
Accepted
time: 149ms
memory: 115508kb

input:

500000
357135 432688 945424 518430 182309 296003 14833 515552 966514 132251 241876 334979 460130 414497 823 2989 25200 744757 961957 45605 165382 568073 568381 65895 884811 58447 81547 329249 739506 871016 907478 301561 754169 701617 713003 359411 847125 918522 66974 519309 81500 987278 583189 96184...

output:

TAK
1 335719 37
1 102918 132
1 103290 162
1 86381 224
1 49893 355
1 481708 389
1 104995 420
1 369472 466
1 141010 493
1 63318 509
1 261752 521
1 474516 545
1 320350 580
1 416804 604
1 98115 693
1 334868 842
1 64028 913
1 47708 1006
1 365363 1011
1 73320 1043
1 350656 1253
1 257144 1259
1 359238 1337...

result:

ok good solution

Test #132:

score: 18
Accepted
time: 211ms
memory: 113140kb

input:

500000
589489 501667 899208 706180 469140 829129 948465 17099 314232 220112 714048 975470 954194 974850 620429 819884 807973 25853 676719 605484 693226 367093 468312 794081 611502 439674 119621 262695 322308 272958 851021 832480 303855 173428 714726 384681 668577 731271 332501 849337 948884 477995 5...

output:

TAK
1 118133 3
1 219640 10
1 470944 21
1 250559 24
1 200298 28
1 61503 32
1 372186 33
1 187933 38
1 108538 41
1 219936 45
1 162498 50
1 411148 51
1 159753 62
1 341500 63
1 51272 64
1 355622 70
1 179324 73
1 478525 76
1 406781 83
1 411858 85
1 250547 86
1 273692 94
1 37759 97
1 42512 107
1 358705 108...

result:

ok good solution

Test #133:

score: 18
Accepted
time: 154ms
memory: 112316kb

input:

500000
549327 360110 980814 971962 736829 793491 924818 344618 739852 346178 335294 654584 476201 616941 903043 889708 574127 837508 915510 605094 886528 554699 629921 645826 468820 445092 474205 365578 990637 547776 509117 887764 502187 979750 722996 972325 880710 873258 907431 309239 750891 314358...

output:

TAK
1 477836 302419
477836 52547 45
477836 12001 79
477836 124272 112
477836 415851 114
477836 30307 128
477836 47666 186
477836 480480 201
477836 40517 225
477836 95678 246
477836 2119 253
477836 428952 293
477836 455280 296
477836 492579 297
477836 270596 315
477836 259253 333
477836 82904 354
477...

result:

ok good solution

Test #134:

score: 18
Accepted
time: 60ms
memory: 106532kb

input:

500000
197 222 224 305 306 374 570 582 776 890 985 1013 1437 1455 1580 1608 1616 1629 1670 1891 1926 2103 2165 2379 2569 2606 2713 2810 2856 2863 3094 3395 3441 3478 3722 3953 4209 4302 4336 4427 4474 4499 4635 4681 4761 4806 4816 4943 4959 4979 5065 5124 5186 5353 5477 5545 5643 5669 5724 5807 5901...

output:

NIE

result:

ok no solution