Submission #143191

# Submission time Handle Problem Language Result Execution time Memory
143191 2019-08-13T10:16:35 Z bupjae Cookie Clicker Alpha (GCJ14_cookie) C++17
19 / 19
5 ms 504 KB
#include <iostream>

using namespace std;

double main2() {
    double c, f, x;
    cin >> c >> f >> x;
    double r = 2, t = 0;
    while ((x - c) / r > x / (r + f)) {
        t += c / r;
        r += f;
    }
    return t + x / r;
}

int main() {
    int t;
    cout.precision(10);
    cin >> t;
    for (int i = 1; i <= t; i++) {
        cout << "Case #" << i << ": " << main2() << "\n";
    }
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct