# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
940799 | rainboy | Cookie Clicker Alpha (GCJ14_cookie) | C11 | 1 ms | 348 KiB |
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 <math.h>
#include <stdio.h>
int main() {
int t, _;
scanf("%d", &t);
for (_ = 1; _ <= t; _++) {
double c, f, x, p, q, ans;
int k, h;
scanf("%lf%lf%lf", &c, &f, &x);
p = (x - c) * f - c * 2, q = c * f;
k = p < 0 ? 0 : ceil(p / q);
ans = 0;
for (h = 0; h < k; h++)
ans += c / (f * h + 2);
ans += x / (f * k + 2);
printf("Case #%d: %.12f\n", _, ans);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |