QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#218884#7151. Tree embeddingSolitaryDream#AC ✓3ms4492kbC++172.5kb2023-10-18 19:57:572023-10-18 19:57:58

Judging History

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

  • [2023-10-18 19:57:58]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:4492kb
  • [2023-10-18 19:57:57]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int N = 2010;
const int M = 16;
int n, nn;
int ans[N][M];
set<pii> g[N];
inline void Build(const vector<pii> &a, int fa, int l, int r) {
    if (l == r) {
        g[a[l].first].insert({fa, a[l].second});
        g[fa].insert(a[l]);
        return;
    }
    int mid = (l + r) >> 1;
    int cur = ++nn;
    Build(a, cur, l, mid);
    Build(a, cur, mid + 1, r);
    g[fa].insert({cur, 0});
    g[cur].insert({fa, 0});
}
int del[N], si[N], mxsi, mxu, mxv;
inline void GetSi(int x, int fa) {
    si[x] = 1;
    for (auto [y, z] : g[x]) if (y != fa && !del[y]) {
        GetSi(y, x);
        si[x] += si[y];
    }
}
inline void GetUV(int x, int fa, int all) {
    int cursi = max(all - si[x], si[x]);
    if (cursi < mxsi) mxsi = cursi, mxu = x, mxv = fa;
    for (auto [y, z] : g[x]) if (y != fa && !del[y]) {
        GetUV(y, x, all);
    }
}
inline void Paint(int x, int fa, int de, int q, int dis) {
    ans[x][de] = dis;
    for (auto [y, z] : g[x]) if (y != fa && !del[y]) {
        Paint(y, x, de, q, dis + q * z);
    }
}
inline void PaintAdd(int x, int fa, int de, int add, int minus) {
    // printf("Paint Add %d %d\n", x, fa);
    for (auto [y, z] : g[x]) if (y != fa && !del[y]) {
        PaintAdd(y, x, de, add, minus);
    }
    for (int i = de; i < M; ++i) {
        ans[x][i] += ans[add][i] - ans[minus][i];
    }
}
inline void Solve(int x, int de) {
    GetSi(x, 0);
    if (si[x] == 1) return;
    mxsi = 1e9;
    GetUV(x, 0, si[x]);
    int u = mxu, v = mxv;
    // printf("cut %d %d\n", u, v);
    Paint(u, v, de, -1, 0);
    Paint(v, u, de, 1, g[u].lower_bound({v, 0})->second);
    del[u] = 1; Solve(v, de + 1); del[u] = 0;
    del[v] = 1; Solve(u, de + 1); del[v] = 0;
    // printf("== cut %d %d\n");
    PaintAdd(v, u, de + 1, u, v);
}
int main() {
    scanf("%d", &n);
    nn = n;
    for (int i = 1, x, y, z; i < n; ++i) {
        scanf("%d%d%d", &x, &y, &z);
        g[x].insert({y, z});
        g[y].insert({x, z});
    }
    for (int i = 1; i <= n; ++i) if (g[i].size() > 3) {
        vector<pii> tmp(g[i].begin(), g[i].end());
        for (auto [y, z] : g[i]) g[y].erase({i, z});
        g[i].clear();
        Build(tmp, i, 0, tmp.size() - 1);
    }
    Solve(1, 0);
    printf("%d\n", M);
    for (int i = 1; i <= n; puts(""), ++i)
        for (int j = 0; j < M; ++j) 
            printf("%d ", ans[i][j]);
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 4000kb

input:

2
1 2 2

output:

16
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok 

Test #2:

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

input:

4
1 2 1
1 3 1
1 4 1

output:

16
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
2 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
2 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok 

Test #3:

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

input:

10
8 2 33305
2 6 69148
3 2 78693
5 9 4671
4 9 60174
7 2 53555
9 2 44205
1 5 51522
4 10 8094

output:

16
100398 -100398 134886 -56193 -51522 0 0 0 0 0 0 0 0 0 0 0 
0 0 78693 0 0 0 0 0 0 0 0 0 0 0 0 0 
-78693 -78693 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
104379 -104379 18519 0 0 0 0 0 0 0 0 0 0 0 0 0 
48876 -48876 83364 -4671 0 0 0 0 0 0 0 0 0 0 0 0 
-69148 -69148 147841 -69148 0 0 0 0 0 0 0 0 0 0 0 0 
-53555 ...

result:

ok 

Test #4:

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

input:

7
3 2 84583
1 2 99813
2 6 69523
4 2 85328
5 7 95654
5 4 79707

output:

16
99813 -14485 -20106 95654 0 0 0 0 0 0 0 0 0 0 0 0 
0 85328 79707 95654 0 0 0 0 0 0 0 0 0 0 0 0 
84583 745 164290 11071 0 0 0 0 0 0 0 0 0 0 0 0 
-85328 0 79707 95654 0 0 0 0 0 0 0 0 0 0 0 0 
-165035 -79707 0 95654 0 0 0 0 0 0 0 0 0 0 0 0 
-69523 154851 10184 95654 0 0 0 0 0 0 0 0 0 0 0 0 
-260689 ...

result:

ok 

Test #5:

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

input:

7
3 1 81630
4 3 90999
7 5 34787
4 2 45864
6 4 22160
3 7 70320

output:

16
172629 127494 -81630 0 0 0 0 0 0 0 0 0 0 0 0 0 
-45864 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
90999 45864 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 45864 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
196106 -59243 -34787 0 0 0 0 0 0 0 0 0 0 0 0 0 
-22160 68024 -22160 0 0 0 0 0 0 0 0 0 0 0 0 0 
161319 -24456 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 

Test #6:

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

input:

9
5 9 52
7 9 97888
4 7 72858
1 6 71334
6 2 19443
8 2 31727
5 3 14365
2 7 75461

output:

16
166238 7111 -71282 14365 0 0 0 0 0 0 0 0 0 0 0 0 
75461 97888 52 14365 0 0 0 0 0 0 0 0 0 0 0 0 
-112305 -14417 -14365 0 0 0 0 0 0 0 0 0 0 0 0 0 
-72858 170746 -72806 14365 0 0 0 0 0 0 0 0 0 0 0 0 
-97940 -52 0 14365 0 0 0 0 0 0 0 0 0 0 0 0 
94904 78445 52 14365 0 0 0 0 0 0 0 0 0 0 0 0 
0 97888 52...

result:

ok 

Test #7:

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

input:

2
1 2 20340

output:

16
20340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok 

Test #8:

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

input:

2
2 1 51883

output:

16
51883 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok 

Test #9:

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

input:

8
8 7 10751
3 4 95845
6 7 62471
6 2 19671
2 3 29382
2 5 10022
7 1 3280

output:

16
85422 -36369 92565 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 29382 95845 0 0 0 0 0 0 0 0 0 0 0 0 0 
-29382 0 95845 0 0 0 0 0 0 0 0 0 0 0 0 0 
-125227 -95845 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
-10022 39404 85823 0 0 0 0 0 0 0 0 0 0 0 0 0 
19671 29382 95845 0 0 0 0 0 0 0 0 0 0 0 0 0 
82142 -33089 95845 0 0 0 0 0 0 0 ...

result:

ok 

Test #10:

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

input:

9
4 9 36917
1 6 23007
5 4 46177
8 7 54587
1 7 71340
2 1 56998
6 3 27648
4 1 33264

output:

16
0 33264 46177 0 0 0 0 0 0 0 0 0 0 0 0 0 
-56998 90262 -10821 0 0 0 0 0 0 0 0 0 0 0 0 0 
50655 -17391 -4478 -27648 0 0 0 0 0 0 0 0 0 0 0 0 
-33264 0 46177 0 0 0 0 0 0 0 0 0 0 0 0 0 
-79441 -46177 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
23007 10257 23170 0 0 0 0 0 0 0 0 0 0 0 0 0 
71340 -38076 117517 -71340 0...

result:

ok 

Test #11:

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

input:

10
7 5 75030
7 6 72683
10 7 21009
1 10 98067
8 6 78011
2 6 37017
3 7 59811
7 9 75484
4 9 29913

output:

16
119076 -46393 156093 -119076 -98067 0 0 0 0 0 0 0 0 0 0 0 
-109700 -37017 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
-59811 132494 -22794 -59811 0 0 0 0 0 0 0 0 0 0 0 0 
105397 -32714 -68380 -29913 0 0 0 0 0 0 0 0 0 0 0 0 
-75030 147713 -38013 75030 -75030 0 0 0 0 0 0 0 0 0 0 0 
-72683 0 37017 0 0 0 0 0 0 0 0 ...

result:

ok 

Test #12:

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

input:

9
6 4 45480
1 3 73208
8 5 48334
2 8 85607
9 3 26872
6 7 38398
6 8 56313
8 3 34234

output:

16
107442 -51129 -27728 0 0 0 0 0 0 0 0 0 0 0 0 0 
85607 141920 -40127 0 0 0 0 0 0 0 0 0 0 0 0 0 
34234 22079 45480 0 0 0 0 0 0 0 0 0 0 0 0 0 
-101793 -45480 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
-48334 104647 93814 -48334 0 0 0 0 0 0 0 0 0 0 0 0 
-56313 0 45480 0 0 0 0 0 0 0 0 0 0 0 0 0 
-94711 -38398 83878...

result:

ok 

Test #13:

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

input:

10
3 2 43219
1 2 36963
5 10 33305
6 9 69148
4 9 78693
2 9 4671
9 7 60174
10 9 53555
10 8 44205

output:

16
41634 11921 -3658 0 0 0 0 0 0 0 0 0 0 0 0 0 
4671 48884 33305 0 0 0 0 0 0 0 0 0 0 0 0 0 
47890 5665 76524 -43219 0 0 0 0 0 0 0 0 0 0 0 0 
78693 132248 111998 -78693 0 0 0 0 0 0 0 0 0 0 0 0 
-86860 -33305 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
69148 122703 -35843 -69148 0 0 0 0 0 0 0 0 0 0 0 0 
-60174 11372...

result:

ok 

Test #14:

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

input:

10
6 7 99813
1 9 69523
3 6 85328
9 5 95654
2 10 79707
2 8 98694
6 2 81188
6 9 62924
4 6 13856

output:

16
132447 -51259 29171 0 0 0 0 0 0 0 0 0 0 0 0 0 
-81188 0 98694 0 0 0 0 0 0 0 0 0 0 0 0 0 
-85328 166516 184022 -85328 0 0 0 0 0 0 0 0 0 0 0 0 
-13856 95044 84838 -13856 0 0 0 0 0 0 0 0 0 0 0 0 
158578 -77390 194348 -95654 0 0 0 0 0 0 0 0 0 0 0 0 
0 81188 98694 0 0 0 0 0 0 0 0 0 0 0 0 0 
99813 1810...

result:

ok 

Test #15:

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

input:

10
1 2 90999
2 7 34787
2 6 45864
6 10 22160
6 4 70320
3 2 25420
2 9 2202
7 5 72292
8 7 40402

output:

16
90999 125786 -18707 -90999 0 0 0 0 0 0 0 0 0 0 0 0 
0 34787 72292 0 0 0 0 0 0 0 0 0 0 0 0 0 
25420 60207 46872 25420 -25420 0 0 0 0 0 0 0 0 0 0 0 
116184 -81397 1972 0 0 0 0 0 0 0 0 0 0 0 0 0 
-107079 -72292 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
45864 -11077 72292 0 0 0 0 0 0 0 0 0 0 0 0 0 
-34787 0 72292...

result:

ok 

Test #16:

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

input:

10
9 6 14889
9 10 52
5 9 97888
9 4 72858
9 7 71334
9 8 19443
9 1 31727
2 9 14365
9 3 75461

output:

16
31727 -31727 -16838 -31727 0 0 0 0 0 0 0 0 0 0 0 0 
14365 -14365 524 14365 -14365 0 0 0 0 0 0 0 0 0 0 0 
75461 -75461 90350 -75461 0 0 0 0 0 0 0 0 0 0 0 0 
72858 72858 -57969 -72858 0 0 0 0 0 0 0 0 0 0 0 0 
97888 97888 -82999 97888 -97888 0 0 0 0 0 0 0 0 0 0 0 
-14889 -14889 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 

Test #17:

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

input:

10
10 6 6075
10 2 98020
10 1 58423
2 4 99364
10 7 37755
8 7 13465
9 10 52741
3 7 91030
2 5 2008

output:

16
58423 96178 149453 -58423 0 0 0 0 0 0 0 0 0 0 0 0 
98020 -60265 91030 0 0 0 0 0 0 0 0 0 0 0 0 0 
-128785 -91030 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
197384 -159629 -8334 0 0 0 0 0 0 0 0 0 0 0 0 0 
100028 -62273 93038 -2008 0 0 0 0 0 0 0 0 0 0 0 0 
6075 43830 84955 -6075 0 0 0 0 0 0 0 0 0 0 0 0 
-37755 0 ...

result:

ok 

Test #18:

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

input:

10
7 6 86861
5 2 30580
8 6 10447
10 2 25869
2 6 62961
1 2 16000
3 4 6458
2 3 399
3 9 4363

output:

16
16000 78961 102861 -16000 0 0 0 0 0 0 0 0 0 0 0 0 
0 62961 86861 0 0 0 0 0 0 0 0 0 0 0 0 0 
399 62562 86861 0 0 0 0 0 0 0 0 0 0 0 0 0 
6857 56104 80403 0 0 0 0 0 0 0 0 0 0 0 0 0 
30580 93541 56281 -30580 0 0 0 0 0 0 0 0 0 0 0 0 
-62961 0 86861 0 0 0 0 0 0 0 0 0 0 0 0 0 
-149822 -86861 0 0 0 0 0 0...

result:

ok 

Test #19:

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

input:

10
10 3 10751
5 8 95845
1 10 62471
3 9 19671
8 4 29382
2 3 10022
7 1 3280
1 6 18279
10 8 30909

output:

16
62471 10751 10022 0 0 0 0 0 0 0 0 0 0 0 0 0 
-20773 -10022 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
-10751 0 10022 0 0 0 0 0 0 0 0 0 0 0 0 0 
-60291 71042 -50269 -29382 0 0 0 0 0 0 0 0 0 0 0 0 
-126754 137505 -116732 95845 -95845 0 0 0 0 0 0 0 0 0 0 0 
80750 -7528 10022 0 0 0 0 0 0 0 0 0 0 0 0 0 
65751 14031...

result:

ok 

Test #20:

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

input:

10
3 9 1937
9 6 36917
10 4 23007
5 8 46177
10 2 54587
10 6 71340
7 9 56998
8 1 27648
6 8 33264

output:

16
60912 9269 1937 0 0 0 0 0 0 0 0 0 0 0 0 0 
-125927 162844 -123990 -54587 0 0 0 0 0 0 0 0 0 0 0 0 
-38854 -1937 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
-94347 131264 -92410 23007 -23007 0 0 0 0 0 0 0 0 0 0 0 
79441 83094 -44240 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 36917 1937 0 0 0 0 0 0 0 0 0 0 0 0 0 
-93915 -56998 ...

result:

ok 

Test #21:

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

input:

10
5 3 58531
5 8 2182
3 2 75030
7 4 72683
4 3 21009
4 1 98067
2 9 78011
2 10 37017
5 6 59811

output:

16
119076 -23037 78011 0 0 0 0 0 0 0 0 0 0 0 0 0 
-75030 0 78011 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 75030 78011 0 0 0 0 0 0 0 0 0 0 0 0 0 
21009 75030 78011 0 0 0 0 0 0 0 0 0 0 0 0 0 
-58531 133561 19480 0 0 0 0 0 0 0 0 0 0 0 0 0 
-118342 193372 -40331 -59811 0 0 0 0 0 0 0 0 0 0 0 0 
93692 147713 5328 0 0...

result:

ok 

Test #22:

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

input:

10
2 6 42660
5 6 45480
9 1 73208
3 4 48334
1 7 85607
4 8 26872
4 10 38398
6 4 56313
4 1 34234

output:

16
34234 -34234 0 26872 0 0 0 0 0 0 0 0 0 0 0 0 
-98973 98973 -98973 -15788 0 0 0 0 0 0 0 0 0 0 0 0 
48334 48334 -48334 26872 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 26872 0 0 0 0 0 0 0 0 0 0 0 0 
-101793 101793 -101793 72352 -45480 0 0 0 0 0 0 0 0 0 0 0 
-56313 56313 -56313 26872 0 0 0 0 0 0 0 0 0 0 0 0 
11...

result:

ok 

Test #23:

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

input:

14
1 8 99172
5 14 84394
3 14 7875
8 11 46747
11 12 91464
1 10 41274
4 3 51473
12 9 99888
13 14 48591
6 3 42998
12 7 9735
2 11 62362
12 3 24208

output:

16
261591 -237383 -145919 -47699 0 0 0 0 0 0 0 0 0 0 0 0 
178034 -153826 62362 -10889 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 51473 0 0 0 0 0 0 0 0 0 0 0 0 
-51473 -51473 -51473 0 0 0 0 0 0 0 0 0 0 0 0 0 
-92269 92269 -92269 -32921 0 0 0 0 0 0 0 0 0 0 0 0 
-42998 -42998 -42998 94471 -42998 0 0 0 0 0 0 0 0 0 ...

result:

ok 

Test #24:

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

input:

20
12 17 9662
8 18 79403
9 12 39209
12 2 88815
12 4 65532
13 11 55258
15 17 57286
17 10 31472
2 19 39326
20 8 53686
17 5 16764
2 16 79545
12 13 50718
1 14 58728
2 6 50181
20 2 7766
14 11 12309
3 13 18809
14 7 953

output:

16
177013 -88198 -215110 93111 142501 79403 0 0 0 0 0 0 0 0 0 0 
-88815 0 0 7766 53686 79403 0 0 0 0 0 0 0 0 0 0 
69527 19288 -70006 77772 123692 79403 0 0 0 0 0 0 0 0 0 0 
65532 154347 -154347 31049 142501 79403 0 0 0 0 0 0 0 0 0 0 
-26426 115241 -115241 89479 125737 79403 0 0 0 0 0 0 0 0 0 0 
-138...

result:

ok 

Test #25:

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

input:

30
3 5 28796
4 9 10034
22 12 89509
21 8 23277
10 2 3196
4 29 59345
6 20 11469
10 13 51654
10 4 71995
7 12 28072
3 23 52059
7 26 50022
4 6 93782
10 25 13380
16 3 23595
7 9 36250
9 15 83594
11 2 1106
18 24 24090
28 3 42510
27 28 96564
10 8 34047
2 19 97541
10 17 75663
10 3 40752
30 1 16408
24 7 93194
...

output:

16
210965 -92686 -149004 -67500 88272 24090 0 0 0 0 0 0 0 0 0 0 
75191 49480 -13230 -13230 103228 24090 0 0 0 0 0 0 0 0 0 0 
112747 5532 -50786 30718 143980 24090 0 0 0 0 0 0 0 0 0 0 
0 46284 -10034 -10034 103228 24090 0 0 0 0 0 0 0 0 0 0 
141543 -23264 -21990 1922 172776 -4706 0 0 0 0 0 0 0 0 0 0 
...

result:

ok 

Test #26:

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

input:

40
18 39 61594
12 17 36186
37 33 1532
10 6 91806
23 20 60906
19 9 15159
13 38 22702
22 3 60048
28 21 62359
22 25 6011
26 35 43190
34 31 4138
30 12 49058
25 6 89047
31 19 43124
13 4 49436
25 26 41836
25 5 16956
26 14 45706
21 36 68537
12 15 55029
33 27 52251
33 26 88024
34 21 78287
12 32 65664
12 25 ...

output:

16
141228 -131183 -112516 -55465 117376 -45238 0 0 0 0 0 0 0 0 0 0 
158805 -148760 -130093 -73042 -89549 -1221 0 0 0 0 0 0 0 0 0 0 
66059 -56014 -37347 139800 -37346 49436 0 0 0 0 0 0 0 0 0 0 
-194785 -184740 -156028 -72138 -49436 0 0 0 0 0 0 0 0 0 0 0 
16956 -6911 45668 96708 5746 49436 0 0 0 0 0 0...

result:

ok 

Test #27:

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

input:

54
16 26 45496
4 34 82464
15 6 98989
25 42 37516
48 10 11511
52 12 48230
47 34 75909
48 29 62311
53 6 31322
40 31 25243
42 37 43372
26 42 21924
16 5 49734
26 36 43349
47 9 73734
39 41 89591
14 44 22016
34 1 60743
42 49 26617
4 39 29014
34 7 61100
50 2 19720
34 2 64617
43 40 2358
4 8 39665
39 33 9226...

output:

16
60743 -60743 21721 7293 31729 -52413 0 0 0 0 0 0 0 0 0 0 
64617 64617 147081 11167 -93631 8330 0 0 0 0 0 0 0 0 0 0 
-150819 150819 -68355 -141106 -89825 -52481 0 0 0 0 0 0 0 0 0 0 
-82464 -82464 0 29014 -29014 8330 0 0 0 0 0 0 0 0 0 0 
232614 -232614 116951 -87937 -63501 -6917 0 0 0 0 0 0 0 0 0 0...

result:

ok 

Test #28:

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

input:

67
54 2 27000
47 1 56096
16 62 95394
45 33 93374
14 31 20926
41 6 89398
54 24 54732
36 18 64923
58 22 72499
33 40 48515
4 65 42746
40 49 50954
33 4 30319
52 36 28368
65 5 14020
23 20 64887
48 27 91661
17 32 56902
26 3 48451
59 38 38248
17 40 27460
49 57 84654
51 60 42960
24 28 39849
52 58 8142
50 35...

output:

16
33038 2719 59485 40027 -19642 9267 69746 0 0 0 0 0 0 0 0 0 
-164321 -164321 -107555 -107555 -81732 -27000 0 0 0 0 0 0 0 0 0 0 
131859 101540 -44774 105693 -79870 -50961 132693 0 0 0 0 0 0 0 0 0 
0 0 56766 42746 -16923 11986 69746 0 0 0 0 0 0 0 0 0 
-56766 -56766 0 0 25823 54732 27000 0 0 0 0 0 0 ...

result:

ok 

Test #29:

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

input:

73
52 70 80451
44 32 1449
6 14 82173
24 38 56605
49 4 83134
2 53 62244
70 16 68371
69 50 60868
39 67 42364
17 19 94331
60 11 94001
71 51 91350
56 21 12570
30 73 2299
23 58 71318
71 72 78176
73 4 917
4 33 70353
40 20 30654
1 36 24366
8 10 59530
58 25 14218
1 67 45255
36 12 68333
47 40 12406
61 11 837...

output:

16
162022 6557 7138 79800 -131617 34021 93039 0 0 0 0 0 0 0 0 0 
71615 130232 97545 -43875 -41210 91579 31253 0 0 0 0 0 0 0 0 0 
244620 350927 351508 -264570 -166866 -55600 -38648 0 0 0 0 0 0 0 0 0 
-121439 156710 16585 70353 50355 20876 82339 0 0 0 0 0 0 0 0 0 
-295612 -158169 -71231 -71231 -20876 ...

result:

ok 

Test #30:

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

input:

87
49 25 39368
24 2 71698
58 17 91578
30 86 33561
78 43 11951
15 8 34603
66 76 61167
83 8 22548
48 63 91658
8 51 13731
70 3 61233
9 29 72302
63 21 52219
53 72 43756
56 13 78626
13 65 23833
8 11 91619
8 84 84693
64 8 51042
85 6 7205
40 68 60611
42 16 39505
59 50 94034
17 9 31620
72 78 73852
61 52 429...

output:

16
139462 248591 -34670 -174578 -12572 -231040 -14667 41570 0 0 0 0 0 0 0 0 
-328032 227577 -223240 -155336 133275 -133275 6928 41570 0 0 0 0 0 0 0 0 
137285 246414 -32493 -172401 -242077 -228863 17393 41570 0 0 0 0 0 0 0 0 
150673 -41544 17359 -25917 -161233 -129001 17495 41570 0 0 0 0 0 0 0 0 
-10...

result:

ok 

Test #31:

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

input:

2
2 1 27833

output:

16
27833 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok 

Test #32:

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

input:

81
7 79 7136
79 21 33814
76 73 11348
18 9 98679
19 21 80484
25 68 85491
67 3 73962
63 61 99432
42 5 25124
71 45 29653
59 20 15283
42 21 8926
59 38 74175
23 49 57772
22 8 58928
13 57 35851
26 19 60247
8 1 41995
36 45 4771
60 68 9248
56 4 19565
45 7 26690
34 63 89165
18 79 19662
7 47 2497
16 73 75362
...

output:

16
244191 -210377 -17050 161186 -25392 23064 -39894 55026 0 0 0 0 0 0 0 0 
114271 148085 -99812 -4700 -46220 88937 67494 55026 0 0 0 0 0 0 0 0 
-373360 -339546 301827 -290479 -183465 -57255 152156 55026 0 0 0 0 0 0 0 0 
166854 -133040 99417 128709 -57869 16411 2101 55026 0 0 0 0 0 0 0 0 
-67864 -340...

result:

ok 

Test #33:

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

input:

100
66 20 64331
71 93 56075
94 37 24424
22 86 23870
43 97 27051
14 51 1989
87 75 50829
58 16 63588
100 73 26141
90 52 14995
35 49 5213
86 12 47936
25 5 6213
26 87 51404
73 9 40063
37 72 57353
59 8 79465
7 4 11042
89 33 19830
100 51 63700
44 63 36365
25 63 78125
83 20 27081
73 40 90964
54 26 96279
3 ...

output:

16
192299 -189140 204204 -59206 53018 109982 -4590 -75593 0 0 0 0 0 0 0 0 
-135756 -132597 89071 89201 -89071 -37667 50829 0 0 0 0 0 0 0 0 0 
115357 118516 -74990 -161912 -48849 8873 -81913 0 0 0 0 0 0 0 0 0 
235707 -232548 9610 -172019 91391 34389 71003 0 0 0 0 0 0 0 0 0 
-87497 -84338 127864 -1277...

result:

ok 

Test #34:

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

input:

100
56 22 62377
58 55 65266
65 51 8075
82 30 63128
41 65 98262
63 75 73348
26 78 78308
69 73 83265
32 35 51859
75 66 18818
82 23 90696
42 79 31835
38 87 46601
74 40 62693
65 64 78114
56 75 89854
39 11 40514
40 9 81703
9 92 22171
72 73 22340
56 98 67781
62 85 42175
24 83 27835
5 42 51782
38 27 54236
...

output:

16
286427 181628 397042 32729 -126840 -10285 172858 0 0 0 0 0 0 0 0 0 
-230912 386837 -120297 -57094 41367 -93256 75933 0 0 0 0 0 0 0 0 0 
253831 149032 364446 65325 -94244 42355 162836 0 0 0 0 0 0 0 0 0 
-76625 79300 187240 -18193 35009 -86898 172858 0 0 0 0 0 0 0 0 0 
-6971 162896 103644 65403 -48...

result:

ok 

Test #35:

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

input:

100
37 33 60423
81 66 7160
16 11 67535
1 39 78194
31 45 4065
20 66 44706
82 75 5786
32 97 78750
79 37 77577
69 1 88048
66 28 33075
13 94 72629
41 92 54285
17 1 73982
78 54 16165
10 88 22354
15 18 44666
12 84 11147
35 64 319
68 28 80980
28 57 31900
49 55 30418
15 30 38989
20 31 45304
13 99 12193
57 7...

output:

16
183019 105715 -386027 -14214 64673 -138264 -5519 93567 0 0 0 0 0 0 0 0 
134221 154513 -337229 34584 191971 -10966 -132817 54317 0 0 0 0 0 0 0 0 
248568 537302 -472823 50920 17256 -61751 -93567 93567 0 0 0 0 0 0 0 0 
-481596 -192862 -192862 -35788 -4362 0 0 0 0 0 0 0 0 0 0 0 
173633 462367 -397888...

result:

ok 

Test #36:

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

input:

100
62 53 23877
7 67 40543
67 71 83890
13 34 25964
67 2 75276
57 9 50657
63 37 33265
50 57 74236
4 62 70592
27 62 24574
67 54 10045
100 67 56527
74 67 94674
72 57 52568
87 62 86921
97 62 54855
1 67 48819
32 67 73295
67 5 78468
57 20 39621
54 55 96020
25 16 61764
85 52 15551
70 67 6122
57 63 2854
28 ...

output:

16
153263 198331 -100693 100693 100693 2878 193558 -48819 0 0 0 0 0 0 0 0 
29168 74236 -74236 74236 74236 -23579 69463 0 0 0 0 0 0 0 0 0 
203746 248814 -50210 50210 50210 150999 45437 -99302 99302 0 0 0 0 0 0 0 
182446 -79042 -161134 161134 161134 -77865 -34319 -33190 0 0 0 0 0 0 0 0 
182912 227980 ...

result:

ok 

Test #37:

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

input:

100
96 51 21924
11 98 49734
19 100 43349
96 29 73734
26 37 89591
91 84 22016
47 68 60743
75 10 26617
93 14 29014
89 60 61100
15 50 19720
78 85 64617
19 33 2358
53 22 39665
17 55 92268
92 86 63163
16 3 9867
83 51 2739
97 34 80808
63 64 98261
90 53 84331
50 26 50006
94 64 83601
3 90 23836
47 20 60811
...

output:

16
99186 1997 127282 90623 -42951 163281 -43004 49615 0 0 0 0 0 0 0 0 
-79700 135935 -51604 71137 135935 -15605 56182 72089 0 0 0 0 0 0 0 0 
-32399 23836 60495 23836 23836 39665 56182 72089 0 0 0 0 0 0 0 0 
-79794 120091 -35760 71231 -23559 135920 -15643 72089 0 0 0 0 0 0 0 0 
90721 146956 -62625 -8...

result:

ok 

Test #38:

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

input:

100
29 77 44162
71 20 58925
60 11 27000
59 97 56096
48 31 95394
13 99 93374
16 62 20926
53 32 89398
3 85 54732
71 30 64923
9 80 72499
98 95 48515
73 54 42746
53 9 50954
61 2 30319
26 100 28368
77 56 14020
77 41 64887
13 33 91661
34 70 56902
99 91 48451
57 27 38248
61 81 27460
61 22 84654
23 60 42960...

output:

16
171778 171778 304774 -304774 8647 22666 -121154 0 0 0 0 0 0 0 0 0 
32707 -32707 160927 -160927 150546 165190 -23108 0 0 0 0 0 0 0 0 0 
-54732 -54732 187728 -187728 125693 110898 -77840 0 0 0 0 0 0 0 0 0 
-270669 270669 -137673 -403665 -90244 -32122 -23058 -98851 0 0 0 0 0 0 0 0 
-324342 324342 25...

result:

ok 

Test #39:

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

input:

100
52 70 74912
79 46 68115
62 97 19163
63 42 28058
56 42 66605
9 57 64733
52 13 48405
21 68 84883
45 37 80451
7 47 1449
13 71 82173
41 3 56605
12 61 83134
18 25 62244
85 33 68371
36 57 60868
1 6 42364
39 29 94331
13 10 94001
9 7 91350
69 13 12570
83 7 2299
40 34 71318
41 85 78176
94 25 917
86 73 70...

output:

16
114438 292557 -135441 101887 167108 -220318 -89485 0 0 0 0 0 0 0 0 0 
347219 -169100 126350 -118488 372619 -271726 -99970 -52849 0 0 0 0 0 0 0 0 
-138944 152385 117941 77381 -14200 -152220 -103726 0 0 0 0 0 0 0 0 0 
-225750 403869 -77647 442075 254566 -236134 -176943 -84553 24366 0 0 0 0 0 0 0 
1...

result:

ok 

Test #40:

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

input:

100
62 55 72959
99 13 34202
93 51 35518
83 85 75828
21 46 72408
29 93 3388
74 96 75883
81 70 13073
44 73 6169
83 23 70679
74 39 59144
78 11 40503
60 79 90818
86 44 40829
32 84 6422
40 75 93369
15 59 79221
31 74 99583
59 7 72150
5 93 49991
12 7 43986
67 79 90541
86 58 39368
18 78 71698
44 17 91578
38...

output:

16
50691 80202 93147 147132 -107627 -183249 85780 -52219 52219 0 0 0 0 0 0 0 
302845 -273334 40954 -129887 -162456 -241466 51958 -52219 52219 0 0 0 0 0 0 0 
-373943 -344432 -200594 156372 195877 -195877 -35123 0 0 0 0 0 0 0 0 0 
-141193 -111682 255520 208123 -168618 -247628 -25902 -19601 52219 0 0 0...

result:

ok 

Test #41:

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

input:

100
19 45 3709
39 70 43393
54 24 94977
49 71 90894
89 24 10915
73 76 42043
43 38 27554
32 78 46
25 73 99183
15 68 7205
33 63 77331
39 16 14001
30 51 31206
69 13 27927
26 96 1369
85 73 25869
73 53 83374
48 10 94435
46 65 74490
48 26 8631
40 20 40810
15 39 46079
36 51 15930
13 75 32516
13 4 49535
33 1...

output:

16
73432 106491 -37834 -32274 -37834 37834 43290 0 0 0 0 0 0 0 0 0 
-196859 -128202 128202 -122642 -19192 -41022 48449 43590 0 0 0 0 0 0 0 0 
-146569 215226 -35677 41237 146569 -146569 -65445 91123 0 0 0 0 0 0 0 0 
-250448 319105 -250448 67258 109452 -109452 -59534 91123 0 0 0 0 0 0 0 0 
-155341 -86...

result:

ok 

Test #42:

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

input:

100
14 9 45032
64 30 88516
29 61 62092
83 11 60471
97 84 32298
87 57 90134
81 26 5662
1 99 33404
15 34 83812
35 7 98313
36 32 92767
41 40 73666
72 49 45942
89 47 56014
15 54 93649
22 21 72090
8 88 7136
49 73 33814
83 90 11348
31 99 98679
9 1 80484
88 81 85491
9 37 73962
13 95 99432
93 40 25124
55 4 ...

output:

16
245654 438200 -63382 63382 172641 -64173 92549 93044 0 0 0 0 0 0 0 0 
205051 50887 180139 -251841 236436 131398 30330 -36639 -788 0 0 0 0 0 0 0 
-43000 267242 193576 -193576 242797 137759 22393 -43000 0 0 0 0 0 0 0 0 
-327121 -102879 102879 -102879 -53658 -47670 140755 0 0 0 0 0 0 0 0 0 
238629 1...

result:

ok 

Test #43:

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

input:

694
147 589 63460
577 525 24867
168 48 46802
320 49 56053
387 45 50030
394 179 31066
25 137 52761
146 176 47924
156 69 97243
126 78 43246
299 286 98398
63 159 97810
313 340 80398
285 66 74961
471 290 91679
321 672 65088
346 145 22183
63 516 56245
262 479 75583
301 104 92046
678 270 62662
354 287 268...

output:

16
404303 -316341 -416747 407640 -317866 -283994 -219082 164730 99502 -220848 -22592 0 0 0 0 0 
410130 -322168 265398 -246650 -351548 -317676 -63472 -21357 -167170 103043 0 0 0 0 0 0 
-97336 -9374 0 0 71026 -71026 97363 -9160 -132892 11546 0 0 0 0 0 0 
248391 -160429 103659 279583 -189809 208557 -67...

result:

ok 

Test #44:

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

input:

243
112 85 29656
158 90 90481
7 224 74519
234 203 84992
211 163 40562
23 207 2621
32 206 45866
139 137 88564
167 73 28471
233 118 33350
176 54 36866
232 227 54696
212 30 88043
208 192 47939
85 22 4388
203 189 54130
177 71 11667
93 6 57606
102 201 17140
149 28 62053
216 20 48661
145 158 32199
208 140...

output:

16
174597 109815 176176 -109815 -14863 94762 -177287 53891 57701 -11667 0 0 0 0 0 0 
404785 340003 -273642 -242673 -147721 -110335 -169785 -22643 4345 -11667 0 0 0 0 0 0 
297623 232841 -166480 -135511 -40559 -3173 -62623 75625 57701 -11667 0 0 0 0 0 0 
210579 145797 -79436 -48467 143419 16559 -82355...

result:

ok 

Test #45:

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

input:

229
166 193 54447
108 132 97263
156 17 38984
110 43 31667
23 184 79564
108 111 67697
13 31 98378
86 74 74184
178 75 95633
213 19 77916
41 73 4856
216 76 87443
56 108 43031
187 107 39032
150 174 99980
168 195 47899
74 136 46680
82 196 32622
29 14 42559
27 158 93866
49 229 85484
99 61 27912
3 25 81994...

output:

16
262551 -135687 -216207 -57070 -267147 79540 -169816 262322 -35467 0 0 0 0 0 0 0 
267058 -140194 -220714 -61577 -126030 45685 -28699 140386 86469 0 0 0 0 0 0 0 
-243226 370090 -241934 -318002 -201447 -232169 -120020 161179 0 0 0 0 0 0 0 0 
-238661 218557 239953 90401 -212332 54665 -167467 31738 -3...

result:

ok 

Test #46:

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

input:

135
18 110 50257
93 82 38644
88 87 83809
119 60 33528
28 100 98246
16 3 4218
22 10 82711
124 21 9452
48 128 9313
67 4 53331
64 79 47618
37 75 70473
32 113 21071
52 107 89692
3 60 71663
115 123 59213
49 61 47261
57 19 30547
46 50 32041
23 86 63669
131 32 61464
67 116 1076
57 61 14112
44 121 11326
16 ...

output:

16
356880 -259214 377364 383804 -297667 -240592 -211689 -73713 -80705 0 0 0 0 0 0 0 
-161136 -63470 143167 149607 -63470 -6395 -6002 87725 0 0 0 0 0 0 0 0 
137812 235478 -58115 -18147 39042 18033 -38623 120346 0 0 0 0 0 0 0 0 
176695 -79029 68877 75317 117482 -60407 4818 34394 0 0 0 0 0 0 0 0 
-4500...

result:

ok 

Test #47:

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

input:

683
235 104 98616
92 434 23280
474 273 65503
23 560 76232
399 625 51375
95 541 97791
294 464 23918
1 522 35198
90 4 40934
299 644 78673
470 391 33958
630 101 40872
50 323 70111
296 52 95959
3 523 50951
428 463 84150
257 401 65337
551 601 25697
512 668 12532
327 378 62008
386 449 57976
451 411 21345
...

output:

16
401533 -355758 -63405 -51346 423972 -26693 273296 -276024 132839 131578 0 0 0 0 0 0 
-295362 -260336 -132581 116447 263537 -102600 69811 -112555 213064 -65608 -38915 0 0 0 0 0 
-213732 -178706 -50951 67085 80005 -37104 -3181 -39563 140072 7384 0 0 0 0 0 0 
-211101 246127 -83346 -229505 165661 485...

result:

ok 

Test #48:

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

input:

668
60 628 90967
90 181 51755
225 381 51207
351 335 15056
315 299 97634
533 364 80940
27 328 8478
580 222 66561
131 514 68998
408 530 33026
481 46 19385
108 186 21688
16 262 36552
118 532 99424
135 553 10812
368 488 56555
232 515 96909
169 572 86653
653 365 17004
309 571 84879
558 552 3546
374 349 1...

output:

16
301762 -216830 327230 -228150 -165187 -75989 41082 14511 103471 38713 0 0 0 0 0 0 
-148630 233562 174098 -75018 -104112 168130 249930 -51628 -50238 0 0 0 0 0 0 0 
229840 -144908 -139982 227376 -141584 34660 214225 -65463 -57663 0 0 0 0 0 0 0 
-231733 316665 257201 -158121 211575 300773 -65757 -97...

result:

ok 

Test #49:

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

input:

654
253 300 46023
74 450 58055
70 278 34456
466 79 61503
260 552 86524
280 333 15911
392 584 27739
542 112 4504
34 615 67012
621 618 7667
371 82 49159
512 124 7194
233 431 83098
235 541 13140
195 151 71573
191 45 57933
487 20 32085
386 60 61203
423 650 25500
17 252 54298
450 478 15503
30 258 43193
4...

output:

16
318618 -223426 213971 214586 -143865 -232816 -22934 32457 18194 84551 0 0 0 0 0 0 
298359 203167 285476 -212007 88503 -229172 73809 100873 -134360 230785 0 0 0 0 0 0 
-107242 107242 153747 -116082 162101 -89356 211 -170107 292 102453 0 0 0 0 0 0 
229640 -134448 183527 125608 180779 91828 -18467 -...

result:

ok 

Test #50:

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

input:

560
53 332 14502
304 546 51673
536 85 76888
466 391 18058
82 469 83789
209 219 81545
30 430 16897
153 372 31499
93 62 26371
37 97 38332
30 187 22007
288 58 92087
298 34 41813
278 344 64464
82 150 3559
334 547 87083
390 453 91183
271 182 59777
32 323 50174
506 509 43522
176 504 23582
528 62 95406
483...

output:

16
379652 221715 368484 -234696 301867 -185032 19511 -179282 151568 -15533 0 0 0 0 0 0 
217964 60027 206796 -73008 15269 101566 75911 -22945 -4769 -15533 0 0 0 0 0 0 
-219473 219473 302322 203636 -112815 162160 174807 -301133 50883 -33689 0 0 0 0 0 0 
233977 76040 222809 69111 -1342 118177 -65610 -1...

result:

ok 

Test #51:

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

input:

546
206 298 75420
519 234 34209
303 439 91769
541 437 77447
220 441 66144
252 267 66928
427 429 59902
353 199 86893
74 145 4005
227 56 73170
543 33 54988
119 291 920
407 414 13805
516 124 55738
64 228 28358
415 166 96952
43 254 54136
445 132 94198
383 185 5931
197 462 65982
210 191 17224
122 352 918...

output:

16
367217 -312042 -294369 66797 229874 -23862 210862 -59014 -114386 28358 0 0 0 0 0 0 
276527 141746 -233377 -243492 83910 86196 -86196 86196 140857 114554 0 0 0 0 0 0 
-392753 -337578 380728 370613 -262450 -268037 -164645 -109075 98292 78051 0 0 0 0 0 0 
81132 136307 124282 114167 -6004 81132 -8113...

result:

ok 

Test #52:

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

input:

763
384 629 2722
249 734 76525
750 364 69562
269 516 98782
582 366 79581
16 142 27573
263 43 13588
59 194 11024
212 64 73238
537 484 8035
252 459 98546
731 106 23446
416 552 2794
381 658 4901
213 544 64530
336 286 56704
395 169 27669
618 231 47977
693 211 69456
246 65 32408
338 109 76053
180 216 929...

output:

16
291550 -189464 -289243 207552 252024 -133820 101525 -237699 -129431 65686 68087 0 0 0 0 0 
-209494 -141407 -105012 189085 -78847 177553 -105012 -55652 -78262 27573 0 0 0 0 0 0 
-125713 -57626 94021 105304 4934 166562 -57626 -57626 -55556 22113 0 0 0 0 0 0 
-252467 -184380 220775 -136702 25265 225...

result:

ok 

Test #53:

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

input:

1000
572 527 49791
32 218 21645
179 931 16785
754 301 86556
672 38 96080
467 218 14665
428 774 53050
137 701 5302
388 302 17617
730 111 39815
846 797 27547
804 631 51043
606 548 72483
772 42 87127
767 396 14101
584 651 67827
391 898 45509
529 757 87851
822 6 24457
503 796 74359
529 835 61147
507 782...

output:

16
531787 -443413 363161 336290 270161 60920 150598 -132070 -242731 138461 36806 0 0 0 0 0 
-776926 865300 400860 -618073 657618 -125155 210764 -468195 -46240 632 -38843 0 0 0 0 0 
-702757 791131 -560879 -145328 637515 -105052 337911 -303230 320494 210747 116400 0 0 0 0 0 
-448419 -360045 -129793 -5...

result:

ok 

Test #54:

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

input:

1000
481 332 23354
796 115 6792
367 308 46007
157 330 34563
717 189 44526
4 187 88056
862 216 76013
111 814 3711
457 772 76852
376 259 47169
786 571 72024
963 715 53630
753 74 80513
267 378 66504
901 493 41644
308 869 67462
749 281 26985
898 505 83442
560 988 84702
40 784 5179
81 874 57506
599 855 3...

output:

16
349256 -116146 185389 -73006 80205 -42024 246593 -97965 411708 -112594 58023 -88967 0 0 0 0 
-473570 643977 -182115 -503897 683320 -107687 330819 -468 119329 -160078 104551 -88967 0 0 0 0 
-925095 -754688 -388262 437444 -4553 404524 153124 -8191 55839 -181139 155300 -149519 0 0 0 0 
591966 537384...

result:

ok 

Test #55:

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

input:

1000
145 580 53814
865 339 48835
274 748 18333
25 232 15274
556 862 92973
685 265 28743
117 479 23168
758 677 2119
467 479 3383
474 461 21820
19 846 92308
41 704 56217
901 897 45439
833 490 78586
379 630 93378
853 941 34393
553 624 43053
479 843 79034
141 847 69138
246 290 92896
94 365 62378
37 843 ...

output:

16
355270 -68685 463559 -440694 -105286 -32628 428636 -79687 96659 43755 -26330 0 0 0 0 0 
815185 -528600 -28050 -932303 -40145 384903 -20589 -128009 297495 -65986 58888 0 0 0 0 0 
670036 -383451 428457 -787154 114458 113038 435918 -118305 276057 19194 29925 -45829 0 0 0 0 
-162961 287406 448921 -21...

result:

ok 

Test #56:

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

input:

1000
526 58 51569
793 638 58173
402 205 47555
92 813 95985
977 807 8715
230 417 69430
983 72 46131
214 629 528
428 709 29914
752 765 29174
739 312 36785
58 56 26101
762 987 53469
141 447 57963
786 328 12408
624 985 58221
765 438 24528
560 444 74625
89 607 29383
922 450 91013
558 791 67249
482 582 63...

output:

16
771405 98455 1290458 -987625 -24995 312515 -533662 131641 219038 40595 51300 -71301 0 0 0 0 
-833873 -784431 -215936 -174815 192870 363866 -82213 124460 54252 -11886 -82611 -85443 0 0 0 0 
-645196 694638 640527 167264 -746164 726058 -271263 -18059 355528 -302371 355877 -91528 0 0 0 0 
-942488 991...

result:

ok 

Test #57:

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

input:

1000
310 311 49325
143 789 43320
622 205 76776
194 634 43992
790 203 81353
354 477 42821
752 888 25990
50 384 23128
116 918 80637
466 627 3825
203 96 13966
748 419 52880
443 11 85691
284 649 37340
355 165 7247
567 615 92448
376 216 73300
547 4 13321
898 19 46523
941 134 21833
327 119 72120
917 419 7...

output:

16
237599 649920 -222658 320591 205183 -374964 308716 -382884 200414 236948 -23803 -17183 0 0 0 0 
206852 619173 -253405 351338 174436 -344217 339463 -312187 220389 256923 -43778 -37158 0 0 0 0 
-723847 -311526 469766 -371833 15339 279787 358714 -297849 223606 -172018 185189 0 0 0 0 0 
-571798 -1594...

result:

ok 

Test #58:

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

input:

1000
940 310 47081
77 619 52659
444 641 49102
410 343 24703
211 70 29799
632 42 16212
327 108 16249
878 69 88833
122 981 39872
581 204 35371
687 399 34250
860 194 55467
878 574 93722
114 388 49422
78 221 91685
380 457 92083
133 941 78968
5 182 8913
984 572 74064
164 8 76846
638 941 76992
905 46 9540...

output:

16
556064 767512 -574656 -189824 333688 -93732 263018 163349 327383 225067 50922 0 0 0 0 0 
-364314 261425 318489 -38419 -312889 191806 -81135 -118782 -18276 61550 0 0 0 0 0 0 
-117068 211689 -18833 -102019 -88681 140709 -85462 -22965 77541 -23010 0 0 0 0 0 0 
-497409 394520 451584 -397964 -5099 -42...

result:

ok 

Test #59:

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

input:

1000
108 997 44836
619 32 37806
927 40 78324
385 920 72711
439 640 45541
312 295 32707
81 664 63404
232 726 54538
852 892 66403
538 728 77318
779 372 46023
287 126 58055
103 8 34456
961 927 61503
887 327 86524
491 412 15911
310 116 27739
295 473 4504
770 711 67012
264 553 7667
833 443 49159
452 989 ...

output:

16
242962 228546 -133039 -139078 -136950 264749 -279855 -52812 161810 136246 -111998 72890 0 0 0 0 
-254858 254858 -58015 -64054 346454 443979 55046 -210210 188647 -20578 -75744 72890 0 0 0 0 
-219577 -219577 -124070 208327 60617 158142 -152966 158062 159362 92306 -144753 72890 0 0 0 0 
-442062 -442...

result:

ok 

Test #60:

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

input:

1000
597 155 18400
957 263 79848
925 963 74842
909 282 20718
635 942 85475
486 717 73394
218 625 86367
922 614 52946
789 154 17126
988 664 84672
290 658 90499
910 126 60642
526 94 66678
44 168 40881
51 912 38258
657 27 82842
414 792 76511
247 799 96
361 15 51449
154 708 5784
193 736 78223
72 293 516...

output:

16
412651 -3094 -524764 -131436 -15129 -181629 -68222 -108806 -89785 -228499 58852 0 0 0 0 0 
-449709 413431 -341043 -172034 224601 -12141 -279086 -50769 -1557 -99034 4723 0 0 0 0 0 
-370465 210145 -137757 236358 -183791 60383 -199842 47279 -79102 14468 0 0 0 0 0 0 
-647547 370785 344431 -245830 298...

result:

ok 

Test #61:

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

input:

1000
913 774 48859
357 308 89187
690 238 36768
481 612 1429
608 576 33921
596 376 46785
587 610 33522
880 450 75547
106 851 43657
632 552 59323
474 22 34976
566 967 63229
318 306 74708
196 648 52962
75 420 89992
587 701 82478
442 622 25283
80 369 95688
726 176 11693
557 761 93500
568 259 50390
851 6...

output:

16
687703 -414609 525139 -329119 98381 314136 371012 -119493 -374993 123656 -9838 0 0 0 0 0 
-541669 -268575 158045 86314 265400 -181527 -178674 67400 -11473 62385 -102498 0 0 0 0 0 
-75768 197326 -86796 -40213 194151 218620 64870 74461 -80681 -121597 -9838 0 0 0 0 0 
520562 -247468 -157422 69651 50...

result:

ok 

Test #62:

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

input:

1000
464 300 12241
235 153 95587
674 581 76496
816 482 85201
257 852 75969
172 296 2281
541 492 92534
693 873 27794
788 311 89426
324 594 99692
340 2 94989
739 35 17608
781 197 5041
240 520 54475
762 786 8224
653 125 34640
395 104 74795
701 155 39491
548 156 55004
15 622 22118
759 672 50861
284 689 ...

output:

16
825188 -494422 -71472 -574518 -131626 -797580 -226193 633535 233233 -314401 8607 -138248 0 0 0 0 
414700 745466 -541660 505666 31447 -704745 240252 241679 -206760 -289930 -244824 -127457 0 0 0 0 
-486241 355153 -151347 -47367 450888 -291839 112024 36588 27935 83665 57941 0 0 0 0 0 
389688 -58922 ...

result:

ok 

Extra Test:

score: 0
Extra Test Passed