Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- namespace Forum
- {
- class Program
- {
- static void Main()
- {
- Console.ReadLine();
- string[] array = Console.ReadLine().Split(' ');
- BigInteger oddProduct = 1;
- BigInteger evenProduct = 1;
- for (int i = 0; i < array.Length; i++)
- {
- if (i % 2 == 0)
- {
- evenProduct *= BigInteger.Parse(array[i]);
- }
- else
- {
- oddProduct *= BigInteger.Parse(array[i]);
- }
- }
- if (oddProduct == evenProduct)
- {
- Console.WriteLine("yes " + oddProduct);
- }
- else
- {
- Console.WriteLine("no " + evenProduct + " " + oddProduct);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment