QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#401001#985. Attractions On Planegrass8cowRE 10ms29664kbC++172.3kb2024-04-27 20:44:102024-04-27 20:44:11

Judging History

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

  • [2024-04-27 20:44:11]
  • 评测
  • 测评结果:RE
  • 用时:10ms
  • 内存:29664kb
  • [2024-04-27 20:44:10]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n,X;
#define pb push_back
vector<int>g[1001000];
int Z[200100];
int xp[1001000];
int m,t;
struct no{ll x,y;int z;}a[401000],b[401000];
no operator - (const no &a,const no &b){return (no){a.x-b.x,a.y-b.y,a.z-b.z};}
__int128 cro(no a,no b){return (__int128)a.x*b.y-(__int128)b.x*a.y;}
#define mp make_pair
#define F first
#define S second
#define db double
db ans[201000];
const db eps=1e-9;
int main(){
    scanf("%d%d",&n,&X);
    for(int i=1,l,y,r,h;i<=n;i++){
        scanf("%d%d%d%d",&l,&y,&r,&h);r+=l;
        Z[i]=y;ll y_=1ll*y*y+1ll*l*l;
        a[++m]=(no){2*l,y_,i};
        if(l==r)continue;
        y_=1ll*y*y+1ll*r*r;
        a[++m]=(no){2*r,y_,i};
        //(x-l)^2+y^2
        int L=max(0,l),R=min(X,r);
        if(l<r)g[l].pb(i),g[r].pb(-i);
    }
    sort(a+1,a+m+1,[&](no a,no b){if(a.x!=b.x)return a.x<b.x;if(a.y!=b.y)return a.y<b.y;return a.z<b.z;});
    for(int i=1;i<=m;i++){
        if(i>1&&a[i].x==a[i-1].x)continue;
        while(t>1&&cro(b[t]-b[t-1],a[i]-b[t-1])<=0)t--;
        b[++t]=a[i];
    }
    vector<pair<db,pair<int,int> > >jd;
    int w=1;
    while(w<t&&b[w].y>b[w+1].y)w++;
    jd.pb(mp(0,mp(w,0)));
    for(int i=w;i<t;i++)
        jd.pb(mp(1.0*(b[i+1].y-b[i].y)/(b[i+1].x-b[i].x),mp(i+1,0)));
    set<pair<int,int> >s;
    for(int i=0;i<X;i++){
        for(int o:g[i])if(o>0)s.insert(make_pair(Z[o],o));
        else s.erase(make_pair(Z[-o],-o));
        if(!s.empty())xp[i]=(*s.begin()).second;
        if(i==0||xp[i]!=xp[i-1])jd.pb(mp(i,mp(xp[i],1)));
    }
    jd.pb(mp(X,mp(0,2)));
    sort(jd.begin(),jd.end());
    int v1=0,v2=0;int sz=jd.size();
    for(int i=0;i<sz;i++){
        auto it=jd[i];
        if(it.S.S==2)break;
        auto it2=jd[i+1];
        if(it.S.S==0)v1=it.S.F;else v2=it.S.F;
        if(!v1)continue;
        db L=it.F,R=it2.F;
        if(!v2)ans[b[v1].z]+=R-L;
        else{
            db p=-b[v1].x,q=b[v1].y-1ll*Z[v2]*Z[v2];
            //x^2+px+q<0
            db dt=p*p-q*4;
            if(dt<eps)ans[v2]+=R-L;
            else{
                dt=sqrt(dt);
                db kl=max(L,(-p-dt)/2),kr=min(R,(-p+dt)/2),lt=max(0.0,kr-kl);
                ans[b[v1].z]+=lt,ans[v2]+=R-L-lt;
            }
        }
    }
    for(int i=1;i<=n;i++)printf("%.9lf\n",ans[i]/X*100);
    return 0;
}

詳細信息

Test #1:

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

input:

2 10
1 2 5 1
2 1 1 5

output:

52.679491924
47.320508076

result:

ok 2 numbers

Test #2:

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

input:

4 7
1 3 0 0
3 4 0 0
5 5 0 0
3 4 0 0

output:

53.571428571
35.714285714
10.714285714
0.000000000

result:

ok 4 numbers

Test #3:

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

input:

4 7
1 3 0 0
3 4 0 0
5 5 0 0
3 4 0 0

output:

53.571428571
35.714285714
10.714285714
0.000000000

result:

ok 4 numbers

Test #4:

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

input:

2 10
1 2 5 1
2 1 1 5

output:

52.679491924
47.320508076

result:

ok 2 numbers

Test #5:

score: 0
Accepted
time: 5ms
memory: 27520kb

input:

4 7
1 3 0 0
3 4 0 0
5 5 0 0
3 4 0 0

output:

53.571428571
35.714285714
10.714285714
0.000000000

result:

ok 4 numbers

Test #6:

score: 0
Accepted
time: 4ms
memory: 27316kb

input:

1 526993
64 7 0 0

output:

100.000000000

result:

ok found '100.0000000', expected '100.0000000', error '0.0000000'

Test #7:

score: 0
Accepted
time: 4ms
memory: 27368kb

input:

2 306235
19 8 0 0
21 6 0 0

output:

0.004245106
99.995754894

result:

ok 2 numbers

Test #8:

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

input:

3 795677
34 3 0 0
56 5 0 0
48 7 0 0

output:

0.005332386
99.993653203
0.001014410

result:

ok 3 numbers

Test #9:

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

input:

495 368130
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
723082 376716 0 0
7...

output:

100.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.00000000...

result:

ok 495 numbers

Test #10:

score: 0
Accepted
time: 4ms
memory: 27360kb

input:

493 261998
815225 6 0 0
806366 7 0 0
103518 4 0 0
229937 5 0 0
530734 7 0 0
127508 8 0 0
128550 6 0 0
614581 8 0 0
334911 8 0 0
258776 3 0 0
256449 5 0 0
702679 3 0 0
650973 9 0 0
309392 10 0 0
414347 6 0 0
867328 5 0 0
29525 5 0 0
912594 5 0 0
221324 7 0 0
907323 3 0 0
645853 8 0 0
482215 2 0 0
652...

output:

0.000000000
0.000000000
1.102300117
0.796382067
0.000000000
0.420799611
0.344091724
0.000000000
0.000000000
0.539136188
0.191448962
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.168908383
0.000000000
0.442178665
0.000000000
0.000000000
0.000000000
0.000000000
0.532803942
0.277126075
...

result:

ok 493 numbers

Test #11:

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

input:

498 740195
539527 8 0 0
565139 7 0 0
138287 4 0 0
872252 2 0 0
416589 5 0 0
740672 5 0 0
774707 3 0 0
54007 5 0 0
621977 6 0 0
961953 7 0 0
48454 3 0 0
348868 2 0 0
703397 5 0 0
294082 9 0 0
928003 5 0 0
226018 10 0 0
794174 2 0 0
693633 5 0 0
796829 3 0 0
754094 1 0 0
116953 10 0 0
541832 10 0 0
72...

output:

0.426509629
0.069992639
0.094182581
0.000000000
0.218661293
0.676916163
0.000000000
0.164146267
0.584237768
0.000000000
0.258789899
0.215157864
0.167045749
0.183319459
0.000000000
0.127664572
0.000000000
0.221903359
0.000000000
0.000000000
0.101619431
0.262561304
0.250812740
0.117199120
0.176108007
...

result:

ok 498 numbers

Test #12:

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

input:

494 839352
564592 4 0 0
161754 2 0 0
55284 10 0 0
338248 1 0 0
643821 3 0 0
928087 6 0 0
369743 10 0 0
303193 6 0 0
983594 7 0 0
623627 7 0 0
728262 6 0 0
691871 3 0 0
774980 1 0 0
373696 10 0 0
582836 1 0 0
26658 2 0 0
451863 9 0 0
804980 4 0 0
656996 5 0 0
899465 4 0 0
514790 7 0 0
527354 1 0 0
52...

output:

0.190150385
0.902065777
0.597363914
0.190982089
0.432477015
0.000000000
0.434856695
0.265138139
0.000000000
0.124297625
0.314646133
0.110986782
0.397096481
0.389342111
0.057071213
0.194064247
0.219869630
0.616249537
0.214094905
0.000000000
0.177159719
0.096445905
0.070770630
0.106861232
0.016989858
...

result:

ok 494 numbers

Test #13:

score: 0
Accepted
time: 8ms
memory: 27524kb

input:

