Odd or Even Product
You are given N integers (given in a single line, separated by a space).
- Write a program that checks whether the product of the odd elements is equal to the product of the even elements.
- Elements are counted from 1 to N, so the first element is odd, the second is even, etc.
- On the first line you will receive the number N
- On the second line you will receive N numbers separated by a whitespace
- If the two products are equal, output a string in the format "yes PRODUCT_VALUE", otherwise write on the console "no ODD_PRODUCT_VALUE EVEN_PRODUCT_VALUE"
- N will always be a valid integer number in the range
- All input numbers from the second line will also be valid integers
- Time limit: 0.1s
- Memory limit: 16MB
2 1 1 6 3
4 3 2 5 2
|no 16 15|