#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; vector> ans; for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n - i + 1; j++) { ans.push_back({i, j}); } } cout << ans.size() << '\n'; for (auto [a, b] : ans) { cout << a << ' ' << b << '\n'; } }