N,K=$<.map &:to_i def f(n, k) dp = {} g = ->sum, i{ dp[[sum,i]] ||= if i < 0 && sum == 0 1 elsif i < 0 || sum < 1 0 elsif i < k (4..6).map{|j| g[sum - j, i - 1] }.sum else (1..6).map{|j| g[sum - j, i - 1] }.sum end } sums = (n..n*6).map{|sum| g[sum, n-1] } sum_of_sums = sums.sum sums.map{|sum| sum.quo(sum_of_sums) } end taro = f(N, K) jiro = f(N, 0) ans = (1...taro.size).map{|i| (0...i).map{|j| taro[i] * jiro[j] }.sum }.sum puts "%.3f" % ans