제출 #8219

#제출 시각아이디문제언어결과실행 시간메모리
8219tncks0121Cookie Clicker Alpha (GCJ14_cookie)C++98
0 / 19
964 ms1088 KiB
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <memory.h> 
#include <math.h> 
#include <assert.h> 
#include <stack> 
#include <queue> 
#include <map> 
#include <set> 
#include <algorithm> 
#include <string> 
#include <functional> 
#include <vector> 
#include <deque> 
#include <utility> 
#include <bitset> 
#include <limits.h>  

using namespace std; 
typedef long long ll; 
typedef unsigned long long llu; 
typedef double lf;
typedef unsigned int uint;
typedef long double llf;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
#define memset0(x) memset(x, 0, sizeof (x));
int TC, TCC;

double C, X, F;

void init () {
}

void solve () {
	scanf("%lf%lf%lf", &C, &F, &X);

	lf res = X / 2;
	for(int farms = 0; farms < 2000; farms++) {
		if(farms * F + 2.0 > X) break;

		lf t = 0, r = X;
		for(int i = 0; i < farms; i++) t += C / (i * F + 2.0);
		t += r / (farms * F + 2.0);
		res = min(res, t);
	}

	printf("Case #%d: %.10lf\n", TCC, res);
}

int main() {
	
	scanf("%d", &TC);
	while(++TCC <= TC) {
		init();
		solve();
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...