Submission #142636

#TimeUsernameProblemLanguageResultExecution timeMemory
142636meatrowCooking (innopolis2018_final_B)C++17
100 / 100
3 ms504 KiB
//#pragma GCC optimize("O3") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native") //#pragma GCC optimize ("unroll-loops") #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); ll k, d, t; cin >> k >> d >> t; ll kek = (k + d - 1) / d * d - k; t *= 2; ld ans = t / (2 * k + kek) * (k + kek); t %= 2 * k + kek; if (t > k * 2) { ans += t - k * 2; t = k * 2; } ans += ld(t) / 2; cout << fixed << setprecision(25) << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...