QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#356871 | #6436. Paimon Polygon | PorNPtree | TL | 1991ms | 18624kb | C++14 | 6.3kb | 2024-03-18 14:46:39 | 2024-03-18 14:46:40 |
Judging History
answer
#include <bits/stdc++.h>
#define eps 1e-10
using namespace std;
long double Hypot(int x, int y)
{
return sqrt((long double)(1ll * x * x + 1ll * y * y));
}
const int N = 5e5 + 5;
pair<int, int> operator - (pair<int, int> x, pair<int, int> y)
{
return make_pair(x.first - y.first, x.second - y.second);
}
long long operator * (pair<int, int> x, pair<int, int> y)
{
return 1ll * x.first * y.second - 1ll * x.second * y.first;
}
double atan3(int y, int x)
{
double f = atan2(y, x);
return (f > -eps ? f : f + 2 * acos(-1.0));
}
int cs;
int cmp(pair<int, int> x, pair<int, int> y)
{
double t1 = atan3(x.second, x.first) - atan3(y.second, y.first);
return (fabs(t1) > eps ? t1 < 0 : ((Hypot(x.first, x.second) < Hypot(y.first, y.second)) ^ cs));
}
pair<int, int> jz;
int cmp2(pair<int, int> x, pair<int, int> y)
{
return cmp(x - jz, y - jz);
}
int flag, S[N], top, vis[N];
pair< vector< pair<int, int> >, vector< pair<int, int> > > convex(vector< pair<int, int> > z)
{
for (int i = 1; i < (int)z.size(); ++i) {
if (z[i].second < z[0].second || (z[i].second == z[0].second && z[i].first < z[0].first)) {
swap(z[0], z[i]);
}
}
jz = z[0];
sort(z.begin() + 1, z.end(), cmp2);
S[top = 1] = 0;
for (int i = 1; i < (int)z.size(); ++i) {
while (top >= 2 && (z[S[top]] - z[S[top - 1]]) * (z[i] - z[S[top]]) < 0) {
--top;
}
S[++top] = i;
}
for (int i = 0; i < (int)z.size(); ++i) {
vis[i] = 0;
}
if (top <= 2) {
flag = 0;
return {{}, {}};
}
vector< pair<int, int> > S1, S2;
for (int i = 1; i <= top; ++i) {
S1.push_back(z[S[i]]);
vis[S[i]] = 1;
if ((z[S[i]] - z[S[(i == 1 ? top : i - 1)]]) * (z[S[(i == 1 ? top : i - 1)]] - z[S[(i == 1 ? top - 1 : (i == 2 ? top : i - 2))]]) == 0) {
flag = 0;
return {{}, {}};
}
}
for (int i = 0; i < (int)z.size(); ++i) {
if (!vis[i]) {
S2.push_back(z[i]);
}
}
return make_pair(S1, S2);
}
pair< vector< pair<int, int> >, vector< pair<int, int> > > convexHull(vector< pair<int, int> > z)
{
cs = 0;
pair< vector< pair<int, int> >, vector< pair<int, int> > > res1 = convex(z);
if (!flag) {
return {{}, {}};
}
cs = 1;
pair< vector< pair<int, int> >, vector< pair<int, int> > > res2 = convex(z);
if (!flag) {
return {{}, {}};
}
return res1;
}
long double jerry(vector< pair<int, int> > z)
{
long double res = 0;
for (int i = 0; i < (int)z.size(); ++i) {
int j = (i + 1 == (int)z.size() ? 0 : i + 1);
res += Hypot(z[i].first - z[j].first, z[i].second - z[j].second);
}
return res;
}
signed main()
{
int T;
scanf("%d", &T);
int DEBUG = 0;
for (int test = 1; test <= T; ++test) {
int n;
scanf("%d", &n);
vector< pair<int, int> > z;
for (int i = 1, x, y; i <= n; ++i) {
scanf("%d%d", &x, &y);
DEBUG &= (test != 1 || i != 1 || x == -821105972);
z.emplace_back(x, y);
}
if (DEBUG && test == 2743) {
printf("%d\n", n);
for (auto [x, y] : z) {
printf("%d %d\n", x, y);
}
}
flag = 1;
z.emplace_back(0, 0);
pair< vector< pair<int, int> >, vector< pair<int, int> > > tmp = convexHull(z);
long double res = 0;
if (flag) {
vector< pair<int, int> > p1 = tmp.first, p2 = tmp.second, p3;
int hv = 0;
for (int i = 0; i < (int)p1.size(); ++i) {
hv |= (p1[i] == make_pair(0, 0));
}
if (hv) {
p2.emplace_back(0, 0);
if ((int)p2.size() >= 3) {
tmp = convexHull(p2);
p2 = tmp.first, p3 = tmp.second;
if (flag && p3.empty()) {
res = max(res, jerry(p1) + jerry(p2));
}
}
}
}
z.pop_back();
sort(z.begin(), z.end(), cmp);
vector<int> hv;
for (int i = 0; i < (int)z.size(); ++i) {
if ((z[i] - z[(i + n - 1) % n]) * (z[(i + 1) % n] - z[i]) <= 0) {
hv.push_back(i);
}
}
if ((int)hv.size() > 4) {
if (!DEBUG) {
printf("%.10Lf\n", res);
}
continue;
}
int ok = 1;
for (int i = 0; i < (int)z.size(); ++i) {
int j = (i + 1) % n;
if (z[i] * z[j] == 0 && ((z[i].first != 0 && z[j].first != 0 && (z[i].first > 0) == (z[j].first > 0)) || (z[i].first == 0 && z[j].first == 0 && (z[i].second > 0) == (z[j].second > 0)))) {
ok = 0;
break;
}
}
if (!ok) {
if (!DEBUG) {
printf("%.10Lf\n", res);
}
continue;
}
long double ts = jerry(z);
for (int i = 0, j = 1; i < (int)z.size(); ++i) {
while ((j + 1) % n != i && (make_pair(0, 0) - z[i]) * z[(j + 1) % n] <= 0) {
j = (j + 1) % n;
}
if ((make_pair(0, 0) - z[i]) * z[(j + 1) % n] == 0 || (make_pair(0, 0) - z[j]) * z[(i + 1) % n] == 0) {
continue;
}
int ok = 1;
for (auto x : hv) {
if (x != i && x != j && x != (i + 1) % n && x != (j + 1) % n) {
ok = 0;
break;
}
}
if (ok) {
res = max(res, ts + Hypot(z[i].first, z[i].second)
+ Hypot(z[(i + 1) % n].first, z[(i + 1) % n].second)
+ Hypot(z[j].first, z[j].second)
+ Hypot(z[(j + 1) % n].first, z[(j + 1) % n].second)
- Hypot(z[i].first - z[(i + 1) % n].first, z[i].second - z[(i + 1) % n].second)
- Hypot(z[j].first - z[(j + 1) % n].first, z[j].second - z[(j + 1) % n].second));
}
}
if (!DEBUG) {
printf("%.10Lf\n", res);
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 6092kb
input:
3 4 0 3 3 0 2 3 3 2 5 4 0 5 -5 -4 -2 1 -2 -5 -2 4 0 1 1 0 0 2 1 1
output:
17.2111025509 36.6326947621 0.0000000000
result:
ok 3 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 6088kb
input:
14 4 0 3 1 3 3 1 3 0 4 -4 0 5 3 0 -4 -1 0 5 4 4 5 0 3 3 3 2 -4 2 5 1 1 2 4 1 4 0 4 -1 1 4 4 5 -2 4 1 4 -5 -2 5 3 5 3 -1 4 -5 4 1 2 4 5 4 0 5 -5 -4 -2 1 -2 -5 -2 5 3 4 3 5 -5 -1 1 2 4 1 5 -5 -3 3 -3 -3 -3 2 -3 -4 5 5 0 1 -3 -1 -3 -3 -4 -4 -3 0 6 1 -3 -3 -3 2 -2 -3 1 -4 -5 3 -3 6 -1 -4 -3 0 0 4 -4 -3 ...
output:
14.3245553203 0.0000000000 30.6896447944 18.7482240257 30.2540122179 27.8210682918 36.6326947621 33.4097258671 29.5562146354 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000
result:
ok 14 numbers
Test #3:
score: 0
Accepted
time: 1ms
memory: 6188kb
input:
100 6 -4 1 -1 4 1 4 -4 -1 -2 3 3 2 7 -5641417 962017 -5641417 -962017 -5719589 193284 -5693492 -578972 -5693492 578972 -5563601 1340673 -5719589 -193284 9 -25 55 58 15 -13 14 -1 19 -60 6 -17 8 11 15 16 58 16 11 10 398546 -221163 -87181 -447383 -221163 -398546 -467649 -57196 55334 -452427 -427086 -19...
output:
25.1141680517 24824262.6835847616 359.1097585858 3042924.9210867869 547.7541625009 62188.8862666670 34663049.5304524609 51604481.6979927908 2264792232.4113188051 69911.1777695327 6924993.0023835884 27901.9604859406 0.0000000000 68869955.9200051023 741423.3147931471 35164453.6311062000 671.8132617321...
result:
ok 100 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 6148kb
input:
100 5 -1 3 -3 -1 -2 -2 -2 2 -3 1 10 12304563 85714062 39425590 -77096858 -41257504 76132260 -63303220 -59084727 -14839769 -85311687 77575790 -38474659 85621241 -12934672 55622697 66365791 83459695 -23082068 21276755 -83938086 8 2890069 4853907 -4693652 -4650419 2902770 -2219431 -3844676 8770039 5979...
output:
16.8098366946 787989807.6659954082 0.0000000000 1990.2717756307 0.0000000000 56.6254303179 38028.2640999909 535.6659455590 235257.8675583731 180.9505138061 602881.3711287220 46.4849160494 4110.4659447832 7564262751.1217312468 46670198.1187152464 2588369380.2164813904 338944.2793992752 0.0000000000 4...
result:
ok 100 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 6152kb
input:
100 8 11998 28379 -21628 21945 -11714 -4752 92 12641 21945 21628 -4752 11714 -30810 224 -11643 4922 4 753 -34290 34290 753 24779 -23714 -23714 -24779 5 -10003 94641 47536 82445 86918 38759 63721 -70687 8533 -1809 10 -2 -4 5 2 7 7 10 -2 9 -5 -5 10 1 -5 4 -9 5 1 7 -7 7 47999701 49571963 -18823337 -785...
output:
172915.4991715059 189693.6987251514 500121.8889460589 0.0000000000 404174872.6039223336 0.0000000000 7627885.1724237993 19929200.3387993107 0.0000000000 383750556.9717312275 217740941.8789576415 54.0037867350 469600775.6014016480 5373804146.8582615592 3096896.5349608146 48655.4723474733 424091181.18...
result:
ok 100 numbers
Test #6:
score: 0
Accepted
time: 566ms
memory: 6112kb
input:
100000 8 -821105972 997119455 155098008 -782026135 999422988 -96073894 -199413884 -677661014 -198376812 -103268925 -871949583 -113805666 -870766708 -124679611 403309120 -797553920 10 -2884 -5808 -5808 2884 -4129 -698 6729 2528 -2992 2930 -2930 -2992 -3003 5746 -1081 6393 -3712 -1940 -4143 612 9 -561...
output:
6635241621.2371345838 0.0000000000 0.0000000000 47255.5024139636 22167105.4928279245 26656.7768842985 6358960.5547562958 4832622736.3216430442 400102464.6059833878 23350.8099848297 61.4363536929 5471759482.6362101855 0.0000000000 365216943.6330449316 0.0000000000 459002454.2754567354 0.0000000000 46...
result:
ok 100000 numbers
Test #7:
score: 0
Accepted
time: 517ms
memory: 4192kb
input:
100000 7 -84569 -1335 -84569 1335 -84485 4004 -84064 9328 -84317 6669 -84317 -6669 -84485 -4004 10 -40519 -84451 -12439 -92838 16858 -92138 -82419 -44505 67796 -64633 44505 -82419 -92138 -16858 -64633 -67796 -92838 12439 84451 -40519 5 -179830577 -368089311 -311590524 265970154 -180691219 -367667595...
output:
351672.3762955717 609117.8930830882 2330879690.6565488453 0.0000000000 2229.1040782987 59330.5565134982 5485547315.9834529292 140956853.3342528738 1784480.6105346504 105097.1480596157 29148820.1964101052 588.1043555045 0.0000000000 67.3375562302 77628337.7013852557 439644887.7588026576 4384588715.63...
result:
ok 100000 numbers
Test #8:
score: 0
Accepted
time: 608ms
memory: 6088kb
input:
100000 10 -495 -4668 12809 -60550 -25228 -56515 2343 -4067 4592 972 61545 -6529 45953 -41457 4067 2343 41457 45953 4286 -1913 5 -1 1 -6 -4 -2 7 0 1 -7 0 9 424 2599 -2633 -34 -1610 2708 -2439 1994 -2485 869 -490 2587 -8431 -4475 2463 932 1540 2748 10 -61374124 55073193 -10832626 18689337 -21487249 22...
output:
314284.7171111795 33.4358494788 0.0000000000 439149979.0548635742 0.0000000000 1742.3491807765 3433559646.1630613871 384890.2314940639 762965398.3871618845 2653519784.9547590441 4087583.7736930689 64069.8175330926 4204972630.1248053790 200793907.9893556953 38.7483113234 175649267.6458558078 230.3153...
result:
ok 100000 numbers
Test #9:
score: 0
Accepted
time: 650ms
memory: 6212kb
input:
10000 69 68112 24117 75386 -44718 72082 -5016 70727 -14784 71327 -11549 34769 63341 43070 58017 72235 -1730 -19413 69599 54942 -46928 22721 68591 70762 14618 8484 52702 72239 1560 69090 -21154 37138 -25834 71354 11382 65566 -30365 70023 17823 16877 -30306 -16225 70411 66944 27192 69139 20992 68056 -...
output:
0.0000000000 0.0000000000 0.0000000000 1463971750.3916689218 0.0000000000 5926392251.2862053216 0.0000000000 638995324.5677650357 0.0000000000 0.0000000000 431.0064468427 0.0000000000 0.0000000000 0.0000000000 587573422.2857667282 0.0000000000 13473064.6081461323 0.0000000000 0.0000000000 3015062142...
result:
ok 10000 numbers
Test #10:
score: 0
Accepted
time: 643ms
memory: 6408kb
input:
10000 89 460198758 -887815917 -434148529 -900841304 520821786 853665430 257666304 -966233965 956851104 -290578672 986823532 -161800235 -409214522 -912438204 -726504924 -687161258 900250170 -435372979 -718495391 -695531720 -304083796 -952645288 850068309 526672451 944531956 328419525 -821343849 57043...
output:
10243692462.2772711385 0.0000000000 6570171297.2482721293 7077996985.1937933657 9410898397.3059083689 9489932941.5894287024 6163709528.8952394603 9671708845.1201781416 6634363179.9099829337 7087210213.9258233747 6070552363.7208613027 9404754486.2366551012 0.0000000000 6125490207.1253273091 768952776...
result:
ok 10000 numbers
Test #11:
score: 0
Accepted
time: 744ms
memory: 6328kb
input:
10000 74 180466154 -86208859 862406835 506215814 935552786 353186898 999777187 -21108670 196365784 -37953641 86208859 180466154 183962356 -78471981 122294399 158253215 542361280 -840145369 988963685 148158124 791266074 -611471994 431254957 -902230105 883114186 469158113 63521397 997980477 997980477 ...
output:
5981211006.3638476343 6062816628.6112541663 5282468120.9119821852 4916606482.2725168280 5851908848.8994079912 0.0000000000 5836142327.3531953329 0.0000000000 5891667483.0973620233 0.0000000000 0.0000000000 5573040287.4672146048 5683480737.5504441122 5879369771.3722480573 5850582900.2832177863 601162...
result:
ok 10000 numbers
Test #12:
score: 0
Accepted
time: 831ms
memory: 6348kb
input:
1000 483 -496268 -429424 63216 653215 -248508 841108 -550897 356650 -550119 -357849 -826730 292806 -652567 69586 -633814 170195 273911 833181 -557751 345833 -471290 456697 180478 630963 -252946 -605562 -622319 -208341 -861137 166318 -852675 205340 -876801 -20919 -651085 82305 27563 876618 -522725 70...
output:
0.0000000000 0.0000000000 0.0000000000 11879686.2077046101 460290.3739280327 0.0000000000 0.0000000000 2891421.5246347698 0.0000000000 6095598345.9148430638 0.0000000000 0.0000000000 0.0000000000 8802401426.0989725711 4697770.6229338168 63130411.8584807398 0.0000000000 0.0000000000 0.0000000000 0.00...
result:
ok 1000 numbers
Test #13:
score: 0
Accepted
time: 867ms
memory: 6340kb
input:
1000 131 -350223990 936665979 239383029 970925211 441764873 897130869 -967985084 251007722 505110362 863054762 420125253 907466127 -776589506 -630006936 -987576231 157140662 -709986788 704214996 -22065711 999756523 -891769383 452490185 -726669234 686987499 -939493471 342566807 -978906416 204309151 3...
output:
7069732473.3502974510 7138209250.7790813874 10281890387.3026643367 0.0000000000 0.0000000000 0.0000000000 10222717940.2225741148 10263109914.4443085706 0.0000000000 0.0000000000 10281528585.6233779434 7087477367.0544453980 7134047957.9179913541 9138781001.2233829573 0.0000000000 7132663259.133566523...
result:
ok 1000 numbers
Test #14:
score: 0
Accepted
time: 1039ms
memory: 6344kb
input:
1000 235 991460231 130409395 313622638 389410889 -483125428 -875551153 919512747 -393060184 997568782 -69688769 921779268 387715076 -229772984 -444076993 405359934 292717140 -208571721 -978007074 948050264 -318120568 490996298 -94459700 -253179770 -431161228 734591470 678509670 891205838 -453599111 ...
output:
0.0000000000 0.0000000000 0.0000000000 0.0000000000 7207037940.1478505009 0.0000000000 0.0000000000 7666076521.1852341834 0.0000000000 7302977064.1206582882 7221131942.0506849112 7645676182.0171428416 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 7695593533.5031191129 7611552474.6...
result:
ok 1000 numbers
Test #15:
score: 0
Accepted
time: 1035ms
memory: 4528kb
input:
100 9717 91016 27500 -59348 -36879 -31707 -73861 49436 81232 98144 7321 -63956 14795 -73417 -19074 -88081 -16285 -25791 -83401 91227 57975 47953 -90446 -70817 -14511 73804 -90134 -17632 -11464 7182 -57979 -33282 -50311 19595 85301 -24814 -67172 -5528 13211 44635 52594 27961 -89090 71109 -15391 17580...
output:
0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 71386189.5975644106 0.0000000000 0.0000000000 75401247.2669743773 0.0000000000 0.0000000000 0.0000000000 0.0000000000 71404303.6882434028 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 99678191.7324414353...
result:
ok 100 numbers
Test #16:
score: 0
Accepted
time: 1116ms
memory: 6448kb
input:
100 176 471091865 882084154 713147179 701014337 -890352156 455272488 -620765782 783996074 -592387596 805653111 486761146 873535109 -98361129 995150787 -946081685 323928147 289953885 957040618 -439928986 898032565 390595510 920562408 -423829910 905741800 -204174313 978934548 -358135160 933669753 3574...
output:
7105851504.9758604644 10280990546.4632158596 10280798418.8945410661 10281888221.2449491331 10280384358.6826815661 10281373658.5482715555 7139905346.5062186201 10279388822.3250304963 0.0000000000 10278460756.1903233901 10240416793.6807438023 0.0000000000 7140929577.7032185784 10277657058.3587122718 7...
result:
ok 100 numbers
Test #17:
score: 0
Accepted
time: 1316ms
memory: 6432kb
input:
100 7098 -71865306 -291265133 -798257386 -602316483 -997899909 -64774781 -206612518 217511534 -703670771 -710526176 -971411529 237401857 301283615 -953534574 -49351231 -998781486 -269036995 132736941 -206332716 -217776974 -967516364 -252808398 -920939112 -389706495 -851875563 -523744236 -988866926 -...
output:
6683229061.3428663169 6674026094.8479765346 6681416033.0524367224 6682682546.3770461958 0.0000000000 6682987238.4949553520 6681864808.0165565340 6682255842.8585359077 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 6671981158.0086938865 6677000429.6436337135 6676779610....
result:
ok 100 numbers
Test #18:
score: 0
Accepted
time: 628ms
memory: 6288kb
input:
10 4039 -593515472 -804822580 -13746130 -299684908 291954058 -69013244 -979059216 -203575665 -999738014 22888955 989949562 -141420874 -915108823 -403206946 148968912 -260400198 298287653 -32007438 89853285 -286227859 -991818534 -127655774 251664674 -967814492 -184560882 -236510636 -933202631 -359350...
output:
6681347004.7983858292 6659220064.4499326721 0.0000000000 7141342168.3517698012 0.0000000000 6682227777.6097124680 10279237142.3096379507 0.0000000000 0.0000000000 0.0000000000
result:
ok 10 numbers
Test #19:
score: 0
Accepted
time: 565ms
memory: 8208kb
input:
10 2242 -947564084 -319565809 -248024701 -968753708 -832437517 -554118923 -249381919 -968405214 307590784 -951518738 -273725533 -961807846 347306610 -937751630 744328243 -667813946 -964815804 262926728 -862172282 -506615195 -416870938 -908965688 -962851651 -270030922 -945758049 -324871842 -933297219...
output:
8388984493.0980092357 8414153822.3518276457 10282636866.5449976586 10282721178.5943321064 7141450732.4348365208 7141399171.1322686165 0.0000000000 7141353594.1732839765 7141035278.3952107737 7141339757.7357670250
result:
ok 10 numbers
Test #20:
score: 0
Accepted
time: 781ms
memory: 8196kb
input:
10 43750 -545508884 -838105040 -294311431 -270888873 531862918 -846830465 306435136 -257094355 -920099201 -391685411 959735198 -280906300 372266028 -146348914 39536441 -398041292 543848949 -839183127 41936635 -397795574 536234042 -844069341 -227127089 -329261728 -170657925 -985330337 852976463 -5219...
output:
0.0000000000 7196637126.3433829732 7197071555.2639438342 7187682514.6121903984 7197620133.5754002966 7197448259.8515846576 7197489500.9231565055 7197121407.3985796906 0.0000000000 0.0000000000
result:
ok 10 numbers
Test #21:
score: 0
Accepted
time: 1325ms
memory: 17408kb
input:
2 470540 945771735 -324831996 -610520187 792000695 115344233 993325580 237202620 971460198 597403696 801940661 979188425 202953266 935483233 353371082 955539043 294864609 -667883396 744265926 -606769585 794877771 798629875 -601822500 -272970990 962022265 990363889 -138489591 178875583 983871702 -397...
output:
0.0000000000 0.0000000000
result:
ok 2 numbers
Test #22:
score: 0
Accepted
time: 1991ms
memory: 18624kb
input:
2 434459 526752980 850018410 453309897 -891352982 971480538 237119303 -4478154 -999989973 89533680 995983795 -552572316 -833464958 -997436773 -71553359 -999070516 43105731 -929875231 -367875054 936485292 350706855 709414652 -704791353 893786148 -448493391 983391270 -181498235 -970976140 239176369 -8...
output:
0.0000000000 0.0000000000
result:
ok 2 numbers
Test #23:
score: 0
Accepted
time: 597ms
memory: 13352kb
input:
2 19821 -965236966 261376355 81055674 996709575 -125539742 272469766 246114411 171545029 -41191850 297158596 29336692 298562152 179855994 983692951 812511053 582945786 222547826 974921774 -801190057 598409971 560767794 827973116 286869774 87782305 -488362309 872640966 -2664649 299988166 187255147 23...
output:
0.0000000000 0.0000000000
result:
ok 2 numbers
Test #24:
score: 0
Accepted
time: 287ms
memory: 6376kb
input:
50000 8 0 -28 -9 20 -19 11 -22 4 -23 0 -22 -4 -19 -11 -9 -20 15 0 -16 8 -15 18 -12 25 -9 26 0 25 9 18 12 8 15 0 16 -8 15 -25 9 -26 0 -25 -9 -18 -12 -8 -15 7 -6 14 -9 12 -18 5 -21 0 -18 -5 -9 -12 -6 -14 15 0 -21 6 -20 13 -15 20 -9 25 0 20 9 13 15 6 20 0 21 -6 20 -13 15 -20 9 -20 -9 -13 -15 -6 -20 7 0...
output:
153.5958864847 227.6971175135 105.9901970635 205.8054902756 110.6681739292 99.0770480989 145.5612574704 113.7739640603 120.0522513742 189.9002005437 154.4024014762 251.0740354905 246.7267896641 171.0228645575 132.6987869542 226.4891433554 164.6547526778 134.7456983451 113.9720786968 122.4175772556 1...
result:
ok 50000 numbers
Test #25:
score: 0
Accepted
time: 411ms
memory: 6144kb
input:
10000 36 0 -295 26 -294 55 -283 72 -274 94 -261 111 -249 140 -228 155 -217 180 -196 207 -171 223 -150 236 -130 242 -117 245 -109 253 -84 260 -59 263 -39 266 -17 267 0 266 17 263 39 260 59 253 84 245 109 242 117 236 130 223 150 -207 -171 -180 -196 -155 -217 -140 -228 -111 -249 -94 -261 -72 -274 -55 -...
output:
1937.5159991226 2384.2761614932 2098.5491925943 3227.5764730778 2791.5766595106 806.1465698216 2736.1709312708 1120.1384550071 1564.0392331686 1072.9779823542 2034.1091472966 675.8775150890 1532.3470090792 1152.9651431782 556.6340317948 1146.0564094760 748.6646500160 2005.8961977414 1934.0990600733 ...
result:
ok 10000 numbers
Test #26:
score: 0
Accepted
time: 641ms
memory: 6232kb
input:
1000 815 0 -9983 75 -9981 111 -9980 134 -9979 230 -9974 308 -9969 370 -9964 453 -9957 548 -9945 632 -9934 715 -9923 749 -9918 837 -9905 892 -9896 959 -9885 1030 -9873 1053 -9869 1098 -9861 1193 -9844 1220 -9839 1241 -9835 1309 -9822 1397 -9805 1476 -9787 1570 -9764 1669 -9739 1700 -9731 1750 -9718 1...
output:
100591.9395675124 38481.9057334471 66436.2490867164 67739.8237993300 30418.9011191869 11512.0819929374 61802.5826163151 114011.8904876638 29355.2692998134 24826.3214538652 123918.8843586467 68590.6840013892 51101.1054215314 33094.6996921252 59106.1732814922 36901.5953465153 84077.4101488262 9374.585...
result:
ok 1000 numbers
Test #27:
score: 0
Accepted
time: 875ms
memory: 6516kb
input:
100 4139 0 -312910 291 -312909 575 -312908 787 -312907 963 -312906 1248 -312904 1380 -312903 1631 -312901 1734 -312900 2029 -312897 2316 -312894 2475 -312892 2549 -312891 2834 -312887 2904 -312886 2969 -312885 3148 -312882 3411 -312877 3706 -312871 3901 -312867 4135 -312862 4344 -312857 4612 -312850...
output:
2161556.3277070048 3704618.2366738126 2417962.6791762463 166758.2238790579 1071878.0812413945 265868.5090105906 2036527.3408059065 3348132.1708816182 2177801.7450450141 257047.5021509365 1049629.8589677105 565674.8389299874 867475.9617091826 227933.6058948218 623724.4643829437 2096284.4224424165 238...
result:
ok 100 numbers
Test #28:
score: -100
Time Limit Exceeded
input:
10 82723 0 -3104553 299 -3104552 597 -3104551 892 -3104550 1186 -3104549 1475 -3104548 1761 -3104547 2044 -3104546 2324 -3104545 2598 -3104544 2871 -3104543 3142 -3104542 3412 -3104541 3674 -3104540 3934 -3104539 4193 -3104538 4451 -3104537 4708 -3104536 4964 -3104535 5218 -3104534 5471 -3104533 572...