家妮0926_1
unknown
c_cpp
4 years ago
387 B
5
Indexable
#include <iostream> using namespace std; int main() { int m, n; while (cin >> m >> n) { if (m < n) { cout << "-1\n"; } else { int index = 0; cout << "1"; while (1) { index += n; if (index + n <= m) { cout << ", " << index + 1; } if (index + n > m) { cout << '\n'; break; } } } } }
Editor is loading...