This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
k, d, t = map(int,input().split())
q = k // d
if k % d != 0:
q += 1
cyc = q * d
hot = k
cold = cyc - k
x = (2 * t) // (2 * hot + cold)
T = x * (hot + cold)
left = 1 - x * hot / t - x * cold / (2 * t)
if hot / t >= left:
T += left * t
else:
T += hot
left -= hot / t
T += left * 2 * t
print("%.9lf" % T)
# | 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... |