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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll K, D, T, N, L, Ans;
int main() {
cin >> K >> D >> T; T <<= 1;
N = (K+D-1) / D;
L = N*D + K;
Ans += N*D * (T/L);
T %= L;
if(T <= K*2) Ans += T/2;
else { Ans += T-K; T = 0; }
cout << Ans << "." << ((T&1) ? "5" : "0") << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |