問題一覧 > 通常問題

No.106 I Hate Primes! 2

レベル : / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 309
作問者 : scache / テスター : kroton
お気に入りにしたユーザー ProblemId : 158 / 自分の提出
問題文最終更新日: 2026-06-28 16:29:58
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 67 (順位表) の他の問題:

Problem Statement

Honda, who hates prime numbers, does not really want to use numbers composed of few primes (numbers with few distinct prime factors). So he has decided to use, among the numbers from $2〜N$, only those that have at least $K$ prime factors. However, since he would not like having too few usable numbers, he has decided to find out in advance how many numbers he can use.

Given $N$ and $K$, output the count of usable numbers.

Input

N K

The input is given as integers.
$2 \le N \le 2,000,000=2\times 10^6$
$1 \le K \le 100$

Output

Output the count of numbers between $2$ and $N$, inclusive, whose number of distinct prime factors is at least $K$.
Print a newline at the end.

Sample

Sample 1
Input
2 1
Output
1

Sample 2
Input
4 2
Output
0


Among 2,3,4 there is no number with 2 or more prime factors, so the answer is 0.

Sample 3
Input
1000 4
Output
23

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。