#include #include #include #define FORR(i,b,e) for(int i=(b);i<(int)(e);++i) #define FOR(i,e) FORR(i,0,e) #define dump(var) cerr << #var ": " << var << "\n" #define dumpc(con) for(auto& e: con) cerr << e << " "; cerr<<"\n" typedef long long ll; typedef unsigned long long ull; using namespace std; int prime[2000001]; int f[2000001]; int count_factors(int limit, int thres) { prime[2] = 1; for (int i = 3; i <= limit; i+=2) prime[i] = 1; for (int i = 4; i <= limit; i+=2) { f[i]++; } for (int i = 3, l = limit/2 /*(int)sqrt(limit)+1*/; i <= l; i+=2) { if (prime[i]) { for (int j = i*2; j <= limit; j += i) { prime[j] = 0; f[j]++; } } } FOR(i,limit+1) if(prime[i])cout << i << " "; cout << "\n"; FOR(i,limit+1) cout << f[i] << " "; cout << "\n"; int count = 0; for (int i = 2; i <= limit; i++) { cout << f[i]+prime[i] << " "; count += (f[i]+prime[i] >= thres); } return count; } int main() { cin.tie(0); ios::sync_with_stdio(false); int N, K; cin >> N >> K; cout << count_factors(N, K) << "\n"; return 0; }