QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#378094 | #2173. What's Our Vector, Victor? | distant_yesterday | AC ✓ | 114ms | 9992kb | C++20 | 6.1kb | 2024-04-06 01:11:10 | 2024-04-06 01:11:11 |
Judging History
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');
}
const double eps = 1e-11;
int sgn(double x) {
if(fabs(x) < eps) return 0;
return x > 0 ? 1 : -1;
}
struct Vec : public vector<double> {
Vec(size_t siz, double val): vector(siz, val) { }
#define v (*this)
double operator * (const Vec& rhs) const {
assert(sz(v) == sz(rhs));
double res = 0;
for(int i = 0; i < sz(v); ++i)
res += v[i] * rhs[i];
return res;
}
Vec operator + (const Vec& rhs) const {
assert(sz(v) == sz(rhs));
Vec res(sz(v), 0);
for(int i = 0; i < sz(v); ++i) res[i] = v[i] + rhs[i];
return res;
}
Vec operator - (const Vec& rhs) const {
assert(sz(v) == sz(rhs));
Vec res(sz(v), 0);
for(int i = 0; i < sz(v); ++i) res[i] = v[i] - rhs[i];
return res;
}
Vec operator += (const Vec& rhs) {
assert(sz(v) == sz(rhs));
for(int i = 0; i < sz(v); ++i) v[i] += rhs[i]; return v;
}
Vec operator -= (const Vec& rhs) {
assert(sz(v) == sz(rhs));
for(int i = 0; i < sz(v); ++i) v[i] -= rhs[i]; return v;
}
Vec operator * (double k) const {
Vec res(v); for(auto &g : res) g *= k;
return res;
}
Vec operator /= (double k) {
for(auto &g: v) g /= k;
return v;
}
void do_normalize() { v /= sqrt(v * v); }
void show() const {
for(int i = 0; i < sz(v); ++i)
printf("%.12f%c", v[i], " \n"[i == sz(v) - 1]);
}
#undef v
};
double dis(const Vec& A, const Vec& B) { return (A - B) * (A - B); }
// 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:
tuple<vi, vi, Vec, vector<Vec>> gaussian_elimination(vector<Vec> a) {
int m = sz(a), d = sz(a[0])-1;
int 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])) {
if(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];
a[j] -= a[pos] * f;
}
a[pos] /= a[pos][i];
leftp.push_back(i);
pos++;
}
debug(fre, leftp);
debug("G", a);
while(sz(a) > 0) {
const auto &last = a.back();
bool last_zero = fabs(last[d]) < 1000*eps;
bool pre_zero = true;
rep(i,0,d) pre_zero = pre_zero && fabs(last[i]) < 1000*eps;
if(pre_zero) {
assert(last_zero);
a.pop_back();
} else {
break;
}
}
assert(sz(a) == sz(leftp));
assert(sz(a) <= d);
debug("DROP", a);
// solution
Vec sol(d, 0.0);
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]];
a[j] -= a[i] * f;
}
}
debug(sol);
// orthonormal null space of A.
vector<Vec> res;
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) c -= g * (c * g);
c.do_normalize();
res.push_back(c);
}
debug(res);
return {fre, leftp, 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]);
}
debug(mat);
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 [fre, leftp, sol, res] = gaussian_elimination(mat);
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]
auto min_vec = sol - a[n-1];
for(auto g: res) {
min_vec -= g * (min_vec * g);
}
double min_vec_length_sqr = min_vec*min_vec;
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);
debug(walk_dist);
auto final_point = a[n-1]+min_vec;
debug(final_point);
if(walk_dist >= 5e-6) {
assert(sz(res) > 0);
final_point += res[0]*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: 114ms
memory: 9744kb
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.21314202328 6.61160103841 21.42004827099 56.93864780684 -89.71604746868 92.93228900637 70.95769160007 11.49554277970 -48.36859404984 38.69381072100 50.07742920704 7.62861162425 2.21480565119 -37.31399084287 -95.50612141063 -67.78347667256 -6.43422579941 45.24694340816 -27.51574560991 19.963864243...
result:
ok accepted
Test #2:
score: 0
Accepted
time: 106ms
memory: 9896kb
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.56939357264 -55.15374000490 -30.82061230786 -4.53007111745 -40.74804909282 -98.08174663875 -70.67943356687 33.75800057876 40.83078719874 -79.97010236613 28.76110614563 74.11693817693 99.20066097363 63.14666159688 13.48723862520 87.81528089994 -79.24851687056 -94.83717688756 -18.8682...
result:
ok accepted
Test #3:
score: 0
Accepted
time: 109ms
memory: 9744kb
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.00515250810 56.44917679005 96.20241920519 2.14496497969 46.15930107783 -10.55247728842 95.18780892289 89.03670346651 53.30991399636 47.81093648086 -44.11493615189 -38.68117788513 20.30004648906 -79.55956738281 -83.21872812691 81.04064196283 63.60969293991 -32.594959...
result:
ok accepted
Test #4:
score: 0
Accepted
time: 111ms
memory: 9832kb
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.33192619116 6.05132002660 41.15146068664 -77.21568857925 76.99183184577 80.56904900520 93.06870053691 -33.38783398486 -33.19327080732 -89.27631785303 60.99356088544 21.82363145810 -91.88044701367 76.37558475542 26.48459291937 -41.67736557505 16.22086461857 81.94662678581 29.06951444015 -11.928903...
result:
ok accepted
Test #5:
score: 0
Accepted
time: 107ms
memory: 9992kb
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.75727998673 -99.86678436737 78.59682054002 4.68676492973 -52.35495792473 -60.65258081640 45.10868303404 75.54516051786 -86.72220987406 46.02924842327 -47.95422161432 -96.31557085191 1.05814364859 63.37179287013 96.96924624431 99.73104802133 87.26535881989 4.43819857235 4.1533345617...
result:
ok accepted
Test #6:
score: 0
Accepted
time: 1ms
memory: 3876kb
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: 4212kb
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: 2ms
memory: 3892kb
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: 0ms
memory: 4144kb
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: 3ms
memory: 4052kb
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: 2ms
memory: 4004kb
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:
-15.97336153931 100.45231212648 41.95675121558 79.15039474544 12.29804581110 -9.38714894951 83.36801976249 132.69395579814 -22.14797180014 -137.30720140019 49.23359780722 -100.42615729445 3.68488034922 -39.99338871782 68.38849834667 -79.32616538616 -47.82630237330 -49.58175934385 78.89858474906 -27....
result:
ok accepted
Test #12:
score: 0
Accepted
time: 1ms
memory: 4088kb
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:
62.09710899268 -25.94323736458 148.23046970390 -166.14843604622 -77.35364296264 -30.57310986311 22.45393826947 -73.36819606118 136.89679312911 -45.99239940874 -56.46386387481 64.53073279839 74.84896859258 -29.18929536824 -49.54739445452 -129.42275569860 -15.57247407860 38.23720218561 44.13998879925 ...
result:
ok accepted
Test #13:
score: 0
Accepted
time: 26ms
memory: 5492kb
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:
49.12337187466 -0.22892238484 -80.93295184434 406.22406917672 -4.20434388784 -376.58246634540 54.37255007722 -51.03057737144 533.28373931121 476.21148599243 -116.68008102264 285.14559733280 216.33688583016 394.50273422970 258.16607766304 -5.15544900403 -43.70721989484 -22.43410325033 8.82094522488 2...
result:
ok accepted
Test #14:
score: 0
Accepted
time: 40ms
memory: 6292kb
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:
-479.74081654357 -223.34524735225 8.11921147801 74.54433902884 -158.19519066991 454.27176467489 0.33628992438 1.59949873915 170.23764630482 -178.39859228220 78.03017181161 -140.28968261092 235.53994653420 -22.83824740588 -106.43300153685 -29.39514169105 274.68328339156 -141.77648831641 -58.734282980...
result:
ok accepted
Test #15:
score: 0
Accepted
time: 2ms
memory: 4096kb
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:
-24.10419020801 49.78818263055 -84.98359538802 -182.41088237061 63.94910542582 -36.00769532854 -77.96114064458 150.14499146319 20.50790304107 146.97129876024 -37.55669709800 76.72476113593 12.10310131826 275.75816133991 73.78760592793 9.64703835027 32.02260552175 -93.77129697327 -40.46123876959 17.7...
result:
ok accepted
Test #16:
score: 0
Accepted
time: 22ms
memory: 5724kb
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.47825643347 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.21396364454 -81.4716...
result:
ok accepted
Test #17:
score: 0
Accepted
time: 14ms
memory: 5008kb
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:
25.04880927491 27.05164902865 114.19105622999 -84.57890766436 -5.93522184542 -112.46203828712 -106.56721618297 55.13514315693 58.30885223521 -21.79652184622 -101.50456980815 4.10544160000 -43.01321606395 -20.97486126913 13.68930691645 21.81772791314 37.92990075076 29.56494582190 10.40828506738 -32.0...
result:
ok accepted
Test #18:
score: 0
Accepted
time: 49ms
memory: 6924kb
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:
81.89733979093 -81.47695636972 -91.37560324463 28.99175500047 49.08275119220 -56.96154136771 -16.90341757403 -8.99449246589 -81.39306616057 -5.36170108980 -80.83737243986 -112.59420291286 69.60946910783 -59.61151033335 -28.18561829034 -52.70160196092 -28.97347956457 51.09993142161 -62.83139496303 -3...
result:
ok accepted
Test #19:
score: 0
Accepted
time: 17ms
memory: 5188kb
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.27376314435 4.61437017037 -81.22735518505 -30.58740665903 75.28802403488 51.57301438155 -37.44503807422 -90.90679478498 77.41207490036 -85.35548260522 -74.909574...
result:
ok accepted
Test #20:
score: 0
Accepted
time: 24ms
memory: 5460kb
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:
34.70125034270 -40.97458733431 133.20220075026 199.43139176275 -215.89159678405 227.43711263889 -123.20732429801 -94.52786236093 101.32974039887 -57.92565596176 -199.60699589040 -192.41356314353 -213.22943145557 -139.93703197566 127.72921722588 117.67750906934 20.15985617157 -10.77179232137 172.4642...
result:
ok accepted
Test #21:
score: 0
Accepted
time: 1ms
memory: 4104kb
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: 0ms
memory: 3908kb
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: 3856kb
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: 3972kb
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: 0ms
memory: 3812kb
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: 0ms
memory: 3804kb
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: 2ms
memory: 4404kb
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:
510.30567925697 769.97054407899 -25.52071873624 3.34453040290 0.28441119894 -30.79218924556 16.75101341297 -28.67462181596 -22.53649022973 29.87932957584 71.77761200134 58.66009660035 40.75489720006 20.01684997440 44.37652532811 79.62107259849 -18.83703542494 -60.89476042382 13.96568779289 9.2159784...
result:
ok accepted
Test #28:
score: 0
Accepted
time: 0ms
memory: 3804kb
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: 0ms
memory: 3812kb
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: 3896kb
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: 0ms
memory: 4108kb
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: 0ms
memory: 4108kb
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: 3908kb
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: 3936kb
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: 4092kb
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: 0ms
memory: 3908kb
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:
103.25174053438 110.22545925595 305.85373436111 -86.32973899349 -13.73049444607 25.98487012208 -5.30228418115 -41.85634944011 67.83522862844 -32.59772836829 24.90495448383 4.20420613296 28.99079098026 -24.93322383796 -78.76768253831 -39.98812396352 -10.66347658084 -14.76911757186 17.86619183807 36.4...
result:
ok accepted
Test #37:
score: 0
Accepted
time: 0ms
memory: 3988kb
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:
396.08617253880 26.38422234131 9.37059354789 28.37117338562 -65.11751085595 -57.94334397271 -18.40910896704 6.39706301327 -5.32610597880 -9.52111924258 -16.70805682300 26.04015384303 23.57112860855 7.74866165861 -31.63869557363 57.25293135029 -39.77087798178 44.96422805208 -5.90484011893 15.44504123...
result:
ok accepted
Test #38:
score: 0
Accepted
time: 1ms
memory: 3768kb
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:
-42.27908315747 72.81150747999 131.51063501883 -30.25310057129 -43.69173701560 15.38893635931 33.76709396031 24.64120854662 -26.57145189101 25.70095847653 44.23611244339 3.02332633543 39.06053200800
result:
ok accepted
Test #39:
score: 0
Accepted
time: 0ms
memory: 3708kb
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:
22.82981726640 -125.70053272091 144.28850623151 16.93201316271 89.61825002370 -48.61682708746 -18.55173583189
result:
ok accepted
Test #40:
score: 0
Accepted
time: 0ms
memory: 3772kb
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:
-121.42981206944 289.65404753061 -0.43694415173 6.40945171882 20.54152045863 -45.15308019635 -18.47525228700 -19.58491981779 60.86942961975 39.42668993718 -29.51328034828 -13.88107016873 -78.69888112466 -68.25978788262 51.80762500256 5.04751810020 -11.25056653029 24.23117975150 -8.26156361113
result:
ok accepted
Test #41:
score: 0
Accepted
time: 1ms
memory: 3908kb
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: 3932kb
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:
36.64234587185 29.93764365923 -42.54253065759 -7.20009016809 19.67801952389 -54.21884247789 -9.33973677420 -23.69507444363 -1.03878979899 86.11089881933 -32.10431404349 -163.54119431942 -6.58774463646 45.21472147131 -86.18942576700 59.15896601924 28.15576227758 -98.03467731938 -2.59516596111 95.6475...
result:
ok accepted
Test #43:
score: 0
Accepted
time: 0ms
memory: 3820kb
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:
-8.82108509184 -47.37601144494 14.66013597266 80.74803371616 -108.32854865849 51.02375921792 -8.57964064026 -44.69816145924 65.32020309407 -29.93245102631 -52.68062070421 -43.85422172566 -15.14602403592 75.65393443546 -18.18280222468 -23.02012794625 -30.72318393708 -16.33354174297 -37.38264657547 -9...
result:
ok accepted
Test #44:
score: 0
Accepted
time: 0ms
memory: 4060kb
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:
-58.16330849676 -93.02192111510 82.60208505072 21.98438505617 7.09212317470 46.32227934343 56.99059369275 -74.88024176253 -38.99465915928 57.06400288462 -47.80796419964 15.59717557808
result:
ok accepted
Test #45:
score: 0
Accepted
time: 0ms
memory: 4104kb
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:
-26.66521085927 55.00148456600 11.05271899291 17.85333184458 72.76471364758 60.84719459236 47.12361387464 123.74335558593 -43.77169394605 35.19971369303 -75.25594009864 64.00985749088 7.20036181422 -19.47690204616 49.86523609582 83.39048738378 -92.56974021590 -7.29159407780 -82.75297463331 81.804099...
result:
ok accepted
Test #46:
score: 0
Accepted
time: 0ms
memory: 3800kb
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: 3808kb
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: 3900kb
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: 0ms
memory: 3800kb
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: 4088kb
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