import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner (System.in); int n=sc.nextInt(), m=sc.nextInt(); int[]d=new int[n+1]; //-1代表关闭 1代表打开 for (int i = 1; i < n+1; i++) { d[i]=-1; } int M=1; while(++M<=m){ for (int i = 1; i < n+1; i++) { if(i%M==0) d[i]=-d[i]; } } System.out.print(1); //1号肯定是关闭 for (int i = 2; i < n+1; i++) { if(d[i]==-1) System.out.print(","+i); } } }
0.0分
2 人评分