21 queue<pair<int, int>> to_process;
22 for (
int i = 1; i <= n - 1; ++i)
24 for (
int j = 2; j <= n; ++j)
28 to_process.push({i, j});
32 vector<string> answer;
33 answer.reserve(to_process.size());
35 while (!to_process.empty())
37 if (
gcd(to_process.front().first, to_process.front().second) == 1)
39 string str = to_string(to_process.front().first) +
'/' + to_string(to_process.front().second);
40 answer.push_back(str);