Beispiel #1
0
        public static void Solve(TextReader tr, TextWriter tw)
        {
            int L = int.Parse(tr.ReadLine());

            for (int i = 1; i <= L; i++)
            {
                int K = int.Parse(tr.ReadLine());
                int x = 0, y = 0, z = 0, vx = 0, vy = 0, vz = 0;
                for (int j = 0; j < K; j++)
                {
                    string[] s = tr.ReadLine().Split(' ');
                    x  += int.Parse(s[0]);
                    y  += int.Parse(s[1]);
                    z  += int.Parse(s[2]);
                    vx += int.Parse(s[3]);
                    vy += int.Parse(s[4]);
                    vz += int.Parse(s[5]);
                }
                if (i == 17)
                {
                    L = L;
                }
                ProblemB problem = new ProblemB(x, y, z, vx, vy, vz, K);
                tw.WriteLine("Case #{0}: {1}", i, problem.Calc());
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            TextReader tr = new StreamReader(@"C:\Google Code Jam\B-large.in");
            TextWriter tw = new StreamWriter(@"C:\Google Code Jam\B-large.txt");

            ProblemB.Solve(tr, tw);
            tr.Close(); tw.Close();
            Console.ReadKey();
        }