이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <list>
#include <memory.h>
using namespace std;
int main() {
int input_tc;
cin >> input_tc;
for(int tc = 1; tc <= input_tc; tc++) {
double c, f, x;
double d = 2.0;
cin >> c >> f >> x;
double ans=0;
double tmp =0;
double k = 0;
while(1){
ans += x / d;
d += f;
tmp += x / d + c / (d - f);
if (ans < tmp) {
k += x / (d-f);
break;
}
ans = tmp;
k += c / (d - f);
}
printf("Case #%d: %.7lf\n", tc, k);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |