using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "Input3"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("0"); //4.00000000 } else if (InputPattern == "Input2") { WillReturn.Add("4"); //1.265625 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); int N = int.Parse(InputList[0]); decimal[] AArr = new decimal[100 + 1]; AArr[0] = 4; AArr[1] = 3; for (int I = 2; I <= 100; I++) { AArr[I] = (19 * AArr[I - 1] - 12 * AArr[I - 2]) / 4; } Console.WriteLine(AArr[N]); } }