#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; vector> v; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n - i; ++j) { v.push_back({ i, j }); } } cout << v.size() << '\n'; for (auto [x, y] : v) cout << x + 1 << ' ' << y + 1 << '\n'; return 0; }