ss = [2, 3, 5, 7, 11, 13] gs = [4, 6, 8, 9, 10, 12] a = ss.product(gs).map{|s,g| s*g} k = gets.to_i puts a.count(k).to_f / a.size