QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#384422#2173. What's Our Vector, Victor?distant_yesterdayAC ✓104ms9980kbC++204.9kb2024-04-09 23:21:332024-04-09 23:21:34

Judging History

This is the latest submission verdict.

  • [2024-04-09 23:21:34]
  • Judged
  • Verdict: AC
  • Time: 104ms
  • Memory: 9980kb
  • [2024-04-09 23:21:33]
  • Submitted

answer

#include <bits/stdc++.h>
#ifdef LOCAL
#include "cp_debug.h"
#else
#define debug(...) 42
#endif
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

template<typename T> void read(T &x){
    x = 0;char ch = getchar();ll f = 1;
    while(!isdigit(ch)){if(ch == '-')f*=-1;ch=getchar();}
    while(isdigit(ch)){x = x*10+ch-48;ch=getchar();}x*=f;
}
template<typename T, typename... Args> void read(T &first, Args& ... args) {
    read(first);
    read(args...);
}
template<typename T> void write(T x) {
    if(x > 9) write(x/10);
    putchar(x%10 + '0');
}

typedef vector<double> Vec;
const double eps = 1e-8;
int sgn(double x) {
    if(fabs(x) < eps) return 0;
    return x > 0 ? 1 : -1;
}
// input: m x (d+1) matrix, meaning [A, b] in Ax=b.
// \sum_{j=0}^{d-1} a[i][j] * x[j] = a[i][d].
// returns: {success, a special solution, orthonormal null space of A}
tuple<bool, Vec, vector<Vec>> gram_schmidt(vector<Vec> a) {
    int m = sz(a), d = sz(a[0])-1, pos = 0, rc = 0;
    vector<int> fre(d), leftp;
    rep(i, 0, d) {
        int op = -1;
        for(int j = pos; j < m; j++) {
            if(sgn(a[j][i]) && (op == -1 || fabs(a[j][i]) > fabs(a[op][i]))) {
                op = j;
            }
        }
        if(op == -1) { fre[i] = ++rc; continue; }
        fre[i] = 0;
        if(op != pos) { swap(a[pos], a[op]); }
        for(int j = pos+1; j < m; j++) {
            double f = a[j][i] / a[pos][i];
            rep(k,0,d+1) a[j][k] -= a[pos][k] * f;
        }
        double val = a[pos][i];
        rep(k,0,d+1) a[pos][k] /= val;
        leftp.push_back(i);
        pos++;
    }
    while(sz(a) > 0) {
        const auto &last = a.back();
        bool last_zero = fabs(last[d]) < eps;
        bool pre_zero = true;
        rep(i,0,d) pre_zero = pre_zero && fabs(last[i]) < eps;
        if(pre_zero) {
            if(!last_zero) return {false, Vec(0,0), {}}; // no solution.
            a.pop_back();
        } else {
            break;
        }
    }
    Vec sol(d, 0.0); // special solution
    for(int i = sz(a)-1; i >= 0; --i) {
        assert(sgn(a[i][leftp[i]] - 1.0) == 0);
        sol[leftp[i]] = a[i][d];
        rep(j,0,i) {
            double f = a[j][leftp[i]];
            rep(k,0,d+1) a[j][k] -= a[i][k] * f;
        }
    }
    vector<Vec> res; // orthonormal null space of A.
    for(int f = 1; f <= rc; ++f) {
        Vec c(d, 0);
        for(int i = 0; i < d; ++i) if(fre[i] == f) c[i] = 1;
        for(int i = sz(a)-1; i >= 0; --i) {
            for(int j = leftp[i] + 1; j < d; ++j) {
                c[leftp[i]] -= c[j] * a[i][j];
            }
        }
        for(auto g : res) {
            double prod = 0;
            rep(i,0,d) prod += c[i]*g[i];
            rep(i,0,d) c[i] -= prod*g[i];
        }
        double norm = 0;
        rep(i,0,d) norm+=c[i]*c[i];
        norm = sqrt(norm);
        rep(i,0,d) c[i]/=norm;
        res.push_back(c);
    }
    return {true, sol, res};
}

