QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#111042 | #6436. Paimon Polygon | 5ab | AC ✓ | 388ms | 18396kb | C++20 | 4.3kb | 2023-06-05 17:06:27 | 2023-06-05 17:06:32 |
Judging History
answer
/* name: 6436
* author: 5ab
* created at: 2023-06-04
*/
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
using db = double;
const int max_n = 500000;
struct point
{
int x, y;
point operator-(const point& rhs) const {
return point{ x - rhs.x, y - rhs.y };
}
bool operator==(const point& rhs) const = default;
}
a[max_n], b[max_n + 1], O = {0, 0};
inline void chmax(db& _a, db _b) { if (_a < _b) _a = _b; }
inline bool cclkw(point x, point y)
{
return 1ll * x.x * y.y > 1ll * x.y * y.x;
}
inline bool cln(point x, point y)
{
return 1ll * x.x * y.y == 1ll * x.y * y.x;
}
inline db cross(point x, point y)
{
return 1ll * x.x * y.y - 1ll * x.y * y.x;
}
inline bool smd(point x, point y)
{
return cln(x, y) && 1ll * x.x * y.x + 1ll * x.y * y.y > 0;
}
inline db dis(point x, point y)
{
return hypot(x.x - y.x, x.y - y.y);
}
template<class It>
void cr(It bg, It ed)
{
swap(*bg, *min_element(bg, ed, [](auto& x, auto& y) {
return x.x == y.x ? x.y < y.y : x.x < y.x;
}));
sort(bg + 1, ed, [&](auto& lhs, auto& rhs) {
ll v = cross(lhs - *bg, rhs - *bg);
return v ? v > 0 : smd(lhs - *bg, rhs - lhs);
});
}
template<class It>
db calc(It bg, It ed)
{
db res = dis(*bg, *prev(ed));
for (auto s = bg, t = next(bg); t != ed; s++, t++)
res += dis(*s, *t);
return res;
}
db solve1(int n)
{
b[0] = {0, 0};
copy(a, a + n, b + 1);
cr(b, b + n + 1);
static vector<point> c1, c2;
c1.clear(), c2.clear();
for (int i = 0; i <= n; i++)
{
while (ssize(c1) > 1 && cclkw(b[i] - c1.back(), c1.back() - end(c1)[-2]))
c2.push_back(c1.back()), c1.pop_back();
c1.push_back(b[i]);
}
// for (auto [x, y] : c1)
// cerr << "(" << x << "," << y << ") ";
// cerr << endl;
// for (auto [x, y] : c2)
// cerr << "(" << x << "," << y << ") ";
// cerr << endl;
// check colinearity
for (int i = 1; i < ssize(c1) - 1; i++)
if (cln(c1[i + 1] - c1[i], c1[i] - c1[i - 1]))
return 0;
for (int i = 1; i <= n; i++)
{
if (c1.back() != b[i] && cln(c1.back() - b[i], b[i] - b[0]))
return 0;
if (c1[1] != b[i] && cln(c1[1] - b[i], b[i] - b[0]))
return 0;
}
if (find(c1.begin(), c1.end(), O) == c1.end())
return 0;
c2.push_back(O);
cr(c2.begin(), c2.end());
for (int i = 0; i < ssize(c2); i++)
if (!cclkw(c2[i] - c2[(i - 1 + ssize(c2)) % ssize(c2)], c2[(i + 1) % ssize(c2)] - c2[i]))
return 0;
return calc(c1.begin(), c1.end()) + calc(c2.begin(), c2.end());
}
db solve2(int n)
{
int l = partition(a, a + n, [](auto& x) {
return x.y < 0 || (x.y == 0 && x.x > 0);
}) - a;
sort(a, a + l, cclkw), sort(a + l, a + n, cclkw);
auto nxt = [&](int x) {
return x + 1 == n ? 0 : x + 1;
};
for (int i = 0; i < n; i++)
if (smd(a[i], a[nxt(i)]))
return 0;
db ans = 0, bsv = calc(a, a + n);
vector<int> xps;
auto pre = [&](int x) {
return x == 0 ? n - 1 : x - 1;
};
for (int i = 0; i < n; i++)
if (!cclkw(a[i] - a[pre(i)], a[nxt(i)] - a[i]))
xps.push_back(i);
if (xps.size() > 4)
return 0;
auto od = [&](int id) {
return hypot(a[id].x, a[id].y);
};
for (int i = 0, j = 1; i < n; i++)
{
while (nxt(j) != i && !cclkw(O - a[i], a[nxt(j)]))
{
// cerr << i << " " << j << " " << a[i].x << " " << a[i].y << " " << a[nxt(j)].x << " " << a[nxt(j)].y << endl;
j = nxt(j);
}
if (!cclkw(O - a[i], a[nxt(j)]) || !cclkw(O - a[j], a[nxt(i)]))
continue;
bool ok = true;
for (int x : xps)
if (x != i && x != j && x != nxt(i) && x != nxt(j))
{
ok = false;
break;
}
if (ok)
{
// cerr << i << " " << j << endl;
chmax(ans, bsv - dis(a[i], a[nxt(i)]) - dis(a[j], a[nxt(j)])
+ od(i) + od(nxt(i)) + od(j) + od(nxt(j)));
}
}
return ans;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int cas, n;
cin >> cas;
while (cas--)
{
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i].x >> a[i].y;
// static int cc;
// cc++;
// if (cc == 75315)
// {
// cerr << n << endl;
// for (int i = 0; i < n; i++)
// cerr << a[i].x << " " << a[i].y << endl;
// }
cout << fixed << setprecision(10) << max(solve1(n), solve2(n)) << "\n";
}
return 0;
}
// started coding at: 06-04 17:50:44
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 5816kb
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: 2ms
memory: 5792kb
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: 2ms
memory: 5828kb
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.6835847646 359.1097585858 3042924.9210867872 547.7541625009 62188.8862666670 34663049.5304524675 51604481.6979927868 2264792232.4113187790 69911.1777695327 6924993.0023835879 27901.9604859406 0.0000000000 68869955.9200051129 741423.3147931471 35164453.6311061978 671.8132617321...
result:
ok 100 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 5632kb
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.6659953594 0.0000000000 1990.2717756307 0.0000000000 56.6254303179 38028.2640999908 535.6659455590 235257.8675583731 180.9505138061 602881.3711287220 46.4849160494 4110.4659447832 7564262751.1217308044 46670198.1187152490 2588369380.2164812088 338944.2793992752 0.0000000000 4...
result:
ok 100 numbers
Test #5:
score: 0
Accepted
time: 3ms
memory: 5872kb
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.6039223075 0.0000000000 7627885.1724237995 19929200.3387993127 0.0000000000 383750556.9717312455 217740941.8789575994 54.0037867350 469600775.6014015675 5373804146.8582611084 3096896.5349608143 48655.4723474732 424091181.18...
result:
ok 100 numbers
Test #6:
score: 0
Accepted
time: 321ms
memory: 5572kb
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.2371349335 0.0000000000 0.0000000000 47255.5024139637 22167105.4928279221 26656.7768842985 6358960.5547562968 4832622736.3216428757 400102464.6059833765 23350.8099848297 61.4363536929 5471759482.6362094879 0.0000000000 365216943.6330448985 0.0000000000 459002454.2754567862 0.0000000000 46...
result:
ok 100000 numbers
Test #7:
score: 0
Accepted
time: 312ms
memory: 5700kb
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.8930830881 2330879690.6565489769 0.0000000000 2229.1040782987 59330.5565134982 5485547315.9834527969 140956853.3342528939 1784480.6105346505 105097.1480596157 29148820.1964101084 588.1043555045 0.0000000000 67.3375562302 77628337.7013852596 439644887.7588026524 4384588715.63...
result:
ok 100000 numbers
Test #8:
score: 0
Accepted
time: 332ms
memory: 5876kb
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.0548636317 0.0000000000 1742.3491807765 3433559646.1630616188 384890.2314940639 762965398.3871618509 2653519784.9547591209 4087583.7736930689 64069.8175330926 4204972630.1248044968 200793907.9893556833 38.7483113234 175649267.6458557844 230.3153...
result:
ok 100000 numbers
Test #9:
score: 0
Accepted
time: 152ms
memory: 5628kb
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.3916687965 0.0000000000 5926392251.2862062454 0.0000000000 638995324.5677649975 0.0000000000 0.0000000000 431.0064468427 0.0000000000 0.0000000000 0.0000000000 587573422.2857666016 0.0000000000 13473064.6081461310 0.0000000000 0.0000000000 3015062142...
result:
ok 10000 numbers
Test #10:
score: 0
Accepted
time: 163ms
memory: 5672kb
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.2772693634 0.0000000000 6570171297.2482719421 7077996985.1937942505 9410898397.3059082031 9489932941.5894279480 6163709528.8952379227 9671708845.1201782227 6634363179.9099836349 7087210213.9258222580 6070552363.7208614349 9404754486.2366561890 0.0000000000 6125490207.1253261566 768952776...
result:
ok 10000 numbers
Test #11:
score: 0
Accepted
time: 191ms
memory: 5672kb
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.3638486862 6062816628.6112546921 5282468120.9119815826 4916606482.2725162506 5851908848.8994073868 0.0000000000 5836142327.3531951904 0.0000000000 5891667483.0973615646 0.0000000000 0.0000000000 5573040287.4672145844 5683480737.5504446030 5879369771.3722496033 5850582900.2832183838 601162...
result:
ok 10000 numbers
Test #12:
score: 0
Accepted
time: 163ms
memory: 5908kb
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.2077046111 460290.3739280328 0.0000000000 0.0000000000 2891421.5246347706 0.0000000000 6095598345.9148406982 0.0000000000 0.0000000000 0.0000000000 8802401426.0989723206 4697770.6229338171 63130411.8584807292 0.0000000000 0.0000000000 0.0000000000 0.00...
result:
ok 1000 numbers
Test #13:
score: 0
Accepted
time: 168ms
memory: 5640kb
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.3502969742 7138209250.7790813446 10281890387.3026695251 0.0000000000 0.0000000000 0.0000000000 10222717940.2225856781 10263109914.4443092346 0.0000000000 0.0000000000 10281528585.6233749390 7087477367.0544452667 7134047957.9179935455 9138781001.2233810425 0.0000000000 7132663259.133563995...
result:
ok 1000 numbers
Test #14:
score: 0
Accepted
time: 176ms
memory: 5592kb
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.1478500366 0.0000000000 0.0000000000 7666076521.1852283478 0.0000000000 7302977064.1206569672 7221131942.0506839752 7645676182.0171413422 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 7695593533.5031185150 7611552474.6...
result:
ok 1000 numbers
Test #15:
score: 0
Accepted
time: 179ms
memory: 5880kb
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.5975644439 0.0000000000 0.0000000000 75401247.2669743299 0.0000000000 0.0000000000 0.0000000000 0.0000000000 71404303.6882434487 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 99678191.7324414551...
result:
ok 100 numbers
Test #16:
score: 0
Accepted
time: 191ms
memory: 5832kb
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.9758625031 10280990546.4632492065 10280798418.8945674896 10281888221.2449188232 10280384358.6826896667 10281373658.5482559204 7139905346.5062284470 10279388822.3250236511 0.0000000000 10278460756.1903343201 10240416793.6807422638 0.0000000000 7140929577.7032260895 10277657058.3587265015 7...
result:
ok 100 numbers
Test #17:
score: 0
Accepted
time: 198ms
memory: 5832kb
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.3428630829 6674026094.8479776382 6681416033.0524425507 6682682546.3770666122 0.0000000000 6682987238.4949331284 6681864808.0165615082 6682255842.8585510254 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 6671981158.0086908340 6677000429.6436319351 6676779610....
result:
ok 100 numbers
Test #18:
score: 0
Accepted
time: 93ms
memory: 6560kb
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.7983827591 6659220064.4499330521 0.0000000000 7141342168.3517684937 0.0000000000 6682227777.6097230911 10279237142.3096275330 0.0000000000 0.0000000000 0.0000000000
result:
ok 10 numbers
Test #19:
score: 0
Accepted
time: 88ms
memory: 6356kb
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.0980033875 8414153822.3518295288 10282636866.5449333191 10282721178.5943126678 7141450732.4348831177 7141399171.1323032379 0.0000000000 7141353594.1732921600 7141035278.3952198029 7141339757.7358036041
result:
ok 10 numbers
Test #20:
score: 0
Accepted
time: 123ms
memory: 6240kb
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.3433723450 7197071555.2639598846 7187682514.6121950150 7197620133.5753850937 7197448259.8515930176 7197489500.9231662750 7197121407.3985786438 0.0000000000 0.0000000000
result:
ok 10 numbers
Test #21:
score: 0
Accepted
time: 270ms
memory: 18396kb
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: 388ms
memory: 18248kb
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: 120ms
memory: 13336kb
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: 187ms
memory: 5620kb
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: 120ms
memory: 5832kb
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: 104ms
memory: 5640kb
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.9395675123 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: 120ms
memory: 5768kb
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.3277070075 3704618.2366738068 2417962.6791762519 166758.2238790580 1071878.0812413949 265868.5090105907 2036527.3408059073 3348132.1708816127 2177801.7450450133 257047.5021509365 1049629.8589677108 565674.8389299874 867475.9617091832 227933.6058948217 623724.4643829438 2096284.4224424181 238...
result:
ok 100 numbers
Test #28:
score: 0
Accepted
time: 253ms
memory: 6984kb
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...
output:
31366897.8464970291 28364535.0144383125 23079154.3025095612 18245425.7353872284 33441956.6649498716 27695557.8331688643 20340144.4928275719 25553780.9553418830 37129110.4229962230 30518388.6149185002
result:
ok 10 numbers
Test #29:
score: 0
Accepted
time: 323ms
memory: 15292kb
input:
2 499999 0 -62423282 1000 -62423281 1995 -62423280 2988 -62423279 3976 -62423278 4962 -62423277 5946 -62423276 6925 -62423275 7892 -62423274 8850 -62423273 9804 -62423272 10757 -62423271 11707 -62423270 12652 -62423269 13589 -62423268 14525 -62423267 15458 -62423266 16388 -62423265 17315 -62423264 1...
output:
631860469.7642996311 440003898.2284926176
result:
ok 2 numbers
Test #30:
score: 0
Accepted
time: 315ms
memory: 16100kb
input:
2 249999 0 -125090809 1993 -125090808 3984 -125090807 5949 -125090806 7892 -125090805 9828 -125090804 11745 -125090803 13628 -125090802 15504 -125090801 17354 -125090800 19175 -125090799 20974 -125090798 22750 -125090797 24462 -125090796 26170 -125090795 27874 -125090794 29573 -125090793 31251 -1250...
output:
872872776.5511230230 1265323648.2586164474
result:
ok 2 numbers