using System.Numerics; using System.Security.AccessControl; public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); //st0ring str = Console.ReadLine() ?? string.Empty; int n = int.Parse(str[0]); int m = int.Parse(str[1]); BigInteger[] ints = new BigInteger[n]; string[] number = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); for (int i = 0; i < n; i++) { ints[i] = BigInteger.Parse(Console.ReadLine() ?? string.Empty); } BigInteger[,] calc = new BigInteger[n, m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (number[0] == "+") { calc[i, j] = ints[i] + BigInteger.Parse(number[j + 1]); } else { calc[i, j] = ints[i] * BigInteger.Parse(number[j + 1]); } Console.Write("{0} ", calc[i, j]); } Console.WriteLine(); } } }