func main() var n: int :: cui@inputInt() var h: int :: n / 2 if(n % 2 = 0) var m: int :: h * (h - 1) / 2 + h * (h - 1) / 2 do cui@print("\{m}\n") for i(0, h - 1) for j(0, i - 1) do cui@print("\{i + 1} \{n - j}\n") end for end for for i(h, n - 1) for j(i + 1, n - 1) do cui@print("\{i + 1} \{j + 1}\n") end for end for else var m: int :: h * (h + 1) / 2 + h * (h - 1) / 2 do cui@print("\{m}\n") for i(0, h) for j(0, i - 1) do cui@print("\{i + 1} \{n - j}\n") end for end for for i(h + 1, n - 1) for j(i + 1, n - 1) do cui@print("\{i + 1} \{j + 1}\n") end for end for end if end func