QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#650057#6436. Paimon Polygonwangyue2017AC ✓417ms52024kbC++143.6kb2024-10-18 12:21:162024-10-18 12:21:16

Judging History

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

  • [2024-10-18 12:21:16]
  • 评测
  • 测评结果:AC
  • 用时:417ms
  • 内存:52024kb
  • [2024-10-18 12:21:16]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define D long double 
#define int long long
#define P pair<int,int>
#define x first
#define y second  
int cross(P a,P b){
    return a.x*b.y-a.y*b.x;
}
P operator-(P a,P b){
    return {a.x-b.x,a.y-b.y};
}
D dist(P a){
    return sqrt(a.x*a.x+a.y*a.y);
}


const int N =1.1e6;
P a[N];
int sk[N],used[N];
int n;
D mx=0;
#define in(x) scanf("%lld",&x)

int big_hull(){
    int top=0,bas=1;
    sort(a+1,a+1+n);
    for(int i=1;i<=n;++i){
        if(used[i])continue;
        while(top>bas&&cross(a[i]-a[sk[top-1]],a[sk[top]]-a[sk[top-1]])>0)top--;
        sk[++top]=i;
    }
    bas=top;
    for(int i=n-1;i;--i){
        if(used[i])continue;
        while(top>bas&&cross(a[i]-a[sk[top-1]],a[sk[top]]-a[sk[top-1]])>0)top--;
        sk[++top]=i;
    }
    return top-1;
}
int hull(){
    int top=0,bas=1;
    sort(a+1,a+1+n);
    for(int i=1;i<=n;++i){
        if(used[i])continue;
        while(top>bas&&cross(a[i]-a[sk[top-1]],a[sk[top]]-a[sk[top-1]])>=0)top--;
        sk[++top]=i;
    }
    bas=top;
    for(int i=n-1;i;--i){
        if(used[i])continue;
        while(top>bas&&cross(a[i]-a[sk[top-1]],a[sk[top]]-a[sk[top-1]])>=0)top--;
        sk[++top]=i;
    }
    return top-1;
}
void cover(){
    
    int t=big_hull();
    if(t!=hull())return;
    D ans=0;
    sk[t+1]=sk[1];
    for(int i=1;i<=t;++i){
        used[sk[i]]=1;
        ans+=dist(a[sk[i]]-a[sk[i+1]]);
    }
    bool flag=1;
    for(int i=1;i<=n;++i){
        if(a[i]==(P){0,0}){
            if(used[i]==0)
                flag=0;   
            else used[i]=0;
        }
    }
    int tt=hull();
    if(t+tt!=n+1){
        flag=0;
    }
    if(tt<=2)flag=0;
    sk[tt+1]=sk[1];
    for(int i=1;i<=tt;++i){
        ans+=dist(a[sk[i]]-a[sk[i+1]]);
    }
    if(flag)mx=ans;
}
struct dot
{
    int x,y;
    D ang;
}b[N];
bool comp(dot a,dot b){
    return a.ang<b.ang;
}
int L=1,R=0,c1,c2,n1,n2;
void rot(){
    sort(b+1,b+1+n,comp);
    D sm=0;
    for(int i=1;i<=n;++i)a[i]={b[i].x,b[i].y};
    for(int i=n+1;i<=2*n;++i)a[i]=a[i-n];
    for(int i=1;i<n;++i)
    if(cross(a[i+1],a[i])==0&&b[i+1].ang-b[i].ang<1e-9)return;
    for(int i=1;i<=n;++i)sm+=dist(a[i+1]-a[i]);
    
    L=1,R=1,c1=0,c2=0;
    n1=1;n2=n-1;
    for(int i=2;i<=n;++i){
        if(i+2<=n)if(cross(a[i+2]-a[i],a[i+1]-a[i])>=0)c2++;
    }
    while(L<=n){
        while(cross(a[L],a[R+1])>0||R<L){
            R++;
            n1++;n2--;
            if(n1>=3)if(cross(a[R]-a[R-2],a[R-1]-a[R-2])>=0)c1++;
            if(n2>=2)if(cross(a[R+2]-a[R],a[R+1]-a[R])>=0)c2--;
            if(c1==0&&c2==0&&n1>=2&&n2>=2&&cross(a[R+1],a[L-1+n])>0){
                mx=max(mx,sm-dist(a[L]-a[L-1+n])-dist(a[R]-a[R+1])+dist(a[L])+dist(a[L-1+n])+dist(a[R])+dist(a[R+1]));
            }
        } 
        L++;
        n1--;n2++;
        if(n1>=2)if(cross(a[L+1]-a[L-1],a[L]-a[L-1])>=0)c1--;
        if(n2>=3)if(cross(a[L-1+n]-a[L-3+n],a[L-2+n]-a[L-1+n])>=0)c2++;
        if(c1==0&&c2==0&&n1>=2&&n2>=2&&cross(a[R+1],a[L-1+n])>0){
            mx=max(mx,sm-dist(a[L]-a[L-1+n])-dist(a[R]-a[R+1])+dist(a[L])+dist(a[L-1+n])+dist(a[R])+dist(a[R+1]));
        }
    }
}
signed main(){
    int t;
    cin>>t;
    while(t--){
        mx=0;
        in(n);
        for(int i=1;i<=n;++i)in(a[i].x),in(a[i].y);
        for(int i=1;i<=n;++i)b[i].x=a[i].x,b[i].y=a[i].y,b[i].ang=atan2(b[i].y,b[i].x);
        for(int i=1;i<=n+1;++i)used[i]=0;
        a[++n]={0,0};
        cover();
        n--;
        rot();
        printf("%.10Lf\n",mx);
    }    
}

