QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#437610#8676. Three Kinds of DicecqbzlyAC ✓84ms24988kbC++142.1kb2024-06-09 14:05:532024-06-09 14:05:54

Judging History

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

  • [2024-06-09 14:05:54]
  • 评测
  • 测评结果:AC
  • 用时:84ms
  • 内存:24988kb
  • [2024-06-09 14:05:53]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fi first
#define se second
#define db double
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e6+5;
int n,m,cnt,a[N],b[N],f1[N],f2[N],sm1[N],sm2[N],lsh[N];
db res1,res2,p[N],q[N];
int get(int x){
    return lower_bound(lsh+1,lsh+1+cnt,x)-lsh;
}
bool chk(db mid){
    db mx1=-inf,mx2=inf;
    for(int i=1;i<=cnt;i++){
        if(p[i]>=0&&q[i]>=mid)return 1;
        if(p[i]<=0&&q[i]<=mid)continue;
        if(p[i]<0)mx1=max(mx1,(mid-q[i])/p[i]);
        else mx2=min(mx2,(mid-q[i])/p[i]);
    }
    return mx1>=mx2;
}
int main(){
    //freopen("dice.in","r",stdin);
    //freopen("dice.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        lsh[++cnt]=a[i],lsh[++cnt]=max(1,a[i]-1),lsh[++cnt]=a[i]+1;
    }
    cin>>m;
    for(int i=1;i<=m;i++){
        cin>>b[i];
        lsh[++cnt]=b[i],lsh[++cnt]=max(1,b[i]-1),lsh[++cnt]=b[i]+1;
    }
    sort(lsh+1,lsh+1+cnt),cnt=unique(lsh+1,lsh+1+cnt)-lsh-1;
    for(int i=1;i<=m;i++)f2[get(b[i])]++;
    for(int i=1;i<=cnt;i++)sm2[i]=sm2[i-1]+f2[i];
    db sm=0;
    for(int i=1;i<=n;i++){
        int j=get(a[i]);
        sm+=(sm2[j-1]+f2[j]/2.0)/n/m;
    }
    if(sm<0.5){
        swap(n,m),swap(a,b);
    }
    for(int i=1;i<=cnt;i++)f1[i]=f2[i]=0;
    for(int i=1;i<=n;i++)f1[get(a[i])]++;
    for(int i=1;i<=m;i++)f2[get(b[i])]++;
    for(int i=1;i<=cnt;i++){
        sm1[i]=sm1[i-1]+f1[i];
        sm2[i]=sm2[i-1]+f2[i];
    }
    for(int i=1;i<=cnt;i++){
        p[i]=(sm1[i-1]+f1[i]/2.0)/n-0.5;
        q[i]=(sm2[cnt]-sm2[i]+f2[i]/2.0)/m;
    }
    db l=0,r=1;
    for(int i=1;i<=50;i++){
        db mid=(l+r)/2;
        if(chk(mid))l=mid;
        else r=mid;
    }
    res1=1-l;
    for(int i=1;i<=cnt;i++){
        p[i]=(sm2[cnt]-sm2[i]+f2[i]/2.0)/m-0.5;
        q[i]=(sm1[i-1]+f1[i]/2.0)/n;
    }
    l=0,r=1;
    for(int i=1;i<=50;i++){
        db mid=(l+r)/2;
        if(chk(mid))l=mid;
        else r=mid;
    }
    res2=l;
    cout<<fixed<<setprecision(10)<<res1<<" "<<res2;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 2 4 9
3 1 6 8

output:

0.2916666667 0.7500000000

result:

ok 2 numbers

Test #2:

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

input:

3 1 6 8
6 2 2 4 4 9 9

output:

0.2916666667 0.7500000000

result:

ok 2 numbers

Test #3:

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

input:

1 1
1 2

output:

0.7500000000 0.0000000000

result:

ok 2 numbers

Test #4:

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

input:

5 2 2 2 3 3
6 5 5 6 6 6 7

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #5:

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

input:

6 2 2 7 7 9 9
6 3 3 5 5 10 10

output:

0.2500000000 0.7500000000

result:

ok 2 numbers

Test #6:

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

input:

11 12 11 15 9 3 8 18 4 17 13 9
11 8 18 5 15 12 5 11 11 11 3 8

output:

0.4736842105 0.5250000000

result:

ok 2 numbers

Test #7:

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

input:

