#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
double A,B,C,L;
double AA,BB;
int N;
long long K;
int main()
{
cin >> A >> B >> N >> K;
for(int i=N; i; i--)
{
C = sqrt(A*A+B*B);
L = A * B / C;
AA = sqrt(A * A - L * L);
BB = C - AA;
if((1LL << i) > K)
{
if(AA < BB)
{
A = L;
B = BB;
}
else
{
A = L;
B = AA;
}
}
else
{
if(AA < BB)
{
A = L;
B = AA;
}
else
{
A = L;
B = BB;
}
K -= 1LL << i;
}
}
printf("%.9f",log(A*B/2));
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1828 KB |
Output is correct |
2 |
Incorrect |
0 ms |
1828 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |