using System.Text; using System.Linq; using System.Collections.Generic; using System; public class P { public int a { get; set; } public int b { get; set; } } public class Hello { static void Main() { var n = int.Parse(Console.ReadLine().Trim()); getAns(n); } static void getAns(int n) { var ps = new List
(); var imax = n / 2; var jmax = n; for (int i = 1; i <= imax; i++) { for (int j = i + 1; j <= jmax; j++) ps.Add(new P { a = i, b = j }); jmax--; } Console.WriteLine(ps.Count()); var sb = new StringBuilder(); foreach (var x in ps) sb.Append(string.Format("{0} {1}\n", x.a, x.b)); Console.Write(sb); } }