#!/usr/bin/env python3 (c, t, r), p = map(int, input().split()), float(input()) time_to_type, dp = [0] * (c + 1), [[0] * (c + 1) for _ in range(c + 1)] # time_to_type[x] is the expected time to type x characters without saving at any time. # Derived from: time_to_type[x] = dp[0][x] + 1-p + p * (1 + r + time_to_type[x]) for i in range(1, c + 1): time_to_type[i] = (time_to_type[i - 1] + 1 + p * r) / (1 - p) # dp[x][y] is the time required to type all characters between indices x (inclusive) and y (exclusive). for l in range(1, c + 1): for s in range(0, c + 1 - l): e = s + l dp[s][e] = min(time_to_type[e - s], 1e18, *(dp[s][k] + t + dp[k][e] for k in range(s + 1, e))) print(dp[0][c] + t)