文件目录

#include <iostream>
using namespace std;
int main()
{
    bool d[100050] = {}; // 全设为false ,代表开灯状态
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= m; i++)
        for (int j = 1; j <= n; j++)
            if (j % i == 0)
                d[j] = !d[j];
    bool f = true;
    for (int i = 1; i <= n; i++)
        if (d[i] && f)
        {
            cout << i;
            f = false;
        }
        else if (d[i])
            cout << "," << i;
    return 0;
}