498 496147
152118 592509 0 0
993525 4837 0 0
785975 139262 0 0
899162 700698 0 0
171554 914518 0 0
929801 776817 0 0
214570 546465 0 0
55190 857202 0 0
947539 994980 0 0
721719 395723 0 0
93450 26935 0 0
99283 123727 0 0
479353 554490 0 0
628771 631484 0 0
21225 550099 0 0
141191 667118 0 0
305921 4...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
9.795153103
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 498 numbers

Test #14:

score: 0
Accepted
time: 4ms
memory: 27312kb

input:

496 9632
100 6 0 0
67 10 0 0
40 6 0 0
30 5 0 0
52 2 0 0
14 5 0 0
47 3 0 0
91 8 0 0
59 10 0 0
75 6 0 0
52 2 0 0
34 2 0 0
84 5 0 0
63 1 0 0
9 6 0 0
33 4 0 0
63 6 0 0
92 5 0 0
31 4 0 0
29 9 0 0
29 10 0 0
83 5 0 0
6 9 0 0
53 2 0 0
32 3 0 0
42 1 0 0
100 2 0 0
57 8 0 0
82 8 0 0
73 10 0 0
63 5 0 0
100 2 0 ...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.007786545
0.000000000
0.025955150
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.012977575
0.000000000
...

result:

ok 496 numbers

Test #15:

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

input:

499 458512
93 10 0 0
99 4 0 0
10 3 0 0
82 2 0 0
47 6 0 0
78 4 0 0
88 4 0 0
80 2 0 0
74 8 0 0
95 6 0 0
33 4 0 0
59 2 0 0
35 10 0 0
38 1 0 0
39 6 0 0
56 10 0 0
55 10 0 0
74 9 0 0
34 2 0 0
61 4 0 0
22 2 0 0
99 10 0 0
100 6 0 0
80 2 0 0
20 3 0 0
97 10 0 0
10 10 0 0
50 8 0 0
51 8 0 0
47 2 0 0
83 2 0 0
34...

output:

0.000000000
0.000000000
0.000000000
0.000163573
0.000000000
0.000000000
0.000000000
0.000327145
0.000000000
0.000000000
0.000000000
0.000261716
0.000000000
0.000490718
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 499 numbers

Test #16:

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

input:

499 640488
44 172080 0 0
30 772196 0 0
50 717160 0 0
10 197402 0 0
16 970353 0 0
54 651618 0 0
31 230920 0 0
97 695630 0 0
38 92569 0 0
57 70571 0 0
38 159848 0 0
77 585796 0 0
63 502621 0 0
60 593159 0 0
10 399926 0 0
14 456810 0 0
26 371544 0 0
82 315955 0 0
49 153557 0 0
83 168141 0 0
15 788409 0...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 499 numbers

Test #17:

score: 0
Accepted
time: 9ms
memory: 27400kb

input:

494 544436
117127 8 0 0
774385 3 0 0
373268 2 0 0
113350 9 0 0
599670 10 0 0
25560 5 0 0
385869 5 0 0
212221 3 0 0
180061 4 0 0
656335 8 0 0
776916 8 0 0
313834 10 0 0
922465 6 0 0
150251 3 0 0
458874 9 0 0
326063 2 0 0
638728 1 0 0
611336 4 0 0
479835 9 0 0
859054 4 0 0
314885 5 0 0
982683 7 0 0
30...

output:

0.082207525
0.000000000
0.387478637
0.239050628
0.000000000
0.771443930
0.108001675
0.278011485
0.362300803
0.000000000
0.000000000
0.292852081
0.000000000
0.518152019
0.192658411
0.102402340
0.000000000
0.000000000
0.541933558
0.000000000
0.073649989
0.000000000
0.293239517
0.000000000
0.410231002
...

result:

ok 494 numbers

Test #18:

score: 0
Accepted
time: 4ms
memory: 27544kb

input:

491 30657
666039 2 0 0
421250 6 0 0
693976 2 0 0
966143 6 0 0
475267 1 0 0
430111 8 0 0
536502 9 0 0
126789 8 0 0
614323 3 0 0
542887 9 0 0
25384 6 0 0
206512 4 0 0
212465 4 0 0
667504 4 0 0
547028 8 0 0
105982 5 0 0
885808 9 0 0
315814 5 0 0
900748 5 0 0
492501 8 0 0
995177 5 0 0
370959 4 0 0
72540...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
8.955463457
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 491 numbers

Test #19:

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

input:

500 373603
634330 6 0 0
804469 1 0 0
832457 8 0 0
290661 2 0 0
34741 3 0 0
317369 10 0 0
737259 7 0 0
598240 5 0 0
213043 3 0 0
21537 5 0 0
41792 9 0 0
854362 8 0 0
807353 4 0 0
710553 9 0 0
386073 1 0 0
878671 10 0 0
681973 4 0 0
623644 5 0 0
700198 8 0 0
174276 1 0 0
633025 10 0 0
277121 6 0 0
871...

output:

0.000000000
0.000000000
0.000000000
0.277766618
1.506548358
1.091660661
0.000000000
0.000000000
0.839412763
0.371540152
1.229241829
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
1.072486792
0.000000000
0.272206257
0.000000000
0.000000000
1.597553310
...

result:

ok 500 numbers

Test #20:

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

input:

498 428353
964849 414307 0 0
164141 688701 0 0
585198 5401 0 0
626272 636955 0 0
287448 101964 0 0
707569 113757 0 0
927356 170985 0 0
972169 371440 0 0
45688 732690 0 0
898108 961902 0 0
577269 943654 0 0
865349 272909 0 0
508707 720018 0 0
921283 648538 0 0
807666 149919 0 0
102209 943377 0 0
2859...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 498 numbers

Test #21:

score: 0
Accepted
time: 4ms
memory: 27524kb

input:

499 611623
17 8 0 0
29 1 0 0
44 3 0 0
72 10 0 0
52 3 0 0
26 8 0 0
73 1 0 0
63 5 0 0
78 7 0 0
49 5 0 0
97 8 0 0
27 8 0 0
95 2 0 0
15 5 0 0
8 1 0 0
20 5 0 0
51 7 0 0
86 7 0 0
51 6 0 0
29 8 0 0
66 5 0 0
9 10 0 0
67 9 0 0
48 1 0 0
70 7 0 0
72 8 0 0
86 6 0 0
13 5 0 0
78 4 0 0
5 5 0 0
88 8 0 0
91 1 0 0
19...

output:

0.000000000
0.000163499
0.000122625
0.000000000
0.000000000
0.000000000
0.000490498
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000653998
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000817497
0.000000000
...

result:

ok 499 numbers

Test #22:

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

input:

497 941824
94 6 0 0
90 3 0 0
91 4 0 0
87 7 0 0
78 6 0 0
47 4 0 0
15 8 0 0
29 5 0 0
70 1 0 0
41 7 0 0
24 8 0 0
3 8 0 0
52 4 0 0
57 3 0 0
50 7 0 0
67 5 0 0
38 10 0 0
56 10 0 0
66 5 0 0
24 1 0 0
95 10 0 0
100 3 0 0
58 5 0 0
83 1 0 0
72 3 0 0
39 3 0 0
64 8 0 0
53 8 0 0
63 1 0 0
61 5 0 0
23 5 0 0
100 6 0...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000106177
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000398164
0.000000000
99.989169951
0.000000000
0.000265442
0.000000000...

result:

ok 497 numbers

Test #23:

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

input:

492 930876
74 1 0 0
92 6 0 0
71 8 0 0
12 6 0 0
62 2 0 0
15 4 0 0
68 7 0 0
99 7 0 0
22 5 0 0
10 7 0 0
84 3 0 0
55 5 0 0
24 6 0 0
88 4 0 0
42 8 0 0
30 8 0 0
13 9 0 0
63 3 0 0
18 5 0 0
97 4 0 0
60 9 0 0
19 2 0 0
76 4 0 0
49 10 0 0
3 4 0 0
42 8 0 0
89 3 0 0
13 1 0 0
24 6 0 0
53 1 0 0
25 9 0 0
34 3 0 0
3...

output:

0.000107426
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000080569
0.000000000
0.000000000
0.000000000
...

result:

ok 492 numbers

Test #24:

score: 0
Accepted
time: 9ms
memory: 27516kb

input:

494 498098
31 961684 0 0
33 466031 0 0
66 4373 0 0
42 827728 0 0
68 418593 0 0
33 676345 0 0
92 599399 0 0
80 833985 0 0
12 433670 0 0
70 318809 0 0
3 37188 0 0
93 385530 0 0
70 76808 0 0
13 228899 0 0
4 577262 0 0
87 930268 0 0
23 282079 0 0
54 571358 0 0
31 699398 0 0
18 358225 0 0
58 869918 0 0
6...

output:

0.000000000
0.000000000
22.959808677
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000...

result:

ok 494 numbers

Test #25:

score: 0
Accepted
time: 4ms
memory: 27656kb

input:

2 902758
32 10 90887 778141
15 4 77850 809725

output:

91.373749648
8.626250352

result:

ok 2 numbers

Test #26:

score: 0
Accepted
time: 7ms
memory: 29664kb

input:

3 740665
53 4 504301 428339
76 2 603967 219125
27 5 195286 384518

output:

0.003042657
99.990206652
0.006750690

result:

ok 3 numbers

Test #27:

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

input:

500 721016
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
478534 114801 0 0
4...

output:

100.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.00000000...

result:

ok 500 numbers

Test #28:

score: 0
Accepted
time: 10ms
memory: 27612kb

input:

492 599714
254286 7 0 0
158092 4 0 0
187757 5 0 0
415486 7 0 0
846316 5 0 0
687811 1 0 0
669291 9 0 0
2466 8 0 0
229138 5 0 0
126963 6 0 0
902141 9 0 0
569528 2 0 0
487642 1 0 0
708092 3 0 0
689214 10 0 0
484671 6 0 0
812781 7 0 0
557606 7 0 0
757077 2 0 0
150422 8 0 0
910653 6 0 0
543888 2 0 0
3841...

output:

0.530255847
0.111319630
0.458130334
0.680907001
0.000000000
0.000000000
0.000000000
0.196325609
0.074355514
0.419452245
0.000000000
0.353601876
0.370512618
0.000000000
0.000000000
0.117216759
0.000000000
0.370841752
0.000000000
0.295717867
0.000000000
1.009148890
0.139674191
0.196347148
0.000000000
...

result:

ok 492 numbers

Test #29:

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

input:

496 602250
852950 4 0 0
966182 8 0 0
131218 8 0 0
872350 9 0 0
215427 10 0 0
208664 10 0 0
257909 1 0 0
962187 3 0 0
306012 6 0 0
639491 1 0 0
506531 7 0 0
790083 2 0 0
740978 7 0 0
863458 5 0 0
918096 2 0 0
888567 6 0 0
228573 1 0 0
637836 4 0 0
502778 4 0 0
452097 5 0 0
337760 2 0 0
209307 10 0 0
...

output:

0.000000000
0.000000000
0.326687956
0.000000000
0.336148572
0.181066449
0.079917523
0.000000000
0.820091796
0.000000000
0.068890622
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.076816562
0.000000000
0.228889991
0.168699610
0.618774509
0.252051464
0.247985625
0.196174470
0.438672465
...

result:

ok 496 numbers

Test #30:

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

input:

500 618130
52493 8 0 0
455725 8 0 0
50245 8 0 0
597817 2 0 0
564353 2 0 0
52763 5 0 0
302867 7 0 0
864334 1 0 0
529804 7 0 0
716397 2 0 0
283879 1 0 0
126678 5 0 0
367261 3 0 0
966776 9 0 0
34296 10 0 0
478744 5 0 0
195953 1 0 0
469541 8 0 0
737511 4 0 0
339133 1 0 0
769353 1 0 0
187855 2 0 0
95284 ...

output:

0.203667154
0.393439091
0.262888472
0.507853949
0.064633581
0.535740911
0.418357475
0.000000000
0.497465587
0.000000000
0.218906795
0.418036861
0.300830708
0.000000000
0.220088477
0.331077818
0.902075645
0.139990299
0.000000000
0.337311515
0.000000000
0.770067079
0.741432246
0.000000000
0.000000000
...

result:

ok 500 numbers

Test #31:

score: 0
Accepted
time: 4ms
memory: 27392kb

input:

498 838073
94312 664176 0 0
783035 152922 0 0
467181 80942 0 0
473461 424501 0 0
787375 41354 0 0
233712 568910 0 0
687952 968433 0 0
646205 768100 0 0
265832 950816 0 0
798568 789351 0 0
587532 144516 0 0
143590 623251 0 0
878619 221162 0 0
972055 178391 0 0
311368 291727 0 0
739837 957654 0 0
3456...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 498 numbers

Test #32:

score: 0
Accepted
time: 8ms
memory: 27384kb

input:

497 456453
4 5 0 0
18 5 0 0
94 1 0 0
37 1 0 0
31 3 0 0
89 3 0 0
17 9 0 0
75 9 0 0
27 1 0 0
21 7 0 0
32 3 0 0
92 10 0 0
93 9 0 0
90 10 0 0
71 8 0 0
64 2 0 0
89 3 0 0
56 3 0 0
100 1 0 0
10 9 0 0
26 10 0 0
30 4 0 0
38 5 0 0
28 7 0 0
88 2 0 0
28 7 0 0
35 3 0 0
28 8 0 0
49 5 0 0
88 8 0 0
90 9 0 0
8 9 0 0...

output:

0.000000000
0.000000000
0.000876322
0.000821552
0.000000000
0.000000000
0.000000000
0.000000000
0.000657242
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
99.978311020
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000...

result:

ok 497 numbers

Test #33:

score: 0
Accepted
time: 5ms
memory: 27308kb

input:

491 848355
11 3 0 0
56 1 0 0
90 4 0 0
20 7 0 0
81 5 0 0
65 4 0 0
37 7 0 0
97 8 0 0
16 7 0 0
12 6 0 0
41 5 0 0
44 10 0 0
24 5 0 0
54 8 0 0
44 9 0 0
53 10 0 0
3 7 0 0
5 1 0 0
83 6 0 0
48 2 0 0
14 10 0 0
78 6 0 0
56 3 0 0
78 9 0 0
5 1 0 0
23 4 0 0
30 3 0 0
18 5 0 0
31 7 0 0
19 4 0 0
11 4 0 0
72 7 0 0
6...

output:

0.000000000
0.000176813
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000265219
0.000000000
0.000117875
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 491 numbers

Test #34:

score: 0
Accepted
time: 5ms
memory: 27396kb

input:

495 893527
31 8 0 0
45 6 0 0
64 9 0 0
58 10 0 0
7 4 0 0
28 10 0 0
28 8 0 0
7 5 0 0
100 4 0 0
59 6 0 0
8 2 0 0
96 10 0 0
38 3 0 0
21 1 0 0
4 7 0 0
1 8 0 0
44 4 0 0
79 1 0 0
31 4 0 0
63 1 0 0
34 1 0 0
41 7 0 0
100 8 0 0
18 5 0 0
92 1 0 0
23 4 0 0
37 1 0 0
54 2 0 0
24 2 0 0
31 6 0 0
2 8 0 0
2 9 0 0
48 ...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
99.988024984
0.000000000
0.000223832
0.000000000
0.000000000
0.000111916
0.000000000
0.000000000
0.000000000
0.000335748
0.000000000
0.000279790
0.000447664
0.000000000
0.000000000
0.000000000
0.000335748...

result:

ok 495 numbers

Test #35:

score: 0
Accepted
time: 4ms
memory: 27324kb

input:

497 700770
48 119896 0 0
75 191381 0 0
10 231270 0 0
51 243904 0 0
95 93592 0 0
58 827665 0 0
41 117727 0 0
72 173134 0 0
64 568276 0 0
83 966147 0 0
13 290285 0 0
30 533602 0 0
31 873597 0 0
33 443223 0 0
94 8939 0 0
97 379936 0 0
39 27811 0 0
84 249070 0 0
80 671079 0 0
17 557259 0 0
45 534284 0 0...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 497 numbers

Test #36:

score: 0
Accepted
time: 9ms
memory: 27832kb

input:

492 253142
547106 7 2 271771
840398 4 7 825818
310911 8 1 838887
454806 5 1 575820
387193 9 0 122233
873098 7 8 526861
550253 8 0 973185
265168 8 7 892995
115898 9 6 617741
86710 8 6 491535
778055 7 6 81164
605637 7 5 298066
429661 1 5 613255
462657 2 4 298852
603890 4 2 42954
893926 9 4 219325
2753...

output:

0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.386691365
1.533293228
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
0.000000000
...

result:

ok 492 numbers

Test #37:

score: -100
Runtime Error

input:

499 42884
121865 9 52038 245095
793752 5 9769 336918
80817 5 74547 237766
24746 1 21568 872385
874613 4 80568 196103
336399 8 26838 236868
742672 5 90376 753098
356083 5 48197 983343
862715 3 66091 106193
912052 8 35482 681532
37293 2 24356 383661
131407 10 52360 682929
509077 5 44440 324479
978193 ...

output:


result: