https://www.acmicpc.net/problem/5217
중복되지 않게 같은 쌍을 찾기 위해 i*2 < n일때까지 반복해준다...
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
cout << "Pairs for " << n << ":";
bool isFirst = true;
for (int i = 1; i * 2 < n; ++i) {
int j = n - i;
if (isFirst) {
cout << " ";
isFirst = false;
}
else cout << ", ";
cout << i << " " << j;
}
cout << "\n";
}
return 0;
}