Run ID:80985

提交时间:2024-07-11 17:21:17

# include<iostream> using namespace std; int ar[5001]; int main(){ int n,m; cin >>n>>m; for(int i=1;i<=m;i++){ for(int j=1;j<=n;j++){ if(j%i==0){ if(ar[j]==0){ ar[j]=1; } else{ ar[j]=0; } } } } cout <<1; for(int j=2;j<=n;j++){ if(ar[j]==1){ cout <<","<<j; } } return 0; }