using System; using System.Linq; using System.Diagnostics; using System.Collections.Generic; using Debug = System.Diagnostics.Debug; using StringBuilder = System.Text.StringBuilder; using System.Numerics; namespace Program { public class Solver { public void Solve() { var s = Console.ReadLine().Split(' '); var n = int.Parse(s[0]).Validate(x => 1 <= x && x <= 100); var X = long.Parse(s[1]).Validate(x => 1 <= x && x <= 1000000000000); var a = Console.ReadLine().Split(' ').Validate(x => x.Length == n).Select(int.Parse).ToArray().ValidateArray(x => 1 <= x && x <= 1000000000); var dotsum = a.Aggregate(BigInteger.One, (x, y) => x * (BigInteger)y).Validate(x => x <= BigInteger.Pow(10, 100)); } static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; } static public void Swap(ref T a, ref T b) { var tmp = a; a = b; b = tmp; } } } #region main static class Ex { static public string AsString(this IEnumerable ie) { return new string(System.Linq.Enumerable.ToArray(ie)); } static public string AsJoinedString(this IEnumerable ie, string st = " ") { return string.Join(st, ie); } static public void Main() { var solver = new Program.Solver(); solver.Solve(); } } #endregion static public class Validator { static public T Validate(this T input, Func f) { if (!f(input)) throw new Exception("invalid input"); return input; } static public T[] ValidateArray(this T[] input, Func f) { foreach (var x in input) if (!f(x)) throw new Exception("invalid input"); return input; } }