require 'prime' class Yukicoder def initialize n, k = gets.chomp.split(' ').map(&:to_i) count = 0 2.upto(n) do |number| if !number.prime? && number.prime_division.size >= k count += 1 end end puts count end end Yukicoder.new