Số lượng bội
Xem dạng PDF
Mã bài:
soluongboi
Điểm:
1 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
512M
Dữ liệu vào:
stdin
Dữ liệu ra:
stdout
Tác giả:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Pascal, Python, Scratch

Bình luận
include<bits/stdc++.h>
using namespace std; long long x,d,k,n,i,m,t,j; int main () { iosbase::syncwith_stdio(0); cin.tie(0);cout.tie(0); freopen("bai3.inp","r",stdin); freopen("bai3.out","w",stdout); d=0; cin>>n>>k; for(i=2;i<=n;i++) { t=i; m=0; for(j=2;j*j<=t;j++) { if(t%j==0) { m=j; while(n%j==0) { t=t/j; } } } if(t>1) { m=t; } if(m<=k) { d=d+1; } } cout<<d; }