private void ProcessPuzzle() { int i = 0; var casesInfo = input[i].Split(new char[] { ' ' }); L = Convert.ToInt32(casesInfo[0]); D = Convert.ToInt32(casesInfo[1]); N = Convert.ToInt32(casesInfo[2]); for (int j = 1; j <= D; j++) { Lang.AddWord(input[++i]); } StringBuilder result = new StringBuilder(); for (int j = 1; j <= N; j++) { var output = string.Format("Case #{0}: {1}", j, Lang.PatternMatch(input[++i])); result.AppendLine(output); Console.WriteLine(output); } File.WriteAllText($"2009/QualificationRound/{fileName}.out", result.ToString()); Console.ReadLine(); }