This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int a, b, N;
long long T,K;
cin >> a >> b >> N >> K;
if (a > b){
int t = a;
a = b;
b = t;
}
double S = (a*b);
S = log(S/2);
a = a*a;
b = b*b;
double A = (a / (double)(a + b));
double B = (b / (double)(a + b));
A = log(A);
B = log(B);
T = (1 << N);
while (T > 1){
T = T / 2;
if (K<=T){
S += B;
}
else{
K = K - T;
S += A;
}
}
printf("%.10f", S);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |