Submission #115434

#TimeUsernameProblemLanguageResultExecution timeMemory
115434youngyojunCooking (innopolis2018_final_B)C++11
100 / 100
3 ms384 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...