# Enter your code here. Read input from STDIN. Print output to STDOU a,b,t = gets.strip.split(' ').map(&:to_i) current = 1 (1..t).each do |time| current = 0.5*a*current + 0.5*b*current end puts current.to_i