void solve() {
    int d, n;
    read(d, n);
    vector<Vec> a(n, Vec(d, 0.0));
    Vec e(n, 0), norm2(n, 0);
    rep(i,0,n) {
        rep(j,0,d) {
            scanf("%lf", &a[i][j]);
            norm2[i] += a[i][j] * a[i][j];
        }
        scanf("%lf", &e[i]);
    }
    // mat[i][d] -- rhs
    vector<Vec> mat(n-1, Vec(d+1, 0.0));
    rep(i,0,n-1) {
        rep(j,0,d) {
            mat[i][j] = (a[i][j]-a[n-1][j]);
        }
        mat[i][d] = 0.5 * ((norm2[i]-norm2[n-1]) - e[i]*e[i] + e[n-1]*e[n-1]);
    }
    if(n == 1) {
        rep(i,0,d) {
            printf("%.11f%c", a[0][i]+(i==0?e[0]:0)," \n"[i==d-1]);
        }
        return;
    }
    // the plane -- sol + C*res for any C in R^{dim(null(A))}
    auto [success, sol, res] = gram_schmidt(mat);
    assert(success);
    if(sz(res) == 0) {
        rep(i,0,d) {
            printf("%.11f%c", sol[i]," \n"[i==d-1]);
        }
        return;
    }
    // the ball -- centered at a[n-1] with e[n-1]
    Vec min_vec = sol;
    rep(i,0,d) min_vec[i] -= a[n-1][i];
    for(auto g: res) {
        double prod = 0;
        rep(i,0,d) prod += min_vec[i] * g[i];
        rep(i,0,d) min_vec[i] -= g[i] * prod;
    }
    double min_vec_length_sqr = 0;
    rep(i,0,d) min_vec_length_sqr += min_vec[i]*min_vec[i];
    assert(min_vec_length_sqr <= e[n-1]*e[n-1]);
    double walk_dist = sqrt(e[n-1]*e[n-1]-min_vec_length_sqr);
    auto final_point = a[n-1];
    rep(i,0,d) final_point[i] += min_vec[i];
    if(walk_dist >= 5e-6) {
        assert(sz(res) > 0);
        rep(i,0,d) final_point[i] += res[sz(res)-1][i]*walk_dist;
    }
    rep(i,0,d) {
        printf("%.11f%c", final_point[i]," \n"[i==d-1]);
    }
}

signed main() {
    int T; T = 1;
    while(T--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 99ms
memory: 9972kb

input:

500 500
60.00268893933372283 70.35885554610950976 -8.98574176457012186 46.16014112676185732 66.31422279348288384 29.03050764912902082 -35.06996828144599476 -59.10319321730690234 67.85808505028276727 20.30232033048615392 62.38784996896146140 59.92659390534240060 -36.26787439344059294 30.8251981981496...

output:

19.21314202324 6.61160103842 21.42004827104 56.93864780695 -89.71604746871 92.93228900637 70.95769159999 11.49554277966 -48.36859404983 38.69381072098 50.07742920705 7.62861162427 2.21480565127 -37.31399084293 -95.50612141061 -67.78347667255 -6.43422579940 45.24694340818 -27.51574560987 19.963864243...

result:

ok accepted

Test #2:

score: 0
Accepted
time: 102ms
memory: 9768kb

input:

500 500
-20.46791708061053328 -78.90373004342441732 -47.09421721341704625 49.96697218958462372 48.99528416466444014 -46.87780686216100889 73.68284736943891744 -53.69249802982882613 -92.37158007019175443 -97.95346943385396798 -47.79109018973426259 82.31965483504592385 -72.09718577745493917 -32.376534...

output:

-1.52153450791 4.56939357265 -55.15374000490 -30.82061230787 -4.53007111746 -40.74804909282 -98.08174663875 -70.67943356687 33.75800057876 40.83078719875 -79.97010236612 28.76110614563 74.11693817693 99.20066097362 63.14666159688 13.48723862520 87.81528089994 -79.24851687056 -94.83717688756 -18.8682...

result:

ok accepted

Test #3:

score: 0
Accepted
time: 90ms
memory: 9820kb

input:

500 500
91.75754360584323877 -74.07465057030329092 -30.06919963013949371 -22.45376960826932589 -94.33818252302211249 95.43185666705545600 -35.93139380204742395 -46.28091101025437837 20.25588702053946122 -31.98355965847254367 96.27926708531694544 17.21195108047088240 -16.00480323252260462 -14.1553994...

output:

26.96797408424 -85.51968875917 33.00515250809 56.44917679004 96.20241920521 2.14496497969 46.15930107783 -10.55247728842 95.18780892288 89.03670346652 53.30991399636 47.81093648086 -44.11493615188 -38.68117788514 20.30004648906 -79.55956738281 -83.21872812692 81.04064196283 63.60969293991 -32.594959...

result:

ok accepted

Test #4:

score: 0
Accepted
time: 104ms
memory: 9980kb

input:

500 500
53.59239375857157484 1.29576452891167548 -55.60357761919549802 2.89491049833583247 -72.25117082444128869 -44.92736039007480997 6.81675337705620166 -46.20517542139523925 20.56179110027964896 99.93596620202598046 -30.87710828002636276 60.42621397022924157 79.91458345844398536 94.56182305252031...

output:

25.33192619121 6.05132002659 41.15146068661 -77.21568857928 76.99183184581 80.56904900522 93.06870053691 -33.38783398486 -33.19327080732 -89.27631785301 60.99356088547 21.82363145809 -91.88044701368 76.37558475542 26.48459291942 -41.67736557504 16.22086461861 81.94662678579 29.06951444011 -11.928903...

result:

ok accepted

Test #5:

score: 0
Accepted
time: 102ms
memory: 9976kb

input:

500 500
-63.61543927507285190 43.87221058298641196 8.16924114047013461 -34.92232278546450175 91.80142804719758942 -76.82013016900501157 25.06001121373941487 48.24958448628115093 65.82846176112221315 33.19899446519090702 84.05389321600614494 -78.49637158041961982 87.99406312213668002 -60.859516869891...

output:

8.13485701729 -23.75727998672 -99.86678436736 78.59682054002 4.68676492974 -52.35495792473 -60.65258081641 45.10868303403 75.54516051786 -86.72220987406 46.02924842327 -47.95422161433 -96.31557085191 1.05814364859 63.37179287013 96.96924624431 99.73104802134 87.26535881989 4.43819857234 4.1533345617...

result:

ok accepted

Test #6:

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

input:

24 114
19.60728784212125220 62.05571106800468328 -77.66722345143722350 83.32150488873739391 85.61849285200199233 -61.26186974500755866 54.01645372221616981 -19.69713224000579999 -10.16958551834513003 -18.69109461054532062 9.59051520125903778 91.21514401069063638 89.60632230190051928 -51.201061482129...

output:

8.32792448899 27.93265449260 97.44854768172 38.20723899807 85.80498925710 55.07013526327 -74.25015313271 86.45729688989 -48.88003725365 -27.28058078712 97.35829655517 4.23246075321 37.09800432793 -34.46435175625 -1.52363917861 -92.85537562648 -54.07080316330 -60.13360321784 -22.70420450805 45.517584...

result:

ok accepted

Test #7:

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

input:

46 97
43.01678189681189224 87.56570778950447220 9.14039085211038582 26.33206129795307504 -24.34885933455943530 0.05861471454515765 -70.42820734313679054 59.02215026766580763 -79.72741868434044932 35.60017247547804686 25.77535585268205409 92.78420121683043931 50.59296099595243845 -61.7776387073462913...

output:

64.51729373637 -56.63065912852 59.52902845054 55.24552019431 -29.44726031319 87.75895955137 96.89781946674 75.66289111522 -36.87082630234 -61.23303298916 0.55281131356 -9.88913153102 29.95312183578 -41.15864619748 -49.73778720705 -30.59051383146 -66.74307548321 -7.51375261701 84.51567603278 55.34898...

result:

ok accepted

Test #8:

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

input:

15 284
21.00862660821213979 21.01836955459566525 -92.59898566394279840 72.83891547702586422 37.19660542291052252 58.75752575321905624 -58.77746253675046972 -75.78702662529354939 -51.08831966203057817 37.59103345051687484 78.06776201507187807 -47.64951581683278903 86.22301376779532234 87.983435491574...

output:

33.50967478906 75.44249445160 25.67205968914 -29.47474989552 86.90987259757 -24.14267641136 -91.91140907041 -79.69815261667 60.52234897389 -92.83240709055 -0.59978379964 17.59279416866 31.74353660222 35.91369502784 53.43579812000

result:

ok accepted

Test #9:

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

input:

19 424
-16.81700811299913312 -99.00108212106096062 -91.34139981256581109 60.88738598253169698 96.60168904677493629 25.16047301803423863 39.17587188905130802 -88.89020758325538907 16.66405739466397051 14.19779632163533734 -12.13768283737013576 94.71465700089734696 -4.46422341014425683 99.590922359294...

output:

-4.63500331703 -62.57089027602 -96.33211903609 95.04478216055 -54.66562834190 83.47658303595 -88.33076212147 34.73620353903 -64.05105600812 -25.60752296629 46.19726529303 2.37262974810 -10.05919816115 -13.78282656223 22.20361276093 59.36790871031 97.25181845327 -57.76274500650 -81.96364054410

result:

ok accepted

Test #10:

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

input:

39 240
-17.49573620249577743 -14.20168813856275847 3.40454276185926119 75.25294275126461230 3.64382503532986846 -66.13690704428722711 9.54219281803891306 4.33429550843416678 -93.68468592834675235 -17.02270905586702554 18.67022731122480650 63.43606748481644786 14.80457613629361902 -82.867111145937784...

output:

-88.19744790798 -18.16043304777 61.74612726303 -72.31377471781 -79.02983878517 92.29143358014 42.05751488097 11.75641373700 82.45854435605 -5.80032712134 -82.15955152214 70.77791203905 3.16069380078 -87.67001664480 77.54991566110 -33.80611035640 -31.92219880422 -7.74126569458 -6.06271177640 -25.2708...

result:

ok accepted

Test #11:

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

input:

94 37
-97.74217056704389961 -34.72707124177070170 -5.18996578341727854 89.27537859475728510 -15.17925192708750615 -58.80623411956585045 6.67768502706442746 9.27371520989450460 -0.76898730002019988 -12.16379417034083588 -97.04781848445374237 -4.61915628555445323 67.16463977789777573 -98.0799613713748...

output:

62.83686847610 -45.18386640994 -62.33885445051 35.66776750324 15.41804921590 -28.22652648106 43.06090894769 37.65224982269 -86.03857713269 -67.50032710999 54.44088609862 -52.98869488013 -34.63282837090 -7.82743791504 60.75493615948 -113.50406352095 73.05711780376 11.93099422930 -1.67400549806 40.263...

result:

ok accepted

Test #12:

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

input:

81 31
51.81180666086186193 4.42519101702015405 -99.52683614255568045 -78.73219118895721635 79.13631206663259832 -62.14210001674649675 77.01555907099057663 96.10429867603977527 -71.63979952372569926 31.92804200050832719 2.39923469427824898 -15.81312766092013078 -3.78675758288882491 -96.89700984284483...

output:

24.15211295210 9.44814439988 -13.74762358083 -80.11642216176 35.69985633821 63.75971427845 5.63878873313 -44.07635940122 47.34728744082 19.73119506702 -85.17594640061 -83.80324474677 65.61977160029 -12.44453666941 -22.15901143676 -100.42646381711 -9.62096189217 50.28009540040 58.23903928801 0.704167...

result:

ok accepted

Test #13:

score: 0
Accepted
time: 44ms
memory: 5740kb

input:

368 15
22.30119005935810605 43.42786705247092982 -32.28926734891730632 -57.98761219344181939 -45.31478884634214666 53.04804763990063066 46.08811206966319673 -45.60493877541469487 -14.51504417311522843 85.52370945799654578 92.80145323913885136 94.08183990667501462 96.53825049915519685 -51.75960693925...

output:

-1.02981359026 -50.00605046396 -1.58405048346 -16.18030387997 -12.02526360398 -20.70102948648 -30.26938729969 19.76048674769 -22.46145747214 3.89834691073 -26.69059366221 11.85197825890 13.90999830750 14.42702444437 -24.24812574301 -9.62166874200 -26.34044415330 -13.13608329380 14.94749658777 19.633...

result:

ok accepted

Test #14:

score: 0
Accepted
time: 58ms
memory: 6128kb

input:

417 40
44.68655184642963718 -99.57530073803870607 -14.93036383109003395 23.41593487735389090 29.30749689971099770 -12.17392273069064856 79.34058425615467058 -35.84876537980680666 72.50759393990819035 83.68078753407559134 -5.69786294576199737 -6.93653269724951826 87.39999249217245847 64.6174490928109...

output:

-10.94896809068 -17.14216520518 -2.19154808716 11.82767267178 -50.32033420539 -23.33906701009 -1.13473511732 -20.17661332821 -25.22304578877 15.54469760194 16.80956931962 -6.14589772054 43.63391764651 -2.55086303358 -17.81782342543 7.19465425182 -10.67123777256 9.86766378059 17.29956817790 -27.63110...

result:

ok accepted

Test #15:

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

input:

117 39
93.39662242328662956 49.47614796316665320 88.12818584496389462 -41.60092472064344804 -93.31577807190411988 40.70668323938937760 97.74228125485441865 16.47170421620938896 19.20357999198667187 6.73479762799897230 51.00910155069405505 -23.32922732808970068 12.15698653971175247 26.846191807017191...

output:

-46.08377558873 -46.37764115791 -81.35472120319 -60.03744722906 18.43595524358 -13.44624665491 45.47812839160 -72.07432066859 -90.10590130081 38.50587733620 33.13197169067 81.18419993235 -41.70169997378 16.39945055841 -17.95191533887 53.72236225618 43.79733093711 -52.15803225894 -7.26853513627 -2.25...

result:

ok accepted

Test #16:

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

input:

241 283
-19.74999113405426954 79.74118587123592761 -66.12366621234484398 23.16116059608839350 -90.51891922181988548 -16.33163848510163518 -55.57111970452539396 13.82071494892652197 0.16803096716331822 -90.49296540512135323 95.43035627948418664 39.25164085774440537 85.85545452213210638 86.25017616286...

output:

45.12994083688 -55.08236524813 4.81801253009 42.53181855401 -10.49200471496 17.47825643348 70.02097153002 -23.97648223615 -58.77475760224 43.26564214338 53.16033754098 -92.93332051224 59.33844457011 -85.74203751598 88.21243372660 -96.80745193933 44.09158398116 62.02744090720 -78.21396364455 -81.4716...

result:

ok accepted

Test #17:

score: 0
Accepted
time: 14ms
memory: 5020kb

input:

234 170
17.48242787918205465 -6.23520728156945836 -58.20418797754270201 72.96983900160395820 -57.35562673978773773 23.50789751949704964 -93.48884020852364074 -58.58187880824885241 -6.27698524763198407 30.85797535881991394 15.89004512612999065 47.23272911191250500 46.93072199569382974 28.367228113369...

output:

-2.60005249625 -33.08981367581 75.53516120191 -8.14211455586 35.79558683897 -109.85559332940 -23.76020348063 46.68575484133 51.62671382559 18.62685955459 -38.76673048964 -44.89586969321 -32.13019913783 11.25967123849 25.37269339209 5.97452857685 90.92584597892 -19.57428856535 11.37143982115 -118.060...

result:

ok accepted

Test #18:

score: 0
Accepted
time: 51ms
memory: 7016kb

input:

426 246
71.66651361980424895 -37.13107603142846358 -28.40069303830554759 -10.19303738189702813 -40.17751195221595140 80.86389914715766736 1.66282015418795481 26.86828575747655634 7.53315494638275140 5.60609191203955959 16.16504461034760709 19.69955383812136063 -60.18599916098141733 57.91579148537024...

output:

45.53625467205 -28.25423099047 -97.30778458115 15.14886107161 49.94425147952 -47.40511741017 13.86626585343 7.23207223608 -36.58299036140 -18.65779842907 -3.88581455722 -81.96705970489 96.13845255347 -15.18637268479 20.55004800368 -106.99545277280 -28.12582449132 -5.87287309942 -40.80713996130 14.37...

result:

ok accepted

Test #19:

score: 0
Accepted
time: 11ms
memory: 5112kb

input:

190 284
95.33837930303232611 -41.86466971541977955 34.60737779146913340 86.42312952325917763 -62.09721991997125912 52.95486745168355469 -60.47601569570841917 52.36070938755642601 78.02362095964224409 -40.03509120445565372 -83.80692034017873482 -22.71023924588195086 -96.86106094837492719 -40.94740162...

output:

64.13382366497 85.41603338139 52.96896717874 -47.51342551800 27.05841063699 44.71118576652 37.38888450973 -85.93058611697 74.39977446539 4.27376314436 4.61437017037 -81.22735518505 -30.58740665903 75.28802403488 51.57301438155 -37.44503807422 -90.90679478498 77.41207490035 -85.35548260522 -74.909574...

result:

ok accepted

Test #20:

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

input:

355 70
-56.70334470987275211 83.83574979083198286 -5.81321312184857675 -19.10716154891068186 16.13137087617899113 -92.96665311525518405 -24.53366679341564804 -37.69497211956019100 85.70887749812533229 -4.68107417305449758 73.65067115386159458 11.42163179112867510 -40.68482028628190506 99.62559275702...

output:

46.23830335365 33.63791263613 -16.71585257020 6.72934523119 -31.50458799598 -13.81991408720 -14.81611695124 -15.41721668729 29.88602606880 -4.98235145293 -53.80127475649 -3.57940882257 -2.40084051009 16.46275667279 61.89235502259 -75.07983652936 -21.27184164811 -7.61747914011 20.84157205181 31.58508...

result:

ok accepted

Test #21:

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

input:

3 256
-78.12078435409665644 -85.08018381555004339 87.27205179005167679 223.75860580275852385
21.40601932440704047 9.30524175131506581 97.69241472114146063 183.70431698693087696
20.78669854557880114 -66.93205030620063667 -81.82893737964754166 71.55186936559947242
73.33954619520272900 -79.946056691508...

output:

88.22309970339 -57.54516503536 -59.83147858308

result:

ok accepted

Test #22:

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

input:

5 62
65.67809116043918038 -6.95511245917114707 -65.58594103434151634 -24.98238854102574180 -67.64097332382888794 228.65240929183204344
-28.14639570969237070 81.15495829921940185 52.15853584132665333 -60.21000033537702478 17.11911053485283674 185.00177462895109670
97.86755108938794478 -40.32231891383...

output:

-32.56865406430 -43.89155265021 32.45397929230 51.13541072015 93.16778070312

result:

ok accepted

Test #23:

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

input:

2 288
67.61542933343602613 47.25973109181069276 55.13980825108462369
-3.30426408588533604 -40.66692809464620240 167.60932009470940329
36.89409537586234933 30.54619728617115015 86.81691326794248198
-52.65998100097790768 -80.55976539875601361 229.44900096368024833
-36.19022124198538393 -30.51418398431...

output:

94.79411877296 95.23594701508

result:

ok accepted

Test #24:

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

input:

2 285
-73.49177140120454510 -27.45921977176388395 71.97435646756392202
-11.36332241290563161 -67.41256152462275963 79.18940613722345745
-83.02790342763361764 -3.00818194921774307 95.64056891698483298
-76.94037376060684608 69.82459223195203890 168.62048209786297548
-22.19881633373093166 -56.253430626...

output:

-84.13462529019 -98.64234733734

result:

ok accepted

Test #25:

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

input:

3 90
-80.47872995421107589 43.14208059911129567 57.43992229711068376 57.74639348045803899
-28.84828191978905920 86.94632424083388855 -50.35702772129035765 140.97797732099354562
91.43729149053109495 91.54935218332136060 -80.66735336723134253 227.76796873221641704
97.48224581178627091 28.6090833518682...

output:

-70.95202122637 -11.49500477143 41.35649346409

result:

ok accepted

Test #26:

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

input:

189 1
58.20260994210622130 68.67758954964745044 -19.59536415957194322 -12.42121673471461918 3.64325992063163540 -30.46552521233776645 -46.87401011352478974 88.94910269066244268 53.50792334672570405 90.68612616445304297 -40.41474055830889256 -30.43526744898518643 72.26612568067025677 62.3780757071544...

output:

1222.82586849857 68.67758954965 -19.59536415957 -12.42121673471 3.64325992063 -30.46552521234 -46.87401011352 88.94910269066 53.50792334673 90.68612616445 -40.41474055831 -30.43526744899 72.26612568067 62.37807570715 -55.49330386873 65.35519140313 -96.74992790483 1.16732167933 -42.14023707965 -34.13...

result:

ok accepted

Test #27:

score: 0
Accepted
time: 6ms
memory: 3988kb

input:

176 2
64.69868387712475055 -27.91921028014630224 -35.62410375680170205 46.95212302978166008 46.20202416344471885 11.91453444287495245 44.88399112031871141 33.90929126197823962 6.50449209474628276 -22.99563630094168332 66.75691023795118895 98.45710690993425374 11.03714286060825600 38.3844801382377056...

output:

-13.50785253512 26.60425289857 -25.01319033491 1.15396835598 -2.02219125688 -32.93749749178 15.33779544976 -31.81843087484 -23.99532044376 32.53542422598 72.02981942829 56.66095344399 42.24772404177 19.09417960658 42.33127754455 80.42050652336 -17.90704236035 -59.59444781279 15.34310512940 11.539461...

result:

ok accepted

Test #28:

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

input:

142 1
2.61917874832131758 -44.49335970449552491 -89.95075503127318939 12.71322648591490179 -52.43006486889640883 30.50437191800213554 34.55669292055185338 -99.07301933969634433 54.67370989914240909 82.56871783156776701 35.28440404839267330 23.24306531642055518 2.32687053783197939 96.1049017411075396...

output:

1013.36169047047 -44.49335970450 -89.95075503127 12.71322648591 -52.43006486890 30.50437191800 34.55669292055 -99.07301933970 54.67370989914 82.56871783157 35.28440404839 23.24306531642 2.32687053783 96.10490174111 -73.30313177462 -87.01089403926 -16.79539324707 99.20304837958 -86.70675806541 -55.39...

result:

ok accepted

Test #29:

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

input:

269 1
-18.11564699214282825 48.89329814876245450 10.25015011623035832 25.32240200911952854 75.51469006374665582 -76.79568060899211446 -19.63802183502471621 33.17947978970394729 -48.94987597943094215 -73.78919575498612460 70.21565201752056851 -39.47666698703496024 -21.62615675669682958 86.27099155645...

output:

1276.36353812071 48.89329814876 10.25015011623 25.32240200912 75.51469006375 -76.79568060899 -19.63802183502 33.17947978970 -48.94987597943 -73.78919575499 70.21565201752 -39.47666698703 -21.62615675670 86.27099155645 80.56072323114 49.41050144032 17.57512498411 69.45930222774 32.83498811081 72.2832...

result:

ok accepted

Test #30:

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

input:

365 1
23.10990626783959101 -19.34586909615229899 -6.96875501077262527 0.34456297554396542 -68.98648584155537833 45.25601970715359812 68.60001376171371135 36.16207162122566388 -10.16330581679738998 -75.81533995340706156 -6.26078062613449049 -22.83426846904002616 -0.38841161702536908 -54.0019017863873...

output:

1603.39717578494 -19.34586909615 -6.96875501077 0.34456297554 -68.98648584156 45.25601970715 68.60001376171 36.16207162123 -10.16330581680 -75.81533995341 -6.26078062613 -22.83426846904 -0.38841161703 -54.00190178639 5.39004238075 -52.22380785136 -90.52535896020 -27.02793211585 -22.96690722134 82.54...

result:

ok accepted

Test #31:

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

input:

1 50
64.85923222597955373 142.33999735768676942
50.35893895506274021 127.83970408676995589
22.25990417897902773 99.74066931068624342
31.69844616118842850 109.17921129289564419
41.11605242885241296 118.59681756055962865
-14.53903472845199474 62.94173040325522095
7.16711415864197932 84.647879290349195...

output:

-77.48076513171

result:

ok accepted

Test #32:

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

input:

1 35
-63.96499900778515979 92.42594280702650167
-97.65209571809808153 126.11303951733941631
-16.94036411896613004 45.40130791820746481
31.27236822709244279 2.81142442785110802
59.66364729851866855 31.20270349927733378
-13.91940073632100905 42.38034453556234382
84.38071434215464706 55.919770542913312...

output:

28.46094379924

result:

ok accepted

Test #33:

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

input:

4 40
-78.88287946648640059 -16.62811043870746630 55.42580123616482979 -27.60828113441841936 42.27328257616783702
-4.44671157404496853 76.96604175426281813 -89.54380830984523243 41.72058886140729328 191.53589735859455345
72.64002654217250665 -9.32083710196556581 70.57806486032919224 13.08783991774646...

output:

-70.56845566612 -19.60988190857 59.42843279361 13.53766345492

result:

ok accepted

Test #34:

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

input:

5 13
-30.20478063995581408 -21.92814177313326240 -42.44461805817634570 53.26364498645679646 -38.29485661681562192 178.49998050244400360
79.33616890572326952 -36.55946469637649443 70.66985014615084992 -35.10446941162146572 -27.84666177369450679 231.22874657286951106
-36.45626834700239272 -47.12700376...

output:

-64.03266881891 -44.48198860609 -78.79963657432 -83.61885719528 62.45599568191

result:

ok accepted

Test #35:

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

input:

4 30
-52.27220939583720849 -21.57455471727385543 -92.94275176104298453 -2.08091573560969323 222.18345742802782183
31.93363561461731592 79.52292552785885960 20.52784410115411617 -75.35177279991810906 148.93820933276847995
90.67502095256182315 6.20398392101894558 -47.20102188425261147 -70.824847184737...

output:

81.76749908595 42.54929919574 62.67908662093 53.31601633421

result:

ok accepted

Test #36:

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

input:

32 3
65.85785916178218713 6.85831609194293890 -15.30976888031534600 -75.30692283941316134 -65.15190131352440517 4.24801038535771625 -39.15741921390454650 -29.82560345081593312 53.72937478242073439 -11.81599701215840525 -4.05299000922640573 -11.25984288284671209 65.93865938982881403 -58.2166489679021...

output:

-12.00598841599 41.37920078737 -1.90274162745 -117.17195288760 -40.77395562201 11.75906748858 -8.94313275808 -36.31231006127 61.74602875260 -16.44771650096 40.43296289203 13.25950402233 30.26425138350 -11.35696309035 -80.17632155386 -59.20119132834 -25.54779129927 5.14957201310 34.76647281211 25.897...

result:

ok accepted

Test #37:

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

input:

38 2
-11.00959245879337800 -98.54947151225621838 87.90194151190249272 79.43936287611617786 -74.90189040412091970 -11.83750916384980201 17.01024400929949820 47.32337864655207227 -50.71076964359703965 88.34814581531549038 -57.48722708019155903 69.10969047227212059 -63.64323574333847944 46.273308018178...

output:

-18.54134814024 -23.21852445092 16.96661943056 33.31079685074 -66.06391509095 -53.48370939837 -14.98313540449 10.35570323647 -9.71598452809 -0.05461332142 -20.65246425746 30.20609933451 15.13522898206 11.47499793648 -35.76305621202 56.32569618957 -33.22083961148 38.50095928853 -0.68774151723 16.5524...

result:

ok accepted

Test #38:

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

input:

13 3
72.24227664015296568 -18.55475164866786031 -43.11613144157464461 -19.60013839034118632 -49.91944199079070188 56.95177036488686895 36.13145534554163874 24.03291645605759186 -2.76856941433743486 6.55848694395515963 95.16901416342369657 88.75458089509112369 64.94847015738687901 255.715363806645768...

output:

-35.88730421378 -50.47268939507 -45.54562367480 -35.29315595754 -51.16138616724 5.15833921772 41.78822767336 23.83152625841 -34.17878998198 28.75628516028 50.66216905958 -26.71686591640 246.38003574107

result:

ok accepted

Test #39:

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

input:

7 3
50.23373989604388612 -69.88780252595731213 -57.22906978031703318 72.98567895437884090 -79.89238323261915298 95.92483451230395985 73.09642064722774535 325.02755887566917181
-43.98084472900853825 -62.70100814910448861 51.85828895150689277 27.97126637152686612 50.19393264295089807 -27.7406974710397...

output:

-64.57206324042 -45.51251211115 92.84003925947 9.12363828830 113.94279501859 -67.85786804857 102.63350073663

result:

ok accepted

Test #40:

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

input:

19 3
-95.01393013899175344 31.59516925395340081 -3.67075244178249704 -89.77833166653650210 -18.85584753567273708 -50.84872526166284246 -87.16802093411190810 -32.09059765388832375 61.26348422715224729 23.73763770129502859 -97.41812087078032789 31.23032882316439895 -76.51134982540250462 67.44597527526...

output:

-53.76612878411 55.71694436361 -85.28522000003 75.37995436137 51.75330378019 -73.87395549036 -10.09848272743 -14.31728980729 46.57823726868 81.99966354043 -10.91718522353 1.71596428343 -76.03562241436 -126.87413339232 66.05201910656 4.01883028881 12.87599555795 54.52543489618 205.61860165669

result:

ok accepted

Test #41:

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

input:

22 28
62.22846464524795351 5.52663569851108605 59.49083017069543189 -96.51619459249974398 14.39031059433443716 -72.01045224882811624 95.36731661679002059 62.99349464476318872 -65.24414346153614019 -97.86066379894597844 92.43138700007429520 -28.20042145250897647 76.61643639268277184 -57.8696335739639...

output:

-29.92234189294 -99.74477884282 60.93977332233 -50.33327662437 -0.85215100344 97.90419076513 -36.61160690606 28.17097889340 67.28637416625 -92.04185554082 -71.08940580729 -93.61429366362 -41.86566000048 35.20589985243 1.88278106067 -98.87417287160 -86.20667838619 -34.92715338810 -73.56864098454 -41....

result:

ok accepted

Test #42:

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

input:

33 29
60.98557245693638151 -18.07931759228927149 47.71722790226277766 60.44200815872247290 15.78747444985293669 27.02244757659153152 -68.15148066296292484 -14.75753957216141998 -81.13645066198384370 69.20252380370021683 -84.97403737237749510 42.69315642512637510 -61.23527084314732605 -22.48730719942...

output:

-32.04061615998 -12.22411230396 -76.02730868417 -68.41919146417 18.62217371156 -53.83469072866 28.97144124287 -23.90247085291 -38.72827972255 109.00716760412 -31.63624717155 -95.78234988220 112.42520138809 87.37663165808 -100.42029254076 68.64526483921 14.86740145834 -101.20508343414 13.16478201101 ...

result:

ok accepted

Test #43:

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

input:

24 14
-17.40138662805254910 55.03045505086637945 49.70539016308549662 15.26128344392927261 77.78369228783481049 75.64393879487477079 -92.13067565639920531 81.94847875525715608 -72.78803589017901743 -63.06606871805424674 49.23417172729224944 -78.33066588806227060 -55.64576453861675986 -94.46348476940...

output:

-67.17417681861 -91.97652545710 48.79640737533 38.67136979967 -43.91177205367 42.73675629464 66.98304697580 -38.08418483717 25.46533418742 -13.64487205524 -26.97166917020 15.22081793096 -19.03593346815 33.44343735787 -16.43842255019 -12.56949955455 -24.20859379502 -18.78397382461 -34.27474934485 -17...

result:

ok accepted

Test #44:

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

input:

12 6
90.76755547853997541 40.86624230264283142 17.87869966661719445 98.08085221620558514 62.38376631439496123 42.38025343316073190 76.29870786465647825 -27.10931954515942266 80.08309062453179195 50.50807728486387305 96.60736437520210984 -75.85430013538719152 315.04833172222373605
82.1123285886446865...

output:

64.06900527360 39.72505282896 30.56206698726 -23.84900846657 20.01660581062 27.95184976482 105.73175917758 -53.60928545273 -6.99696930663 84.31930067268 -35.21311792150 156.17822915737

result:

ok accepted

Test #45:

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

input:

24 18
-87.49764639603955629 -47.74586257973560777 48.59043969065740498 -80.41410235408326912 28.89032206299071959 -47.13669365527315591 28.49575702908228436 73.78279256909192441 -13.32054095999075116 50.44405826937537540 -12.24037261107096697 -75.85092891984008645 85.28969143528902919 -68.7066743703...

output:

34.19012406414 99.13869335713 -9.40314669504 39.17499530736 77.65593208096 -1.57642957154 65.84617936249 22.58286063770 -22.53657135864 103.97266022507 -9.19300453318 42.74545521660 8.49172184188 -36.33434434417 23.46444580692 62.12654014920 -89.42755695037 -49.69436220405 -89.37667125636 83.6089450...

result:

ok accepted

Test #46:

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

input:

5 1
-98.92874737593162138 61.13121144302337484 -55.35187132540717414 31.04973951571832913 -12.86232323817209533 153.48461134875867629

output:

54.55586397283 61.13121144302 -55.35187132541 31.04973951572 -12.86232323817

result:

ok accepted

Test #47:

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

input:

5 1
74.45601861721232240 -88.25221705818179885 -21.89425418617103958 51.81808193090810732 -65.37432640384588467 220.12839308526943682

output:

294.58441170248 -88.25221705818 -21.89425418617 51.81808193091 -65.37432640385

result:

ok accepted

Test #48:

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

input:

2 2
4.14909935574205235 -78.28709659608364291 49.35646372696943018
-45.22408328403919597 19.66777996170694109 106.04657364268864228

output:

39.61330808486 -43.95998761719

result:

ok accepted

Test #49:

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

input:

3 3
78.43191720848898285 -62.52454077645417385 -29.56285570729887979 202.64545693825559169
-94.21198895074385860 -45.13275298277459058 39.17395136772466913 167.87300349011442790
-8.34170007575511363 1.09250804587503580 -60.95208781815404109 173.09105656783955851

output:

3.16780711449 80.90700994133 92.20694846501

result:

ok accepted

Test #50:

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

input:

2 3
-39.02285862135088479 96.05974306394270457 192.78968611015349666
-92.31646382797036665 95.94080691707665665 202.03332590641781508
80.44236050212563782 -92.11837389867663717 111.53034736239179381

output:

-30.99939319811 -96.56291155657

result:

ok accepted