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 <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
long double A,B,C,L;
long double AA,BB;
int N;
long long K;
int main()
{
cin >> A >> B >> N >> K;
for(int i=N-1; i >= 0; i--)
{
C = sqrtl(A*A+B*B);
L = A * B / C;
AA = sqrtl(A * A - L * L);
BB = C - AA;
if((1LL << i) >= K)
{
A = L;
if(AA < BB)
B = BB;
else
B = AA;
}
else
{
A = L;
if(AA < BB)
B = AA;
else
B = BB;
K -= 1LL << i;
}
}
printf("%.12Lf",logl(A*B/2));
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |