#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
void f(double a,double b,double c,ll N,ll K){
//printf("%.12f %.12f %.12f %lld %lld\n",exp(a),exp(b),exp(c),N,K);
if(N<0){
printf("%.12f",log(exp(a)*exp(b)/2.0));
return;
}
if(a>b+1e-9)swap(a,b);
if(K<(1ll<<N)){
f(a+b-c,(double)2.0*b-c,b,N-1,K);
}
else{
f((double)2.0*a-c,a+b-c,a,N-1,K-(1ll<<N));
}
}
int main(){
ll N,K;
double a,b,c;
scanf("%lf%lf%lld%lld",&a,&b,&N,&K);
if(a>b)swap(a,b);
c=(double)sqrt(a*a+b*b);
f((double)log(a),(double)log(b),(double)log(c),N-1,K);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1244 KB |
Output is correct |
2 |
Incorrect |
0 ms |
1244 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |