QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#874474#8620. Jigsaw Puzzleucup-team6275RE 1ms4224kbC++205.1kb2025-01-28 06:43:092025-01-28 06:43:10

Judging History

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

  • [2025-01-28 06:43:10]
  • 评测
  • 测评结果:RE
  • 用时:1ms
  • 内存:4224kb
  • [2025-01-28 06:43:09]
  • 提交

answer

#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <deque>
#include <set>
#include <cassert>
#include <cmath>
#include <complex>

using namespace std;
#define ld long double
#define cmpl complex<ld>

struct vec {
    ld x, y;

    ld len() {
        return sqrt(x * x + y * y);
    }

    vec() {}

    vec(ld x, ld y) : x(x), y(y) {}
};

vec operator-(const vec& a, const vec& b) {
    return {a.x - b.x, a.y - b.y};
}

vec operator+(const vec& a, const vec& b) {
    return {a.x + b.x, a.y + b.y};
}

ld operator*(const vec& a, const vec& b) {
    return a.x * b.x + a.y * b.y;
}

struct Side {
    ld len;
    int num;
    int ind;
};

bool cmp(const Side& a, const Side& b) {
    return a.len < b.len;
}

const ld EPS = 1e-6;

void transform_to_point(vector <vec>& a, int ind, vec flex) {
    vec adding = flex - a[ind];
    for (auto& i : a) {
        i = i + adding;
    }
}

void transform_mul(vector <vec>& a, int ind, cmpl value) {

    int n = a.size();
    vector <vec> flex(n);

    for (int i = 0; i < n; ++i) {
        int ii = (i + 1) % n;
        flex[i] = (a[ii] - a[i]);
    }

    for (int it = 0; it < n - 1; ++it) {
        int i = (ind + it) % n;
        int ii = (i + 1) % n;

        cmpl xd = {flex[i].x, flex[i].y};
        xd *= value;
        a[ii] = a[i] + vec(xd.real(), xd.imag());
    }
}

bool validate(vector <vec>& a) {
    for (auto i : a) {
        if (i.x < -EPS || i.y < -EPS || i.x > 1 + EPS || i.y > 1 + EPS) return false;
    }
    return true;
}

void solve() {
    int n;
    cin >> n;

    vector <vector <vec>> a(n);
    for (int i = 0; i < n; ++i) {
        int k;
        cin >> k;
        a[i].resize(k);
        for (int j = 0; j < k; ++j) {
            cin >> a[i][j].x >> a[i][j].y;
        }
    }

    vector <Side> sides;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < a[i].size(); ++j) {
            int jj = (j + 1) % a[i].size();
            ld flex = (a[i][jj] - a[i][j]).len();
            if (abs(flex - 1) < EPS) continue;
            sides.push_back({flex, i, j});
        }
    }
    sort(sides.begin(), sides.end(), cmp);
    map <pair <int, int>, vector <pair <int, int>>> g;

    for (int i = 0; i + 1 < sides.size(); ++i) {
        if (sides[i + 1].len - sides[i].len < EPS) {
            pair <int, int> t1 = {sides[i].num, sides[i].ind};
            pair <int, int> t2 = {sides[i + 1].num, sides[i + 1].ind};
            g[t1].push_back(t2);
            g[t2].push_back(t1);
        }
    }
    vector <int> used(n);
    vector <int> st;

    for (int i = 0; i < n; ++i) {
        int ln = a[i].size();
        for (int j = 0; j < a[i].size(); ++j) {
            vec vec1 = (a[i][(j + 1) % ln] - a[i][j]);
            vec vec2 = a[i][j] - (a[i][(j + ln - 1) % ln]);
            if (abs(vec1 * vec2) < EPS) {
                used[i] = 1;
                cmpl cha = {vec1.x, vec1.y};
                cha /= vec1.len();
                transform_mul(a[i], j, (cmpl)1 / cha);
                transform_to_point(a[i], j, vec(0, 0));
                used[i] = 1;
                st.push_back(i);
                assert(validate(a[i]));
                break;
            }
        }
        if (!st.empty()) break;
    }

    while (!st.empty()) {
        int v = st.back();
        st.pop_back();

        int ln = a[v].size();
        for (int i = 0; i < ln; ++i) {
            int ii = (i + 1) % ln;

            for (auto [vv, j] : g[make_pair(v, i)]) {
                if (used[vv]) continue;
                auto cop = a[vv];
                vec vec1 = (a[v][ii] - a[v][i]);
                int jj = (j + 1) % a[vv].size();
                vec vec2 = (a[vv][jj] - a[vv][j]);
                cmpl need_vec = -cmpl(vec1.x, vec1.y) / cmpl(vec2.x, vec2.y);
                transform_mul(a[vv], j, need_vec);
                transform_to_point(a[vv], j, a[v][ii]);

                if (!validate(a[vv])) {
                    a[vv] = cop;
                    continue;
                }

                used[vv] = 1;
                st.push_back(vv);
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        for (auto j : a[i]) {
            cout << fixed << setprecision(10) << j.x << " " << j.y << "\n";
        }
        cout << "\n";
    }
}

signed main() {
    if (1) {
        ios_base::sync_with_stdio(false);
        cin.tie(nullptr);
    }
    int32_t t = 1;
//    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

/*
 4
4
0.440405375916 0.778474079786
0.000000000000 0.090337001520
0.469097990019 0.000000000000
0.702887505082 0.689470121906
4
0.222810526978 0.000000000000
0.270828246634 0.522212063829
0.000000000000 0.547114887265
0.021480010612 0.069880870008
4
0.000000000000 0.312825941471
0.358219176380 0.000000000000
0.532830100286 0.122181578260
0.088431750275 0.414089758021
4
0.158867722074 0.061734605990
0.973532298476 0.000000000000
0.853551564066 0.712811281737
0.000000000000 0.569141075980
 */

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4
4
0.440405375916 0.778474079786
0.000000000000 0.090337001520
0.469097990019 0.000000000000
0.702887505082 0.689470121906
4
0.222810526978 0.000000000000
0.270828246634 0.522212063829
0.000000000000 0.547114887265
0.021480010612 0.069880870008
4
0.000000000000 0.312825941471
0.358219176380 0.00000...

output:

0.2771616363 0.0000000000
0.4732624314 0.7931166445
0.0000000000 0.7280292483
0.0000000000 0.0000000000

0.5244150465 1.0000000000
0.0000000000 1.0000000000
0.0000000000 0.7280292483
0.4732624314 0.7931166445

1.0000000000 1.0000000000
0.5244150465 1.0000000000
0.4732624314 0.7931166445
1.0000000000...

result:

ok OK

Test #2:

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

input:

2
4
1.187724454426 0.260257896229
0.903481480651 1.219010174901
0.000000000000 0.951153431795
0.309873903757 0.000000000000
4
0.516015116935 0.888042716318
0.000000000000 0.031046166652
0.048574738349 0.000000000000
0.587115596943 0.842599396881

output:

0.0000000000 0.0000000000
1.0000000000 -0.0000000000
1.0000000000 0.9423513255
0.0000000000 0.9156176942

0.0000000000 0.9156176942
1.0000000000 0.9423513255
1.0000000000 1.0000000000
0.0000000000 1.0000000000


result:

ok OK

Test #3:

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

input:

2
4
0.010984487654 0.637154242202
0.000000000000 0.364429379044
0.986132728982 0.000000000000
1.010174362438 0.596910060881
4
1.051085498217 0.708750184397
0.000000000000 0.686709156365
0.238826458657 0.000000000000
1.183335588457 0.328485165151

output:

0.0000000000 0.0000000000
0.2729459836 0.0000000000
0.5973940248 1.0000000000
0.0000000000 1.0000000000

0.5973940248 1.0000000000
0.2729459836 0.0000000000
1.0000000000 0.0000000000
1.0000000000 1.0000000000


result:

ok OK

Test #4:

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

input:

2
4
0.826904615568 0.393527743434
0.397181437913 1.296488423966
0.078224855062 1.144695506210
0.000000000000 0.000000000000
4
1.022875732881 0.126407334306
0.000000000000 0.646188215994
0.027327732878 0.000000000000
1.026434680216 0.042252902634

output:

0.0000000000 0.0000000000
1.0000000000 -0.0000000000
1.0000000000 0.3532341881
0.0000000000 0.9157703468

0.0000000000 0.9157703468
1.0000000000 0.3532341881
1.0000000000 1.0000000000
0.0000000000 1.0000000000


result:

ok OK

Test #5:

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

input:

2
4
0.341358383182 1.391325004482
0.000000000000 0.397880525310
0.531982366752 0.000000000000
1.130916074772 0.800798609763
4
1.051975365355 0.325235570274
0.003475133323 0.261167306728
0.000000000000 0.247567137365
0.968870740861 0.000000000000

output:

1.0000000000 0.9859628650
-0.0000000000 0.6643147981
0.0000000000 0.0000000000
1.0000000000 0.0000000000

-0.0000000000 0.6643147981
1.0000000000 0.9859628650
1.0000000000 1.0000000000
0.0000000000 1.0000000000


result:

ok OK

Test #6:

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

input:

2
4
0.082220615826 0.000000000000
0.226158368535 0.989676141653
0.157074587283 1.000663841224
0.000000000000 0.013077098690
4
0.796463091415 0.000000000000
1.301438005407 0.863236513506
0.516366280506 1.336613199533
0.000000000000 0.480245367141

output:

1.0000000000 0.0832540700
-0.0000000000 0.0699521149
0.0000000000 0.0000000000
1.0000000000 0.0000000000

-0.0000000000 0.0699521149
1.0000000000 0.0832540700
1.0000000000 1.0000000000
-0.0000000000 1.0000000000


result:

ok OK

Test #7:

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

input:

2
4
0.919168715346 1.052156329422
0.000000000000 0.740689700679
0.930075742206 0.000000000000
1.240100800584 0.105054119170
4
1.147942957461 0.000000000000
1.169807209495 0.019794683310
0.498656378683 0.761115506098
0.000000000000 0.309659628218

output:

0.0000000000 0.0000000000
0.9705063565 0.0000000000
0.3273406556 1.0000000000
0.0000000000 1.0000000000

0.9705063565 0.0000000000
1.0000000000 0.0000000000
1.0000000000 1.0000000000
0.3273406556 1.0000000000


result:

ok OK

Test #8:

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

input:

3
4
0.000000000000 0.136914050437
1.205473860654 0.000000000000
1.271801552152 0.076389603324
0.516716328492 0.732016253949
4
0.193356841190 1.008675084911
0.000000000000 0.998661755544
0.051717482677 0.000000000000
0.069051074671 0.000897651020
4
0.189612940043 1.009339071474
0.000000000000 0.01178...

output:

1.0000000000 0.7881258762
-0.0000000000 0.1011668629
0.0000000000 0.0000000000
1.0000000000 0.0000000000

1.0000000000 0.8063840533
1.0000000000 1.0000000000
-0.0000000000 1.0000000000
-0.0000000000 0.9826431803

1.0000000000 0.8063840533
-0.0000000000 0.9826431803
-0.0000000000 0.1011668629
1.00000...

result:

ok OK

Test #9:

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

input:

4
5
0.933026549197 0.034096050827
1.030580221284 0.341877704707
0.077317792660 0.644021283449
0.000000000000 0.400083791499
0.816713028753 0.000000000000
5
0.000000000000 0.567232254210
0.177744443744 0.000000000000
0.278219549927 0.015709015317
0.955605106642 0.861917658609
0.954247706440 0.8662495...

output:

0.0000000000 0.3228719025
0.0000000000 0.0000000000
1.0000000000 -0.0000000000
1.0000000000 0.2558975206
0.1005754062 0.3905177700

0.0000000000 1.0000000000
0.0000000000 0.4055712679
0.1005754062 0.3905177700
1.0000000000 0.9954604619
1.0000000000 1.0000000000

1.0000000000 0.9954604619
0.100575406...

result:

ok OK

Test #10:

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

input:

4
4
0.578470606282 0.000000000000
1.060885700639 0.240610189702
0.817167310798 0.691089665380
0.000000000000 0.248985836080
4
0.000000000000 0.520597380570
0.022799149709 0.000000000000
0.882566155159 0.037652814638
0.461438543132 0.525442723877
4
0.057126159280 0.427841981239
0.000000000000 0.38584...

output:

0.5387913306 0.4942519038
-0.0000000000 0.5121820102
0.0000000000 0.0000000000
0.9290953717 0.0000000000

1.0000000000 0.4789036232
1.0000000000 1.0000000000
0.1394089019 1.0000000000
0.5387913306 0.4942519038

0.9290953717 0.0000000000
1.0000000000 -0.0000000000
1.0000000000 0.4789036232
0.53879133...

result:

ok OK

Test #11:

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

input:

3
3
0.823899373670 0.782629779690
0.288601744213 0.945945553033
0.000000000000 0.000000000000
5
0.919151534064 0.575061183684
0.169973459288 1.263242535288
0.000000000000 1.135836341471
0.145355826013 0.008808731413
0.151958544733 0.000000000000
4
1.000848179486 0.040130744019
0.991701546880 0.26786...

output:

-0.0000000000 0.5596566750
0.0000000000 0.0000000000
0.9889913832 -0.0000000000

1.0000000000 0.9587911388
-0.0000000000 0.7720791670
-0.0000000000 0.5596566750
0.9889913832 -0.0000000000
1.0000000000 -0.0000000000

-0.0000000000 1.0000000000
-0.0000000000 0.7720791670
1.0000000000 0.9587911388
1.00...

result:

ok OK

Test #12:

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

input:

3
4
0.784316497399 0.634251077946
0.006801703755 1.263115726074
0.000000000000 1.254706245103
0.271325510967 0.000000000000
4
0.176866080715 0.000000000000
1.325780121566 0.313426050448
1.266765536888 0.366283123599
0.000000000000 0.158412084360
4
0.637108390812 0.412967145896
0.087765752860 1.24856...

output:

0.0000000000 0.0000000000
1.0000000000 0.0000000000
1.0000000000 0.0108158469
-0.0000000000 0.8157414922

1.0000000000 0.2482521520
-0.0000000000 0.8949664339
-0.0000000000 0.8157414922
1.0000000000 0.0108158469

1.0000000000 1.0000000000
-0.0000000000 1.0000000000
-0.0000000000 0.8949664339
1.00000...

result:

ok OK

Test #13:

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

input:

6
4
0.921652078321 0.149600568920
0.078937119587 0.337059477836
0.000000000000 0.296726127108
0.743849912614 0.000000000000
4
1.023501554022 0.000000000000
0.951768850516 0.475614028074
0.000000000000 0.332067057777
0.284068099668 0.057351469275
4
0.049230909949 0.111307311191
0.213550746194 0.00000...

output:

0.1984699627 1.0000000000
0.7226112105 0.3140078013
0.8089796392 0.2940492805
0.4308359249 1.0000000000

0.0000000000 0.4809930191
0.0000000000 0.0000000000
0.9625329488 0.0000000000
0.7226112105 0.3140078013

0.1984699627 1.0000000000
0.0000000000 1.0000000000
0.0000000000 0.4809930191
0.7226112105...

result:

ok OK

Test #14:

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

input:

5
4
0.000000000000 0.055459913902
0.998460914583 0.000000000000
1.018410323962 0.359155002823
0.013840567536 0.304635665324
4
0.500064513905 0.019086089913
0.674971706538 0.000000000000
0.813263023860 0.224894936058
0.000000000000 0.724982740923
4
0.731666528739 0.764701825648
0.735437510038 0.80982...

output:

0.0000000000 0.0000000000
1.0000000000 0.0000000000
1.0000000000 0.3597086251
0.0000000000 0.2495598453

0.8410101920 0.6606287744
1.0000000000 0.7359882186
1.0000000000 1.0000000000
0.0452829956 1.0000000000

0.0452829956 1.0000000000
-0.0000000000 1.0000000000
0.0000000000 0.2619990669
0.841010192...

result:

ok OK

Test #15:

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

input:

5
3
0.000000000000 0.061747330599
0.247806449221 0.000000000000
0.229822253050 0.275345649819
5
0.538394745273 0.029328826979
0.968971368133 0.672420034382
0.916291764826 0.738725056183
0.000000000000 0.284470622299
0.226013039857 0.000000000000
4
0.014373491307 0.145007400418
1.026752147154 0.00000...

output:

1.0000000000 0.5721960771
1.0000000000 0.8275796496
0.7371720075 0.7435552214

0.7371720075 0.7435552214
0.0000000000 0.5078860453
0.0000000000 0.4232013565
1.0000000000 0.2088705631
1.0000000000 0.5721960771

1.0000000000 0.2088705631
0.0000000000 0.4232013565
0.0000000000 0.0000000000
1.0000000000...

result:

ok OK

Test #16:

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

input:

7
5
0.810317691232 0.643017535788
0.309793761559 0.764262848182
0.000000000000 0.561376089933
0.651400345497 0.000000000000
0.931962307009 0.325553870105
4
0.171076044751 0.000000000000
0.265564197304 0.103411254234
0.071756689228 0.418964516278
0.000000000000 0.156314315443
4
0.386419063825 0.00000...

output:

0.5908377197 0.2993944940
0.3559292372 0.7576985795
-0.0000000000 0.8599218130
0.0000000000 0.0000000000
0.4297677705 0.0000000000

-0.0000000000 1.0000000000
-0.0000000000 0.8599218130
0.3559292372 0.7576985795
0.2317351469 1.0000000000

0.7729628751 0.6379261009
0.9677534464 1.0000000000
0.2317351...

result:

ok OK

Test #17:

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

input:

7
4
0.000000000000 0.177488867232
0.176950314412 0.039266481958
0.556242974263 0.000000000000
0.075309305264 0.536013509980
4
0.203281319601 0.323314306022
0.000000000000 0.110510724304
0.349283252863 0.000000000000
0.408321765666 0.043218341300
5
0.860850463389 0.099669917919
0.433724726467 0.81261...

output:

0.2954871750 0.2897279043
0.2560895655 0.5107814497
-0.0000000000 0.7933109400
0.0000000000 0.0731667344

0.3471243783 0.0000000000
0.2954871750 0.2897279043
0.0000000000 0.0731667344
0.0000000000 0.0000000000

1.0000000000 1.0000000000
0.1688978337 1.0000000000
0.2560895655 0.5107814497
0.392205464...

result:

ok OK

Test #18:

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

input:

6
4
0.880095449711 0.315891170135
0.784668799664 0.890843756640
0.000000000000 0.600905379684
0.728266831893 0.000000000000
4
0.083309474403 0.000000000000
0.291032832219 0.544543596864
0.066903447530 0.393219949838
0.000000000000 0.014725970157
4
0.007778511174 0.196667909856
0.000000000000 0.13427...

output:

0.1943679291 0.5723879237
0.0846009617 0.0000000000
0.9211231596 0.0000000000
0.4462729628 0.8160742272

0.0846009617 -0.0000000000
0.1943679291 0.5723879237
0.0000000000 0.3843615016
0.0000000000 0.0000000000

0.3392518286 1.0000000000
0.2763711980 1.0000000000
0.1943679291 0.5723879237
0.446272962...

result:

ok OK

Test #19:

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

input:

9
4
0.062298941747 0.379982766518
0.000000000000 0.335827002916
0.238024873877 0.000000000000
0.368555159260 0.154177511533
4
0.271980593498 0.402027829795
0.000000000000 0.242759569523
0.006597351582 0.000000000000
0.412952594723 0.011043306806
4
0.713919783914 0.000000000000
0.775523766209 0.02973...

output:

0.0000000000 0.0763602619
0.0000000000 0.0000000000
0.4116255780 -0.0000000000
0.3613188964 0.1956478935

0.6053300707 0.2762069658
0.7571508006 0.0000000000
1.0000000000 0.0000000000
1.0000000000 0.4065052746

0.2277330437 0.9631680230
0.1605971603 0.9762755079
0.3613188964 0.1956478935
0.605330070...

result:

ok OK

Test #20:

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

input:

12
4
0.011736358846 0.082356480218
0.408765987214 0.000000000000
0.506829492828 0.122146405389
0.000000000000 0.183574392246
3
0.518781549596 0.245694689851
0.000000000000 0.398529593227
0.074761480444 0.000000000000
4
0.075538054618 0.530132543078
0.000000000000 0.488866489116
0.155089097424 0.0109...

output:

0.6388420261 0.6569814864
1.0000000000 0.8413182259
1.0000000000 0.9979585639
0.5663234305 0.7285626371

1.0000000000 0.3004921874
1.0000000000 0.8413182259
0.6388420261 0.6569814864

0.4849422299 0.5784303020
0.4267737296 0.6418756366
0.0000000000 0.3767676909
0.0000000000 0.3309134923

1.000000000...

result:

ok OK

Test #21:

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

input:

14
4
0.238874723659 0.350932855333
0.056257209931 0.347991971885
0.000000000000 0.014112992049
0.083758710992 0.000000000000
3
0.000000000000 0.000000000000
0.074629721440 0.057264984008
0.050867075265 0.098486920063
5
0.000000000000 0.100859535910
0.152266736787 0.000000000000
0.585330206242 0.2675...

output:

0.1795904674 0.3718279413
0.0000000000 0.3385853612
0.0000000000 0.0000000000
0.0849393796 0.0000000000

0.4905887265 0.9067445294
0.4782481062 1.0000000000
0.4306675286 1.0000000000

0.0000000000 0.3385853612
0.1795904674 0.3718279413
0.3051708834 0.8651588541
0.2637006969 1.0000000000
0.0000000000...

result:

ok OK

Test #22:

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

input:

25
4
0.000000000000 0.627504305794
0.147063422648 0.000000000000
0.282537740951 0.083274926848
0.087264778840 0.609639797093
3
0.040754587534 0.053855777929
0.019823186956 0.059913069526
0.000000000000 0.000000000000
4
0.000000000000 0.138379187270
0.054487787984 0.000000000000
0.282847594751 0.1139...

output:

0.3796034069 1.0000000001
0.6495290235 0.4147398308
0.7655494392 0.5234930722
0.4686779954 1.0000000001

0.8693826013 0.3568309627
0.8578601980 0.3753255168
0.8030736349 0.3440051218

0.4998317486 -0.0000000000
0.4376244606 0.1350850540
0.2160573004 0.0084194891
0.2070751992 0.0000000000

0.68342271...

result:

ok OK

Test #23:

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

input:

31
4
0.335089288956 0.202130218860
0.111257412594 0.213056135994
0.000000000000 0.115005293141
0.101353839372 0.000000000000
5
0.368599476325 0.185829203903
0.028334455772 0.164205533565
0.000000000000 0.125424247883
0.009151606319 0.000000000000
0.420642774919 0.030024538656
4
0.014611117134 0.4683...

output:

0.1561892615 0.3089991891
-0.0000000000 0.1482976050
0.0000000000 0.0000000000
0.1532932425 0.0000000000

0.1591788500 0.6279820461
0.1623741930 0.9689184876
0.1257576791 1.0000000000
-0.0000000000 1.0000000000
-0.0000000000 0.5874149121

-0.0000000000 0.1482976050
0.1561892615 0.3089991891
0.159178...

result:

ok OK

Test #24:

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

input:

38
6
0.055783185423 0.185264589599
0.000000000000 0.109085977012
0.008304609077 0.000000000000
0.192122870699 0.013993905045
0.330134360764 0.183894016971
0.331013036656 0.209310854427
6
0.313528615558 0.117272301270
0.460548489005 0.402591166057
0.450995573032 0.409647373622
0.000000000000 0.427107...

output:

0.0614049060 0.1811259807
0.0000000000 0.1094016312
0.0000000000 0.0000000000
0.1843501632 0.0000000000
0.3348604624 0.1589335373
0.3376659792 0.1842103403

0.0966702900 0.7095210157
0.3706996170 0.5423994261
0.3784233566 0.5514211841
0.4282119083 1.0000000000
-0.0000000000 1.0000000000
-0.000000000...

result:

ok OK

Test #25:

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

input:

42
3
0.023946458177 0.001644458456
0.052848741781 0.000000000000
0.000000000000 0.033937501244
4
0.000000000000 0.437888290711
0.220437603206 0.000000000000
0.252072649283 0.037291610744
0.214541156503 0.387891843578
5
0.056385180666 0.000000000000
0.307613101005 0.119085407065
0.324470389249 0.5126...

output:

0.9541758513 0.6731212671
0.9289984080 0.6588334195
0.9918054547 0.6589690085

0.6759103011 1.0000000000
0.1856665943 1.0000000000
0.2047509922 0.9549752720
0.5347849870 0.8308515496

0.0000000000 0.0000000000
0.2780230245 -0.0000000000
0.4618416223 0.3484360578
0.4463661849 0.3849463717
0.000000000...

result:

ok OK

Test #26:

score: -100
Runtime Error

input:

47
4
0.000000000000 0.000000000000
0.240721682184 0.063972715782
0.212144051267 0.142587916515
0.194188982632 0.164356993645
3
0.000000000000 0.007329294278
0.004097455454 0.000000000000
0.012808348423 0.004742705864
4
0.000000000000 0.191434375054
0.194726601227 0.006150268983
0.209266332239 0.0000...

output:


result: