Solved problem 1

C# console solution for problem 1