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 <stdio.h>
#include <math.h>
int N;
double A, B;
long long K;
int main(void) {
int i;
long long u=1;
double Sa, Sb, A1, B1, H, temp;
scanf("%lf %lf %d %lld",&A,&B,&N,&K);
for(i=1 ; i<=N ; i++) u<<=1;
for(i=1 ; i<=N ; i++) {
u>>=1;
Sa=A*A*A*B/2.0/(A*A+B*B);
Sb=A*B*B*B/2.0/(A*A+B*B);
A1=A*A/sqrt(A*A+B*B);
B1=B*B/sqrt(A*A+B*B);
H=A*B/sqrt(A*A+B*B);
if(Sa>Sb) {
temp=Sa;
Sa=Sb;
Sb=temp;
temp=A1;
A1=B1;
B1=temp;
}
if(K<=u) {
A=H;
B=B1;
}
else {
K-=u;
A=A1;
B=H;
}
}
printf("%.12lf",log(A*B/2.0));
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |