import math import traceback while True: try: W, Y, x, N = input().strip().split() W, Y, N = list(map(int, [W, Y, N])) x = float(x) for i in range(1, N+1): Y += 1 Y = (W*Y*(1-x)+W*x*21)/W print(math.ceil(Y)) except: break
import math import traceback while True: try: W, Y, x, N = input().strip().split() W, Y, N = list(map(int, [W, Y, N])) x = float(x) for i in range(1, N+1): Y += 1 Y = (W*Y*(1-x)+W*x*21)/W print(math.ceil(Y)) except: break