require 'prime' class Yukicoder def initialize n, k = gets.chomp.split(' ').map(&:to_i) count = 0 list = Array.new(n+1, 0) Prime.each(n, Prime::EratosthenesGenerator.new) do |number| x = 1 while n >= number * x list[number * x] += 1 x += 1 end end puts list.count{|i| i >= k} end end Yukicoder.new