@k = gets.to_f def e x if x >= @k return 0.0 else ans = 1 1.upto(6){|i| ans += e(x + i) / 6 } return ans end end p e(0)