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<algorithm>
#include<math.h>
long long pow(long long n, long long k) {
if (k == 0) {
return 1;
}
long long temp = pow(n, k / 2);
if (k % 2 == 0) {
return temp*temp;
}
return temp*temp*n;
}
int main() {
long long a, b, n, k;
scanf("%lld%lld%lld%lld", &a, &b, &n, &k);
if (a < b) {
std::swap(a, b);
}
long long l = pow(2, n);
double s = (double)a*b / 2;
while (l!=1) {
if (k > (l / 2)) {
s = b*b*s / ((a*a) + (b*b));
k -= (l / 2);
}
else {
s = a*a*s / ((a*a) + (b*b));
}
l /= 2;
}
printf("%.12lf", log(s));
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |