static void Solve() { int T = int.Parse(GCJ.ReadLine()); for (int t = 1; t <= T; t++) { int k = int.Parse(GCJ.ReadLine()); List <Dictionary <int, int> > dia = new List <Dictionary <int, int> >(); for (int i = 0; i < k * 2 - 1; i++) { string[] ss = GCJ.ReadLine().Split(' '); Dictionary <int, int> xs = new Dictionary <int, int>(); int x = -i; if (i >= k) { x = -(2 * k - 1 - i - 1); } foreach (var s in ss) { if (s.Length > 0) { xs.Add(x, int.Parse(s)); x += 2; } } dia.Add(xs); } var ans = _test(dia, k); GCJ.WriteLine(String.Format("Case #{0}: {1}", t, ans)); } }
static void Main(string[] args) { GCJ program = new GCJ(); program.Run(); }