제출 #15470

#제출 시각아이디문제언어결과실행 시간메모리
15470yukariko맛있는 과자 (kriii3_A)C++98
0 / 33
0 ms1744 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...