# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
940799 | 2024-03-07T16:11:30 Z | rainboy | Cookie Clicker Alpha (GCJ14_cookie) | C | 1 ms | 348 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |