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;
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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |