#include #include using namespace std; int main() { int T, S, D; cin >> T >> S >> D; double time = (double)D / S; if (T + time >= 24) { cout << setprecision(15) << (24 - T) + (time - (24 - T)) * 1.5 << endl; } else { cout << setprecision(15) << time << endl; } return 0; }