Exemple #1
0
        private static IEnumerable <string> ProcessCases(IEnumerable <List <string> > cases)
        {
            var currentCaseNumber = 0;

            foreach (var caseLines in cases)
            {
                currentCaseNumber++; //1-indexed.
                var parsedCase = new CaseInput(caseLines);
                var solver     = new CaseSolver(parsedCase);
                var result     = solver.Solve();

                var resultText = result.ToString();

                yield return($"Case #{currentCaseNumber}: {resultText}");
            }
        }
Exemple #2
0
        public void Square()
        {
            var inputString = @"2
3 3
30 10 40
20 50 60
60 60 50
5 2
1 1000000000
500000000 1000000000
1 1000000000
500000000 1
1 1000000000";
            var io          = new TestIOStub(inputString);

            CaseSolver.Run(io);

            io.Output.Should().BeEquivalentTo(
                @"Case #1: 110",
                "Case #2: 4999999996"
                );
        }