详细

Test #1:

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

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: 10384kb

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: 10428kb

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.6835847613
359.1097585858
3042924.9210867869
547.7541625009
62188.8862666670
34663049.5304524610
51604481.6979927905
2264792232.4113187790
69911.1777695327
6924993.0023835884
27901.9604859406
0.0000000000
68869955.9200051048
741423.3147931471
35164453.6311061991
671.8132617321...

result:

ok 100 numbers

Test #4:

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

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.6659954209
0.0000000000
1990.2717756307
0.0000000000
56.6254303179
38028.2640999909
535.6659455590
235257.8675583731
180.9505138061
602881.3711287219
46.4849160494
4110.4659447832
7564262751.1217310131
46670198.1187152467
2588369380.2164813578
338944.2793992752
0.0000000000
4...

result:

ok 100 numbers

Test #5:

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

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.6039223243
0.0000000000
7627885.1724237993
19929200.3387993108
0.0000000000
383750556.9717312176
217740941.8789576385
54.0037867350
469600775.6014016531
5373804146.8582614660
3096896.5349608146
48655.4723474733
424091181.18...

result:

ok 100 numbers

Test #6:

score: 0
Accepted
time: 262ms
memory: 10408kb

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.2371347435
0.0000000000
0.0000000000
47255.5024139636
22167105.4928279229
26656.7768842985
6358960.5547562959
4832622736.3216429055
400102464.6059833895
23350.8099848297
61.4363536929
5471759482.6362100840
0.0000000000
365216943.6330449283
0.0000000000
459002454.2754567377
0.0000000000
46...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 255ms
memory: 10496kb

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.6565488209
0.0000000000
2229.1040782987
59330.5565134982
5485547315.9834530354
140956853.3342528716
1784480.6105346505
105097.1480596157
29148820.1964101058
588.1043555045
0.0000000000
67.3375562302
77628337.7013852547
439644887.7588026654
4384588715.63...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 261ms
memory: 10288kb

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.0548635814
0.0000000000
1742.3491807765
3433559646.1630614698
384890.2314940639
762965398.3871618211
2653519784.9547590651
4087583.7736930689
64069.8175330926
4204972630.1248052716
200793907.9893556926
38.7483113234
175649267.6458558068
230.3153...

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 168ms
memory: 10352kb

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.3916688915
0.0000000000
5926392251.2862053253
0.0000000000
638995324.5677650236
0.0000000000
0.0000000000
431.0064468427
0.0000000000
0.0000000000
0.0000000000
587573422.2857667236
0.0000000000
13473064.6081461324
0.0000000000
0.0000000000
3015062142...

result:

ok 10000 numbers

Test #10:

score: 0
Accepted
time: 173ms
memory: 10388kb

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.2772710873
0.0000000000
6570171297.2482720837
7077996985.1937932335
9410898397.3059082609
9489932941.5894286996
6163709528.8952395245
9671708845.1201781631
6634363179.9099830091
7087210213.9258233467
6070552363.7208613157
9404754486.2366550267
0.0000000000
6125490207.1253274754
768952776...

result:

ok 10000 numbers

Test #11:

score: 0
Accepted
time: 178ms
memory: 10412kb

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.3638476357
6062816628.6112541463
5282468120.9119820893
4916606482.2725166231
5851908848.8994078711
0.0000000000
5836142327.3531953171
0.0000000000
5891667483.0973619819
0.0000000000
0.0000000000
5573040287.4672146328
5683480737.5504441671
5879369771.3722479641
5850582900.2832176760
601162...

result:

ok 10000 numbers

Test #12:

score: 0
Accepted
time: 178ms
memory: 10408kb

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.2077046103
460290.3739280327
0.0000000000
0.0000000000
2891421.5246347698
0.0000000000
6095598345.9148430005
0.0000000000
0.0000000000
0.0000000000
8802401426.0989725729
4697770.6229338167
63130411.8584807399
0.0000000000
0.0000000000
0.0000000000
0.00...

result:

ok 1000 numbers

Test #13:

score: 0
Accepted
time: 168ms
memory: 10516kb

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.3502973393
7138209250.7790813791
10281890387.3026644588
0.0000000000
0.0000000000
0.0000000000
10222717940.2225741819
10263109914.4443084039
0.0000000000
0.0000000000
10281528585.6233781287
7087477367.0544454996
7134047957.9179913942
9138781001.2233828977
0.0000000000
7132663259.133566450...

result:

ok 1000 numbers

Test #14:

score: 0
Accepted
time: 173ms
memory: 10276kb

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.1478503421
0.0000000000
0.0000000000
7666076521.1852342375
0.0000000000
7302977064.1206584498
7221131942.0506848842
7645676182.0171428118
0.0000000000
0.0000000000
0.0000000000
0.0000000000
0.0000000000
7695593533.5031190207
7611552474.6...

result:

ok 1000 numbers

Test #15:

score: 0
Accepted
time: 181ms
memory: 10788kb

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.5975644095
0.0000000000
0.0000000000
75401247.2669743779
0.0000000000
0.0000000000
0.0000000000
0.0000000000
71404303.6882434006
0.0000000000
0.0000000000
0.0000000000
0.0000000000
0.0000000000
0.0000000000
99678191.7324414356...

result:

ok 100 numbers

Test #16:

score: 0
Accepted
time: 172ms
memory: 12740kb

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.9758605883
10280990546.4632157804
10280798418.8945411500
10281888221.2449492300
10280384358.6826814832
10281373658.5482715238
7139905346.5062184567
10279388822.3250304954
0.0000000000
10278460756.1903231852
10240416793.6807436412
0.0000000000
7140929577.7032184764
10277657058.3587122727
7...

result:

ok 100 numbers

Test #17:

score: 0
Accepted
time: 185ms
memory: 10696kb

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.3428663202
6674026094.8479765719
6681416033.0524367536
6682682546.3770461637
0.0000000000
6682987238.4949553693
6681864808.0165564744
6682255842.8585359580
0.0000000000
0.0000000000
0.0000000000
0.0000000000
0.0000000000
0.0000000000
6671981158.0086938296
6677000429.6436336860
6676779610....

result:

ok 100 numbers

Test #18:

score: 0
Accepted
time: 97ms
memory: 15388kb

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.7983857631
6659220064.4499326707
0.0000000000
7141342168.3517699051
0.0000000000
6682227777.6097124061
10279237142.3096379284
0.0000000000
0.0000000000
0.0000000000

result:

ok 10 numbers

Test #19:

score: 0
Accepted
time: 88ms
memory: 15000kb

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.0980092036
8414153822.3518277276
10282636866.5449977173
10282721178.5943322070
7141450732.4348365306
7141399171.1322686397
0.0000000000
7141353594.1732840235
7141035278.3952108528
7141339757.7357671731

result:

ok 10 numbers

Test #20:

score: 0
Accepted
time: 112ms
memory: 13892kb

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.3433829313
7197071555.2639439856
7187682514.6121903760
7197620133.5754003925
7197448259.8515847926
7197489500.9231565334
7197121407.3985795905
0.0000000000
0.0000000000

result:

ok 10 numbers

Test #21:

score: 0
Accepted
time: 267ms
memory: 45076kb

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: 417ms
memory: 49900kb

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: 110ms
memory: 31352kb

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: 129ms
memory: 10424kb

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: 98ms
memory: 10412kb

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: 88ms
memory: 10460kb

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: 97ms
memory: 10732kb

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.3277070049
3704618.2366738126
2417962.6791762463
166758.2238790579
1071878.0812413945
265868.5090105906
2036527.3408059064
3348132.1708816181
2177801.7450450141
257047.5021509365
1049629.8589677106
565674.8389299874
867475.9617091826
227933.6058948218
623724.4643829437
2096284.4224424165
238...

result:

ok 100 numbers

Test #28:

score: 0
Accepted
time: 201ms
memory: 19520kb

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.8464973038
28364535.0144383915
23079154.3025095216
18245425.7353871310
33441956.6649498021
27695557.8331688404
20340144.4928276949
25553780.9553420549
37129110.4229959815
30518388.6149185111

result:

ok 10 numbers

Test #29:

score: 0
Accepted
time: 277ms
memory: 52024kb

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.7643041415
440003898.2284999457

result:

ok 2 numbers

Test #30:

score: 0
Accepted
time: 263ms
memory: 50976kb

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.5511286289
1265323648.2585883152

result:

ok 2 numbers