This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
long long s,a,b,n,k,i,j,D[44][44];
long long C(long long N,long long R)
{
if(D[N][R])return D[N][R];
if(R==0||R==N)return D[N][R]=1;
if(R==1)return D[N][R]=N;
return D[N][R]=C(N-1,R)+C(N-1,R-1);
}
main()
{
scanf("%lld%lld%lld%lld",&a,&b,&n,&k);
i=0;
while(s<k)
{
s+=C(n,i);
i++;
}
k=n-i+1;
if(a>b)j=a,a=b,b=j;
double sq=(double)(a*b)/(double)2;
for(j=1;j<=k;j++)
{
sq*=(double)(b*b)/(double)(a*a+b*b);
}
for(j=1;j<=n-k;j++)
{
sq*=(double)(a*a)/(double)(a*a+b*b);
}
printf("%.10lf",log(sq));
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |