QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#243080#7151. Tree embedding8BQubeAC ✓3ms4472kbC++203.5kb2023-11-07 20:47:472023-11-07 20:47:47

Judging History

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

  • [2023-11-07 20:47:47]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:4472kb
  • [2023-11-07 20:47:47]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
constexpr int kN = 1024;
struct Edge {
    int uv, w, id;
} E[kN];
vector<int> G[kN];
vector<pii> H[16][kN];
int sz[kN];
void get_cent(int u, int f, int &mx, int &c, int num, int mask, int subid) {
    int mxsz = 0;
    sz[u] = 1;
    for (int i : G[u]) {
        const int v = E[i].uv ^ u, id = E[i].id;
        if (v == f || (id & mask) != subid) continue;
        get_cent(v, u, mx, c, num, mask, subid);
        sz[u] += sz[v], mxsz = max(mxsz, sz[v]);
    }
    int tmp = max(mxsz, num - sz[u]);
    if (mx > tmp) mx = tmp, c = u;
}
void H_addedge(int u, int i, int layer, int neg) {
    const int v = E[i].uv ^ u, w = E[i].w;
    E[i].id |= neg << layer;
    if (neg) {
        H[layer][u].emplace_back(v, -w);
        H[layer][v].emplace_back(u, +w);
    } else {
        H[layer][u].emplace_back(v, +w);
        H[layer][v].emplace_back(u, -w);
    }
}
void dfs(int u, int f, int layer, int mask, int subid, int neg) {
    for (int i : G[u]) {
        const int v = E[i].uv ^ u;
        if (v == f || (E[i].id & mask) != subid) continue;
        H_addedge(u, i, layer, neg);
        dfs(v, u, layer, mask, subid, neg);
    }
}
void cut(int u, int num, int layer, int mask, int subid) {
    if (num <= 2) return;
    int mx = 1e9, c = 0;
    get_cent(u, 0, mx, c, num, mask, subid);
    assert(sz[u] == num);
    pair<int, vector<int>> s[3];
    for (int i : G[c]) {
        const int v = E[i].uv ^ c;
        if ((E[i].id & mask) != subid) continue;
        const int szv = sz[v] > sz[c] ? num - sz[c] : sz[v];
        int pos = 1;
        if (s[1].first) pos = 2;
        else if (s[0].first + szv <= num / 2) pos = 0;
        s[pos].first += szv;
        s[pos].second.push_back(i);
    }
    sort(s, s + 3);
    assert(s[0].first + s[1].first);
    for (int j = 0; j < 3; ++j) {
        for (int i : s[j].second) {
            int neg = j == 2;
            H_addedge(c, i, layer, neg);
            dfs(E[i].uv ^ c, c, layer, mask, subid, neg);
        }
    }
    cut(c, s[0].first + s[1].first + 1, layer + 1, mask * 2 + 1, subid);
    cut(c, s[2].first + 1, layer + 1, mask * 2 + 1, subid | (1 << layer));
}
int embedding[kN][16];
bool vis[kN];
void solve(int n) {
    if (n == 2) {
        cout << "1\n0\n" << E[1].w << '\n';
        exit(0);
    }
    cut(1, n, 0, 0, 0);
    for (int l = 0; l < 16; ++l) {
        fill_n(vis + 1, n, false);
        queue<int> q;
        vis[1] = true, q.push(1);
        while (!q.empty()) {
            int u = q.front(); q.pop();
            for (auto [v, w] : H[l][u]) {
                if (vis[v]) continue;
                embedding[v][l] = embedding[u][l] + w;
                vis[v] = true, q.push(v);
            }
            for (int i : G[u]) {
                const int v = E[i].uv ^ u;
                if (vis[v]) continue;
                embedding[v][l] = embedding[u][l];
                vis[v] = true, q.push(v);
            }
        }
    }
    cout << 16 << '\n';
    for (int u = 1; u <= n; ++u) {
        for (int l = 0; l < 16; ++l) {
            cout << embedding[u][l] << " \n"[l == 15];
        }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    for (int i = 1; i < n; ++i) {
        int u, v, w;
        cin >> u >> v >> w;
        E[i] = {u ^ v, w, 0};
        G[u].push_back(i);
        G[v].push_back(i);
    }
    solve(n);
    return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
1 2 2

output:

1
0
2

result:

ok 

Test #2:

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

input:

4
1 2 1
1 3 1
1 4 1

output:

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

result:

ok 

Test #3:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
100398 -11988 -100398 -48876 0 0 0 0 0 0 0 0 0 0 0 0
179091 66705 -21705 -48876 0 0 0 0 0 0 0 0 0 0 0 0
-3981 -116367 -116367 -4671 0 0 0 0 0 0 0 0 0 0 0 0
51522 -51522 -51522 0 0 0 0 0 0 0 0 0 0 0 0 0
169546 -81136 -169546 -48876 0 0 0 0 0 0 0 0 0 0 0 0
153953 415...

result:

ok 

Test #4:

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

input:

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

output:

16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-99813 99813 99813 0 0 0 0 0 0 0 0 0 0 0 0 0
-15230 15230 184396 0 0 0 0 0 0 0 0 0 0 0 0 0
-185141 185141 14485 0 0 0 0 0 0 0 0 0 0 0 0 0
-264848 264848 -65222 0 0 0 0 0 0 0 0 0 0 0 0 0
-30290 169336 99813 0 0 0 0 0 0 0 0 0 0 0 0 0
-360502 360502 -65222 0 0 0 0 0 0...

result:

ok 

Test #5:

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

input:

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

output:

16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-218493 126765 -218493 0 0 0 0 0 0 0 0 0 0 0 0 0
-81630 81630 -81630 0 0 0 0 0 0 0 0 0 0 0 0 0
-172629 172629 -172629 0 0 0 0 0 0 0 0 0 0 0 0 0
23477 186737 -151950 0 0 0 0 0 0 0 0 0 0 0 0 0
-194789 194789 -172629 0 0 0 0 0 0 0 0 0 0 0 0 0
-11310 151950 -151950 0 0...

result:

ok 

Test #6:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
90777 90777 -90777 0 0 0 0 0 0 0 0 0 0 0 0 0
278543 278543 -82767 0 0 0 0 0 0 0 0 0 0 0 0 0
239096 93380 -239096 0 0 0 0 0 0 0 0 0 0 0 0 0
264178 264178 -68402 0 0 0 0 0 0 0 0 0 0 0 0 0
71334 71334 -71334 0 0 0 0 0 0 0 0 0 0 0 0 0
166238 166238 -166238 0 0 0 0 0 0 ...

result:

ok 

Test #7:

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

input:

2
1 2 20340

output:

1
0
20340

result:

ok 

Test #8:

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

input:

2
2 1 51883

output:

1
0
51883

result:

ok 

Test #9:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
85422 -85422 -78862 0 0 0 0 0 0 0 0 0 0 0 0 0
114804 -56040 -49480 0 0 0 0 0 0 0 0 0 0 0 0 0
210649 39805 -49480 0 0 0 0 0 0 0 0 0 0 0 0 0
95444 -95444 -88884 0 0 0 0 0 0 0 0 0 0 0 0 0
65751 -65751 -59191 0 0 0 0 0 0 0 0 0 0 0 0 0
3280 -3280 3280 0 0 0 0 0 0 0 0 0 ...

result:

ok 

Test #10:

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

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
56998 -56998 56998 0 0 0 0 0 0 0 0 0 0 0 0 0
-50655 50655 -50655 0 0 0 0 0 0 0 0 0 0 0 0 0
33264 33264 -33264 0 0 0 0 0 0 0 0 0 0 0 0 0
79441 79441 -79441 0 0 0 0 0 0 0 0 0 0 0 0 0
-23007 23007 -23007 0 0 0 0 0 0 0 0 0 0 0 0 0
-71340 -71340 71340 0 0 0 0 0 0 0 0 0 ...

result:

ok 

Test #11:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-228776 228776 -228776 -21009 0 0 0 0 0 0 0 0 0 0 0 0
-59265 59265 -178887 -80820 0 0 0 0 0 0 0 0 0 0 0 0
-13679 224473 -224473 -21009 0 0 0 0 0 0 0 0 0 0 0 0
-194106 44046 -44046 -21009 0 0 0 0 0 0 0 0 0 0 0 0
-191759 191759 -191759 -21009 0 0 0 0 0 0 0 0 0 0 0 0
...

result:

ok 

Test #12:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
193049 21835 -158815 -85607 0 0 0 0 0 0 0 0 0 0 0 0
73208 73208 -73208 0 0 0 0 0 0 0 0 0 0 0 0 0
209235 209235 28585 0 0 0 0 0 0 0 0 0 0 0 0 0
155776 59108 -121542 48334 0 0 0 0 0 0 0 0 0 0 0 0
163755 163755 -16895 0 0 0 0 0 0 0 0 0 0 0 0 0
202153 202153 -55293 0 0...

result:

ok 

Test #13:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
36963 -36963 36963 0 0 0 0 0 0 0 0 0 0 0 0 0
-6256 6256 80182 0 0 0 0 0 0 0 0 0 0 0 0 0
-37059 -120327 -46401 -78693 0 0 0 0 0 0 0 0 0 0 0 0
128494 45226 12042 0 0 0 0 0 0 0 0 0 0 0 0 0
-27514 -110782 -36856 69148 0 0 0 0 0 0 0 0 0 0 0 0
101808 -101808 92466 0 0 0 ...

result:

ok 

Test #14:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-213635 -51259 -51259 0 0 0 0 0 0 0 0 0 0 0 0 0
-217775 -217775 -217775 -85328 0 0 0 0 0 0 0 0 0 0 0 0
-118591 -146303 -146303 0 0 0 0 0 0 0 0 0 0 0 0 0
26131 26131 -165177 0 0 0 0 0 0 0 0 0 0 0 0 0
-132447 -132447 -132447 0 0 0 0 0 0 0 0 0 0 0 0 0
-232260 -232260 ...

result:

ok 

Test #15:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
90999 90999 -90999 0 0 0 0 0 0 0 0 0 0 0 0 0
116419 65579 -116419 -25420 0 0 0 0 0 0 0 0 0 0 0 0
207183 207183 -207183 45864 0 0 0 0 0 0 0 0 0 0 0 0
-16080 198078 -53494 0 0 0 0 0 0 0 0 0 0 0 0 0
136863 136863 -136863 45864 0 0 0 0 0 0 0 0 0 0 0 0
56212 125786 -125...

result:

ok 

Test #16:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-17362 46092 46092 0 0 0 0 0 0 0 0 0 0 0 0 0
43734 107188 -43734 0 0 0 0 0 0 0 0 0 0 0 0 0
-104585 104585 104585 0 0 0 0 0 0 0 0 0 0 0 0 0
-129615 -66161 129615 0 0 0 0 0 0 0 0 0 0 0 0 0
-46616 16838 16838 14889 0 0 0 0 0 0 0 0 0 0 0 0
-103061 103061 -39607 0 0 0 0...

result:

ok 

Test #17:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-39597 156443 -156443 -98020 0 0 0 0 0 0 0 0 0 0 0 0
187208 187208 -111698 0 0 0 0 0 0 0 0 0 0 0 0 0
-138961 255807 -57079 -98020 0 0 0 0 0 0 0 0 0 0 0 0
-41605 158451 -158451 -98020 0 0 0 0 0 0 0 0 0 0 0 0
52348 52348 -64498 6075 0 0 0 0 0 0 0 0 0 0 0 0
96178 9617...

result:

ok 

Test #18:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-16000 16000 -16000 0 0 0 0 0 0 0 0 0 0 0 0 0
-15601 16399 -16399 0 0 0 0 0 0 0 0 0 0 0 0 0
-9143 22857 -9941 0 0 0 0 0 0 0 0 0 0 0 0 0
-46580 -14580 -46580 30580 0 0 0 0 0 0 0 0 0 0 0 0
-78961 78961 46961 0 0 0 0 0 0 0 0 0 0 0 0 0
-165822 165822 133822 0 0 0 0 0 0...

result:

ok 

Test #19:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-41698 83244 -41698 51720 0 0 0 0 0 0 0 0 0 0 0 0
-51720 73222 -51720 51720 0 0 0 0 0 0 0 0 0 0 0 0
-122762 2180 -91853 62471 0 0 0 0 0 0 0 0 0 0 0 0
-189225 -64283 33374 62471 0 0 0 0 0 0 0 0 0 0 0 0
18279 -18279 18279 0 0 0 0 0 0 0 0 0 0 0 0 0
3280 -3280 -3280 -3...

result:

ok 

Test #20:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
186839 -65015 -98279 -54587 0 0 0 0 0 0 0 0 0 0 0 0
99766 99766 62628 38854 0 0 0 0 0 0 0 0 0 0 0 0
155259 -33435 -66699 23007 0 0 0 0 0 0 0 0 0 0 0 0
-18529 -18529 73825 0 0 0 0 0 0 0 0 0 0 0 0 0
60912 60912 27648 0 0 0 0 0 0 0 0 0 0 0 0 0
154827 154827 121563 369...

result:

ok 

Test #21:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
194106 -194106 54021 -75030 0 0 0 0 0 0 0 0 0 0 0 0
119076 -119076 -21009 0 0 0 0 0 0 0 0 0 0 0 0 0
98067 -98067 0 0 0 0 0 0 0 0 0 0 0 0 0 0
177607 -60545 37522 -58531 0 0 0 0 0 0 0 0 0 0 0 0
237418 -734 97333 -58531 0 0 0 0 0 0 0 0 0 0 0 0
25384 -170750 72683 0 0 ...

result:

ok 

Test #22:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
133207 -64739 -98973 42660 0 0 0 0 0 0 0 0 0 0 0 0
82568 82568 -48334 48334 0 0 0 0 0 0 0 0 0 0 0 0
34234 34234 0 0 0 0 0 0 0 0 0 0 0 0 0 0
136027 -67559 -101793 -45480 0 0 0 0 0 0 0 0 0 0 0 0
90547 -22079 -56313 0 0 0 0 0 0 0 0 0 0 0 0 0
-85607 -85607 -85607 0 0 0...

result:

ok 

Test #23:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
83557 -83557 -208281 -9937 0 0 0 0 0 0 0 0 0 0 0 0
261591 -261591 -78663 -39039 0 0 0 0 0 0 0 0 0 0 0 0
313064 -210118 -130136 12434 0 0 0 0 0 0 0 0 0 0 0 0
353860 -353860 -155182 53230 0 0 0 0 0 0 0 0 0 0 0 0
304589 -218593 -121661 -82037 0 0 0 0 0 0 0 0 0 0 0 0
2...

result:

ok 

Test #24:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
265828 -88198 -148372 13238 0 0 0 0 0 0 0 0 0 0 0 0
107486 -145104 9970 -145104 0 0 0 0 0 0 0 0 0 0 0 0
111481 -242545 -125089 -10045 0 0 0 0 0 0 0 0 0 0 0 0
203439 -203439 -33131 -68475 9662 0 0 0 0 0 0 0 0 0 0 0
316009 -38017 -98191 63419 0 0 0 0 0 0 0 0 0 0 0 0
...

result:

ok 

Test #25:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-135774 142166 135774 142166 -50754 0 0 0 0 0 0 0 0 0 0 0
-98218 98218 98218 98218 -13198 0 0 0 0 0 0 0 0 0 0 0
-210965 210965 66975 210965 -125945 0 0 0 0 0 0 0 0 0 0 0
-69422 69422 127014 69422 15598 0 0 0 0 0 0 0 0 0 0 0
-304747 117183 160757 304747 -219727 0 0 ...

result:

ok 

Test #26:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-17577 -17577 -17577 -206925 -17577 0 0 0 0 0 0 0 0 0 0 0
75169 75169 195265 5917 195265 0 0 0 0 0 0 0 0 0 0 0
336013 336013 336013 114553 -37213 -88028 0 0 0 0 0 0 0 0 0 0
124272 158184 124272 -77098 146162 0 0 0 0 0 0 0 0 0 0 0
52181 230275 52181 28905 40159 8904...

result:

ok 

Test #27:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
125360 3874 3874 -125360 -125360 125360 0 0 0 0 0 0 0 0 0 0
211562 90076 -211562 90076 90076 24425 0 0 0 0 0 0 0 0 0 0
143207 -143207 21721 -143207 -143207 143207 0 0 0 0 0 0 0 0 0 0
-171871 171871 18589 -171871 80879 -4238 0 0 0 0 0 0 0 0 0 0
160150 38664 38664 38...

result:

ok 

Test #28:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
197359 -136721 136721 -111867 -83827 20470 0 0 0 0 0 0 0 0 0 0
-98821 98821 104259 21635 -27073 62947 0 0 0 0 0 0 0 0 0 0
33038 27600 -27600 -33038 -33038 -30319 0 0 0 0 0 0 0 0 0 0
89804 -29166 29166 -4312 23728 -87085 0 0 0 0 0 0 0 0 0 0
61852 56414 -56414 -61852...

result:

ok 

Test #29:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-90407 -123675 33165 90407 -98863 -90407 -33165 0 0 0 0 0 0 0 0 0
82598 -344370 -220798 344370 130288 -274469 -16531 0 0 0 0 0 0 0 0 0
-283461 -119017 -159889 -21689 69379 -119017 -16531 0 0 0 0 0 0 0 0 0
-457634 195862 154990 119314 243552 -120476 -66886 0 0 0 0 0...

result:

ok 

Test #30:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-467494 21014 188570 168920 -119728 302884 130335 0 0 0 0 0 0 0 0 0
-2177 2177 -2177 229505 -229505 229505 229505 0 0 0 0 0 0 0 0 0
11211 290135 -290135 365 -142873 -46877 79516 0 0 0 0 0 0 0 0 0
-248591 248591 -39007 30333 16909 166247 19926 0 0 0 0 0 0 0 0 0
-342...

result:

ok 

Test #31:

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

input:

2
2 1 27833

output:

1
0
27833

result:

ok 

Test #32:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
358462 -358462 344190 129920 -260200 31476 106730 0 0 0 0 0 0 0 0 0
617551 129169 531559 -61541 -447569 190317 360639 0 0 0 0 0 0 0 0 0
77337 -77337 116467 116467 -32477 -32477 74472 0 0 0 0 0 0 0 0 0
312055 -244427 312055 312055 -159965 -97279 55143 0 0 0 0 0 0 0 ...

result:

ok 

Test #33:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
328055 -56543 -321737 26575 7591 -94507 -104894 0 0 0 0 0 0 0 0 0
76942 -307656 -307656 99546 21962 -206286 -1597 0 0 0 0 0 0 0 0 0
-43408 43408 43408 -120154 194594 -194594 119001 0 0 0 0 0 0 0 0 0
279796 -104802 -104802 65368 -122292 -55714 -44209 0 0 0 0 0 0 0 0...

result:

ok 

Test #34:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
517339 -256615 517339 401953 -207853 -56017 152815 -89954 0 0 0 0 0 0 0 0
32596 -32596 32596 32596 52640 -32596 0 0 0 0 0 0 0 0 0 0
363052 50922 209802 363052 -80224 136134 75908 0 0 0 0 0 0 0 0 0
293398 -32674 293398 279456 -163820 66480 159504 0 0 0 0 0 0 0 0 0
5...

result:

ok 

Test #35:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-48798 -48798 -48798 48798 -127298 -127298 -127298 0 0 0 0 0 0 0 0 0
65549 -431587 -431587 365437 255491 -148193 -263399 -33075 0 0 0 0 0 0 0 0
-664615 -278891 298577 664615 136273 7899 1188 0 0 0 0 0 0 0 0 0
-9386 -356652 -356652 239044 180556 -132750 -234375 -330...

result:

ok 

Test #36:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-124095 124095 -26457 -124095 -26457 -26457 -124095 0 0 0 0 0 0 0 0 0
50483 -50483 148121 50483 148121 -50483 50483 0 0 0 0 0 0 0 0 0
29183 277373 -179735 -178381 -80743 -179735 -277373 0 0 0 0 0 0 0 0 0
29649 -29649 -29649 29649 127287 -29649 -127287 0 0 0 0 0 0 0...

result:

ok 

Test #37:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
178886 -133938 25462 19486 25462 178886 102174 -79700 0 0 0 0 0 0 0 0
131585 -21839 -21839 66787 -21839 66787 54873 -7969 0 0 0 0 0 0 0 0
178980 -118094 25556 19392 25556 19392 -41382 -79794 0 0 0 0 0 0 0 0
189907 -144959 -144959 189907 -125959 170907 -26422 0 0 0 ...

result:

ok 

Test #38:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
204485 -204485 139071 142967 -143847 142081 -103611 0 0 0 0 0 0 0 0 0
117046 -117046 117046 226510 -226510 168882 -128464 0 0 0 0 0 0 0 0 0
-98891 -442447 442447 442447 98891 384819 25169 0 0 0 0 0 0 0 0 0
-152564 -45238 496120 45238 -160284 -12390 -39754 0 0 0 0 0...

result:

ok 

Test #39:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
461657 -232781 143603 461657 -97271 135971 -23684 -12406 0 0 0 0 0 0 0 0
-24506 140172 253382 253382 -3976 -88704 56605 0 0 0 0 0 0 0 0 0
340188 340188 57794 9062 196040 111312 -225750 0 0 0 0 0 0 0 0 0
215734 13142 109952 215734 -25224 -109952 -4486 0 0 0 0 0 0 0 ...

result:

ok 

Test #40:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
353536 353536 -252154 -252154 -265006 23390 86055 -122113 0 0 0 0 0 0 0 0
-323252 424634 424634 152952 159792 261174 9346 0 0 0 0 0 0 0 0 0
-90502 -31480 191884 -31480 -47584 132862 -98273 0 0 0 0 0 0 0 0 0
700 700 700 700 -100682 100682 3388 0 0 0 0 0 0 0 0 0
3476...

result:

ok 

Test #41:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
270291 199095 61781 270291 -13887 29871 -37715 57742 0 0 0 0 0 0 0 0
220001 -144333 -33441 109109 -220001 -33441 -146569 0 0 0 0 0 0 0 0 0
323880 -248212 -59462 323880 -94910 -248212 -151378 76046 0 0 0 0 0 0 0 0
228773 157577 -153105 217653 -228773 -4671 74217 686...

result:

ok 

Test #42:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-40603 387313 -256485 145485 -387313 277261 258621 35851 0 0 0 0 0 0 0 0
-288654 225262 -225262 -16566 -288654 178602 127236 0 0 0 0 0 0 0 0 0
-572775 -144859 -60899 -33597 -219685 30533 127236 0 0 0 0 0 0 0 0 0
-7025 420891 -151205 -90623 -420891 41153 293775 -577...

result:

ok 

Test #43:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5827 5827 -61537 -682145 682145 -682145 671219 286885 34363 -280344 0 0 0 0 0 0
-501639 -501639 313641 -350603 501639 -482891 296041 121987 -271361 28915 0 0 0 0 0 0
-155912 -520406 464696 -520406 155912 -424266 509480 316678 -212736 -19622 0 0 0 0 0 0
-749434 -749...

result:

ok 

Test #44:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-230188 230188 -449818 35528 -323118 -449818 -235494 -100972 -114820 0 0 0 0 0 0 0
-123026 123026 -342656 -71634 -215956 -342656 -342656 -11598 -114820 0 0 0 0 0 0 0
-35982 35982 -255612 -158678 -31978 -255612 -255612 35982 -95088 0 0 0 0 0 0 0
552320 203126 332690...

result:

ok 

Test #45:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4507 4507 -4507 -141117 33855 -141117 141117 -4507 0 0 0 0 0 0 0 0
-505777 -505777 505777 324115 375607 21911 244251 185591 0 0 0 0 0 0 0 0
-501212 -354244 354244 -157772 371042 34808 172044 97934 0 0 0 0 0 0 0 0
24127 24127 -24127 24127 -24127 -160737 160737 16073...

result:

ok 

Test #46:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-195744 -77318 -518016 -391076 391076 -195744 204258 166932 0 0 0 0 0 0 0 0
-494692 -100642 -494692 -286124 284310 -286124 309210 136990 0 0 0 0 0 0 0 0
-180185 -415149 -286847 -286847 415149 -308487 415149 44249 0 0 0 0 0 0 0 0
93180 211606 -806940 -806940 806940 ...

result:

ok 

Test #47:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-696895 -84673 106171 -203117 -269001 337911 -49781 -47649 150571 43370 0 0 0 0 0 0
-615265 -166303 187801 -19585 -85469 154379 31849 16705 155851 26496 0 0 0 0 0 0
-612634 -591136 612634 233294 167410 159740 -291082 127726 339654 136239 0 0 0 0 0 0
-335711 -445857...

result:

ok 

Test #48:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
450392 -88742 153132 -450392 -31268 31268 -76122 -131384 -128124 119332 0 0 0 0 0 0
71922 -467212 443840 -71922 347202 -149738 -56290 -198098 76254 147232 0 0 0 0 0 0
533495 -5639 70029 -533495 284419 114371 239565 -397531 -37921 27810 0 0 0 0 0 0
-50970 -590104 -5...

result:

ok 

Test #49:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
20259 426593 -334829 334829 426593 12971 39729 20259 388051 -156095 0 0 0 0 0 0
425860 20992 -107908 -70772 263354 -39740 200432 211376 409686 -20931 0 0 0 0 0 0
88978 88978 -30444 30444 324644 -324644 -120276 88978 88978 -26698 0 0 0 0 0 0
-5908 -5908 -360996 1056...

result:

ok 

Test #50:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
161688 -161688 161688 161688 161688 286598 115044 -193530 -286598 0 0 0 0 0 0 0
599125 91775 -27855 564309 -114827 247007 368507 -185645 8057 -148763 0 0 0 0 0 0
145675 -145675 145675 303807 303807 145675 131057 -51411 -302611 598 0 0 0 0 0 0
1798 62122 569472 1798...

result:

ok 

Test #51:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
90690 453788 90690 -140328 -312270 -74574 220492 48630 292045 0 0 0 0 0 0 0
759970 -25536 649620 -526866 -618452 -361726 123296 -28508 -81303 -96744 0 0 0 0 0 0
448349 286085 448349 -325595 -144567 -259841 225181 43941 78046 52400 0 0 0 0 0 0
666459 666459 150245 5...

result:

ok 

Test #52:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-501044 -501044 -501044 267282 364870 -150232 142106 239872 139632 -108985 0 0 0 0 0 0
-417263 -417263 -302011 183501 281089 -234013 -56927 40839 105211 -161831 0 0 0 0 0 0
-544017 -544017 -175257 -58505 39083 -322031 -22379 188423 -83325 -127087 0 0 0 0 0 0
-18578...

result:

ok 

Test #53:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-1308713 245139 -272805 -550441 391003 47183 -266745 -59545 161593 -124510 -101152 0 0 0 0 0
-1234544 170970 -1234544 -346974 237432 117490 498324 70918 -123640 273686 12144 0 0 0 0 0
-83368 -980206 -980206 -980206 190070 -805124 262730 -208682 238136 104959 59542 ...

result:

ok 

Test #54:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
822826 -124314 -535134 168122 -225800 -61958 16114 442066 203226 141 11572 0 0 0 0 0
1274351 1274351 130679 -1142683 633145 -707321 188947 738173 8253 104042 525053 0 0 0 0 0
-242710 653530 -653530 242710 -653530 83596 144050 324556 -182182 3224 0 0 0 0 0 0
1214970...

result:

ok 

Test #55:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-459915 491609 110047 141741 200195 -120973 224651 5621 109350 241535 0 0 0 0 0 0
-314766 346460 -346460 -130124 103282 -219744 135334 91256 31887 -109850 0 0 0 0 0 0
518231 -324397 486537 192309 -271393 54529 -239699 77559 312211 -206131 -105475 0 0 0 0 0
-542176 ...

result:

ok 

Test #56:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1605278 1605278 -1173406 -944224 639564 65866 -644120 324142 193158 261014 -381094 63538 0 0 0 0
1416601 126209 -1416601 11123 436381 624817 19175 81831 137587 -114187 -48255 -97019 0 0 0 0
1713893 -171083 -1713893 308415 733673 981131 375489 315589 -77603 -119113 ...

result:

ok 

Test #57:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
30747 -30747 -30747 30747 30747 -30747 70697 70697 -30747 50722 0 0 0 0 0 0
961446 -755270 692424 372086 961446 685490 29074 -54522 624482 44446 131598 0 0 0 0 0
809397 -603221 540375 220037 809397 533441 -122975 -206571 472433 196495 162299 0 0 0 0 0
-69294 69294 ...

result:

ok 

Test #58:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-920378 524342 3296 693928 39944 -531382 35334 588354 -256176 22990 -12943 -114098 0 0 0 0
-673132 474606 340618 673132 225832 -618666 231290 580596 -292170 87945 -63015 -114098 0 0 0 0
-1053473 657437 -129799 1053473 61691 -509775 240037 277011 -572367 166223 -129...

result:

ok 

Test #59:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
497820 -40728 60608 396484 43196 -477538 -204618 -37310 -480 20692 -71908 0 0 0 0 0
462539 433707 433707 281947 21371 -343955 -22177 -34107 61481 -33774 112885 0 0 0 0 0
685024 656192 -217510 685024 331736 219382 72382 331784 285112 37273 53940 0 0 0 0 0
890777 -43...

result:

ok 

Test #60:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-862360 -382472 -262114 -356562 348474 -212922 74 44708 207122 -144554 32176 -4864 0 0 0 0
-783116 -179186 -182870 -764954 275950 -66372 24096 227306 99927 -144554 32176 -4864 0 0 0 0
-1060198 303002 -459952 -754900 641696 54508 -263002 240924 -46824 -224525 32176 ...

result:

ok 

Test #61:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-1229372 -146034 1079198 340066 -527174 -54566 489278 -318510 529644 65836 187765 0 0 0 0 0
-763471 -611935 613297 387941 -61273 1415 356287 -444125 448279 54909 187765 0 0 0 0 0
-167141 -167141 682561 682561 363423 -271745 -240043 -102829 56867 -41113 99964 0 0 0 ...

result:

ok 

Test #62:

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

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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-410488 -1239888 -410488 -103518 410488 -742722 667904 497740 -496694 276500 -112307 -101666 0 0 0 0
-1311429 -800801 -800801 -246411 1070661 -434105 759851 462409 -556079 336844 74869 -55933 0 0 0 0
-435500 -435500 -967548 382190 967548 -414430 -196 687540 117330 ...

result:

ok 

Extra Test:

score: 0
Extra Test Passed