20 17 18 29 37 5 15 5 9 37 34 12 38 26 29 2 40 23 20 4 12
23 22 2 24 33 6 19 15 31 1 18 30 11 40 13 2 19 5 39 37 22 9 31 26

output:

0.4405034325 0.5541666667

result:

ok 2 numbers

Test #8:

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

input:

40 52 22 29 52 44 3 69 45 40 73 66 51 2 21 20 51 49 34 72 64 69 68 56 4 6 39 29 18 43 6 56 15 22 31 25 78 59 58 40 66
46 52 24 40 12 56 7 4 29 12 26 45 39 27 47 55 45 17 74 28 12 75 77 77 73 41 21 20 23 55 13 58 21 43 11 22 2 67 18 49 56 15 26 25 35 20 61

output:

0.4339714471 0.5652243590

result:

ok 2 numbers

Test #9:

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

input:

76 54 80 5 41 10 124 87 45 67 42 118 33 128 118 21 40 41 3 18 69 131 113 121 106 99 72 108 85 101 108 72 27 13 45 133 137 4 62 30 111 71 39 31 120 79 91 30 58 43 6 60 65 83 83 42 83 26 108 20 133 24 8 125 138 100 21 103 81 45 102 76 44 118 109 18 67
81 4 15 26 65 110 48 126 39 128 82 1 43 134 18 69 ...

output:

0.4211886305 0.5737110634

result:

ok 2 numbers

Test #10:

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

input:

96 11 1 23 7 6 41 8 11 40 5 24 32 40 40 24 24 24 23 17 21 27 21 21 42 1 29 15 45 24 44 50 1 34 11 7 1 12 45 15 3 14 9 25 5 5 20 31 1 41 44 7 27 28 11 24 37 50 7 7 48 1 22 4 5 40 32 33 32 18 18 26 49 28 34 42 29 15 18 4 42 12 21 17 10 47 2 44 40 8 15 7 44 25 5 13 19
88 16 30 20 24 2 26 39 28 1 16 10 ...

output:

0.4818548387 0.5185950413

result:

ok 2 numbers

Test #11:

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

input:

208 31 110 162 24 386 12 262 283 384 392 361 168 58 129 155 45 36 70 2 127 296 380 188 125 148 77 117 272 219 38 79 322 70 91 115 273 228 375 398 353 277 307 258 60 42 60 298 109 60 158 192 159 29 165 103 51 304 313 392 113 62 149 203 152 3 373 206 144 136 214 151 348 287 181 202 367 67 138 388 93 3...

output:

0.4955877991 0.5044270833

result:

ok 2 numbers

Test #12:

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

input:

1170 1311 1924 962 906 1767 1811 1941 1956 1311 364 371 1825 1155 918 1625 1882 1082 198 889 924 1830 244 589 1639 296 1326 1663 379 1479 1369 729 1698 870 1845 217 888 754 858 966 1887 61 1801 1002 1185 1848 610 1914 1742 409 648 781 445 1217 96 1639 1681 1028 923 123 1234 909 569 747 1182 1538 368...

output:

0.4855426993 0.5141050030

result:

ok 2 numbers

Test #13:

score: 0
Accepted
time: 19ms
memory: 23368kb

input:

22713 21796 19194 13993 27763 16658 14855 3720 21919 4029 27311 21879 4981 25538 24982 5230 7339 4299 26976 30753 39183 38686 25483 3489 12855 28134 34477 25105 39953 31801 23937 31229 26076 32962 33965 6078 33306 15915 21622 3643 29726 2542 27764 4554 17811 17329 10576 26448 24416 30696 3230 3730 1...

output:

0.4995293383 0.5004706031

result:

ok 2 numbers

Test #14:

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

input:

100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

0.7500000000 0.0000000000

result:

ok 2 numbers

Test #15:

score: 0
Accepted
time: 12ms
memory: 21560kb

input:

1 1
100000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100...

output:

0.7500000000 0.0000000000

result:

ok 2 numbers

Test #16:

score: 0
Accepted
time: 19ms
memory: 24772kb

input:

100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

0.7500000000 0.0000000000

result:

ok 2 numbers

Test #17:

score: 0
Accepted
time: 15ms
memory: 23364kb

input:

100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

0.5000050000 0.4999950000

result:

ok 2 numbers

Test #18:

score: 0
Accepted
time: 17ms
memory: 18176kb

input:

100000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 10000...

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #19:

score: 0
Accepted
time: 82ms
memory: 21860kb

input:

100000 100000 99999 99998 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 9995...

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #20:

score: 0
Accepted
time: 84ms
memory: 21820kb

input:

100000 100000 99999 99998 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 9995...

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #21:

score: 0
Accepted
time: 23ms
memory: 20260kb

input:

99818 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

0.2126750390 0.7873208946

result:

ok 2 numbers

Test #22:

score: 0
Accepted
time: 25ms
memory: 22340kb

input:

99536 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

0.0093848903 0.7476315498

result:

ok 2 numbers

Test #23:

score: 0
Accepted
time: 23ms
memory: 18276kb

input:

99536 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

0.0093848903 0.7476315498

result:

ok 2 numbers

Test #24:

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

input:

77 171374872 241639648 194650219 785923176 44879978 171374872 572364662 194650219 622176869 572364662 44879978 637973696 629927342 629927342 802671596 241639648 44879978 802671596 194650219 572364662 629927342 629927342 629927342 637973696 171374872 701867938 171374872 572364662 44879978 785923176 7...

output:

0.3432282004 0.6457734330

result:

ok 2 numbers

Test #25:

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

input:

71 994336085 876792083 994336085 160929533 877689188 397904084 101727523 406590565 493888134 312276650 406590565 493888134 771053239 312276650 877689188 110667814 160929533 233410550 876792083 101727523 160929533 101727523 160929533 493888134 397904084 493888134 994336085 406590565 233410550 8776891...

output:

0.3898036104 0.6126660582

result:

ok 2 numbers

Test #26:

score: 0
Accepted
time: 26ms
memory: 23592kb

input:

35 15837610 920080997 354969432 354969432 497062046 15837610 760117651 489477657 489477657 760117651 489477657 979864980 15837610 15837610 507580448 152986375 15837610 760117651 920080997 354969432 354969432 507580448 15837610 760117651 760117651 354969432 15837610 760117651 152986375 489477657 4970...

output:

0.4677388402 0.5310277646

result:

ok 2 numbers

Test #27:

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

input:

2181 930742488 605254549 227347170 849138290 346631813 802467319 936261443 383148418 167959513 963169213 940822713 188586631 497851967 827948544 420567968 854453419 10501697 289511989 426024243 791096563 814235362 13163749 165143406 540804386 639351196 68295337 929900042 346631813 432357821 93267368...

output:

0.4438148340 0.5505094071

result:

ok 2 numbers

Test #28:

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

input:

1051 564651099 927158620 6969288 272869441 588814782 222044713 638552227 959439282 699532682 720742825 806482195 770842015 133159188 355836836 745655381 609834202 787721335 317953129 941941289 656418022 424020728 511373124 787721335 169069072 371453642 787721335 148238546 997784005 699532682 1954672...

output:

0.4666956300 0.5326803140

result:

ok 2 numbers

Test #29:

score: 0
Accepted
time: 31ms
memory: 18944kb

input:

6293 276019022 202577503 885332852 259073186 583837171 920579975 438781137 269184415 976158564 21539650 829800174 243863931 789527717 777491695 564443776 107420560 562038251 368127224 785383940 660506217 527595923 564443776 454698153 417902647 409053754 989888849 197612182 949291061 168006031 963900...

output:

0.4900036828 0.5101372145

result:

ok 2 numbers

Test #30:

score: 0
Accepted
time: 31ms
memory: 23404kb

input:

62218 6290188 133358709 111129067 409631445 587348591 758380422 950997337 987021454 812860750 455952995 293615987 612396152 419518364 860403854 665763449 766279042 810511873 517560669 433073561 89551864 576952213 267579126 5603164 423732182 586058310 203365873 654778645 497048751 431767549 567294264...

output:

0.3984698962 0.6273999677

result:

ok 2 numbers

Test #31:

score: 0
Accepted
time: 19ms
memory: 18556kb

input:

48054 451017488 35089153 550747055 860805438 678739246 188439987 489531317 700831386 875351687 369100616 710176105 464836906 229577124 411397767 215445791 430956048 553893042 360795182 563129429 74577288 887404954 595304660 455501492 389249356 307197214 427273678 285053275 872457725 373526566 730250...

output:

0.4800515827 0.5191830734

result:

ok 2 numbers

Test #32:

score: 0
Accepted
time: 44ms
memory: 21168kb

input:

70100 66810131 849112639 33917204 939851538 473249097 379695721 772679455 223390093 229236901 43984944 513003857 678742317 503368062 258410294 39241799 760096011 94884214 697944233 441011241 476713871 551573741 908655478 819602653 630809100 554712162 470143389 828101791 38003858 557860049 577973507 ...

output:

0.4902758120 0.5096858565

result:

ok 2 numbers

Test #33:

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

input:

76 133648179 133648179 737496437 22843180 344981651 387182456 834491544 544366644 733872112 588464033 169573457 669737160 169573457 134587619 935496442 133648179 387182456 834491544 935496442 169573457 387182456 935496442 737496437 582828803 544366644 588464033 588464033 834491544 134587619 54436664...

output:

0.4036635007 0.6099071207

result:

ok 2 numbers

Test #34:

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

input:

85 970646301 445314182 948822838 885181378 715470181 452386412 445314182 933310806 791126667 346245334 948822838 106481670 167816986 885181378 933310806 760037860 715470181 970646301 948822838 452386412 885181378 715470181 948822838 791726901 167816986 632744833 167816986 337316222 167816986 6327448...

output:

0.4884554140 0.5118174409

result:

ok 2 numbers

Test #35:

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

input:

53 550472882 127704353 701365705 701365705 739984829 701365705 701365705 181915987 516588862 516588862 516588862 127704353 554726396 550472882 550472882 934704313 934704313 739984829 516588862 550472882 701365705 934704313 181915987 934704313 739984829 701365705 701365705 516588862 181915987 1819159...

output:

0.4345551222 0.5753010084

result:

ok 2 numbers

Test #36:

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

input:

9053 451424369 772854729 60732795 690622643 543663691 638676859 474481609 870296979 899986760 276131912 965724909 955234204 187334350 360110716 995298056 809604608 358851316 203076424 975942094 581296745 147981067 643083297 998721114 628666666 591305805 453563584 473998500 231485959 852562799 947729...

output:

0.4226748039 0.5797735651

result:

ok 2 numbers

Test #37:

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

input:

3696 404207935 132347845 404103267 484781541 284987395 265495792 535804729 864128923 806931511 164564843 32710563 675896390 512949253 991583615 431713 581438461 661380384 977577563 148274567 391840897 882430549 220957527 568719450 483574376 98140729 991583615 803746596 954808735 585666177 514647602 ...

output:

0.4856855040 0.5144218527

result:

ok 2 numbers

Test #38:

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

input:

6067 204818503 445391312 272090898 551255431 810981057 559164817 472204665 650008188 232584178 122917404 347240494 205564144 203912222 692648530 7733647 978569444 449639547 639272227 235873385 573245887 628506177 131318102 800978529 837048460 747631896 508435134 661816109 536083815 413778789 9121656...

output:

0.4933539563 0.5066866488

result:

ok 2 numbers

Test #39:

score: 0
Accepted
time: 13ms
memory: 16560kb

input:

31622 155887489 804688272 913936619 265181319 539022812 189438924 355429964 561944780 601600489 48555214 174772611 259472750 515552412 319036746 295705217 792112618 535677516 731074044 933007726 638807202 82947203 823865643 844711300 221588943 550352183 260685546 513764853 942090870 489087786 978427...

output:

0.4340277778 0.5582822086

result:

ok 2 numbers

Test #40:

score: 0
Accepted
time: 24ms
memory: 24988kb

input:

41458 429107024 316876766 456208392 677697380 706761505 619631255 828793542 313201633 976600157 317875896 18220071 225591292 853310420 477302187 823457932 421235339 77480420 138399607 85571531 68297762 27660275 672946976 569516356 50831019 378954837 215318040 479005088 57248267 877574185 896121137 2...

output:

0.4919361433 0.5081720929

result:

ok 2 numbers

Test #41:

score: 0
Accepted
time: 65ms
memory: 19588kb

input:

58105 608225036 800122832 425309028 838841636 538774141 10971609 710578824 381583350 665277539 656582490 875117141 22050662 423155179 137236288 338694554 840903712 330004709 920412465 32914369 938771861 718624436 391431029 880746987 686819209 131701154 125389057 436549159 789125518 317508612 8867113...

output:

0.4972609755 0.5027525542

result:

ok 2 numbers

Test #42:

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

input:

2 1 2
1 1

output:

0.6666666667 0.2500000000

result:

ok 2 numbers

Test #43:

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

input:

3 2 3 4
3 2 2 5

output:

0.4000000000 0.6250000000

result:

ok 2 numbers

Test #44:

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

input:

3 2 3 5
3 3 3 4

output:

0.4000000000 0.6250000000

result:

ok 2 numbers

Test #45:

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

input:

3 2 4 5
3 3 3 4

output:

0.4000000000 0.5833333333

result:

ok 2 numbers

Test #46:

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

input:

3 2 3 4
3 3 3 5

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #47:

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

input:

3 2 3 5
3 3 3 5

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #48:

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

input:

4 1 2 3 4
3 1 2 4

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #49:

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

input:

4 1 2 3 4
3 1 3 4

output:

0.4750000000 0.5238095238

result:

ok 2 numbers

Test #50:

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

input:

5 2 4 6 8 9
5 2 4 6 8 8

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #51:

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

input:

20 2 12 2 12 2 12 2 12 2 12 2 12 2 12 2 12 2 12 2 12
10 2 3 4 5 6 7 8 9 10 11

output:

0.1500000000 0.7058823529

result:

ok 2 numbers

Test #52:

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

input:

20 1 2 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
20 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #53:

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

input:

1 1
1 1000000000

output:

0.7500000000 0.0000000000

result:

ok 2 numbers

Test #54:

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

input:

1 1000000000
1 1

output:

0.7500000000 0.0000000000

result:

ok 2 numbers

Test #55:

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

input:

1 999999999
1 1000000000

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #56:

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

input:

1 1000000000
1 999999999

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #57:

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

input:

1 1
2 1 2

output:

0.6666666667 0.2500000000

result:

ok 2 numbers

Test #58:

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

input:

1 1
2 1 1000000000

output:

0.6666666667 0.2500000000

result:

ok 2 numbers

Test #59:

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

input:

2 1 1
2 2 1

output:

0.6666666667 0.2500000000

result:

ok 2 numbers

Test #60:

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

input:

9 1 1 1 1 1 1 1 1 1
2 2 1

output:

0.6666666667 0.2500000000

result:

ok 2 numbers

Test #61:

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

input:

1 1000000000
2 1000000000 1

output:

0.6250000000 0.3333333333

result:

ok 2 numbers

Test #62:

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

input:

2 1000000000 999999999
1 1000000000

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #63:

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

input:

2 1000000000 999999999
1 999999999

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #64:

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

input:

1 500000000
3 1000000000 1 1

output:

0.5000000000 0.5000000000

result:

ok 2 numbers

Test #65:

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

input:

3 1 1 1
4 1 2 1 1

output:

0.6000000000 0.3750000000

result:

ok 2 numbers

Test #66:

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

input:

3 1 1 1
4 1 2 1 2

output:

0.6666666667 0.2500000000

result:

ok 2 numbers

Test #67:

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

input:

3 1 1 1
4 2 2 1 2

output:

0.7142857143 0.1250000000

result:

ok 2 numbers

Test #68:

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

input:

3 1 2 1
4 1 2 1 1

output:

0.5312500000 0.4666666667

result:

ok 2 numbers

Test #69:

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

input:

3 1 2 1
4 1 2 1 2

output:

0.5555555556 0.4375000000

result:

ok 2 numbers

Test #70:

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

input:

3 1 2 1
4 2 2 1 2

output:

0.6190476190 0.3437500000

result:

ok 2 numbers

Test #71:

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

input:

3 2 2 1
4 1 2 1 1

output:

0.6250000000 0.3333333333

result:

ok 2 numbers

Test #72:

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

input:

3 2 2 1
4 1 2 1 2

output:

0.5500000000 0.4444444444

result:

ok 2 numbers

Test #73:

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

input:

3 2 2 1
4 2 2 1 2

output:

0.5238095238 0.4750000000

result:

ok 2 numbers

Test #74:

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

input:

3 2 2 2
4 1 2 1 1

output:

0.6875000000 0.2000000000

result:

ok 2 numbers

Test #75:

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

input:

3 2 2 2
4 1 2 1 2

output:

0.6250000000 0.3333333333

result:

ok 2 numbers

Test #76:

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

input:

3 2 2 2
4 2 2 1 2

output:

0.5625000000 0.4285714286

result:

ok 2 numbers

Extra Test:

score: 0
Extra Test Passed