#C6291. Arithmatica Pairing
Arithmatica Pairing
Arithmatica Pairing
You are provided with a list of N integers. Your task is to determine whether it is possible to pair all the numbers such that each pair consists of one even number and one odd number. In other words, every number must be paired with another number of opposite parity.
Mathematically, let \(E\) be the number of even numbers and \(O\) be the number of odd numbers among the given numbers. The pairing is possible if and only if \(E = O\). Otherwise, pairing all numbers in the required manner is impossible.
If the pairing is possible, output POSSIBLE
; otherwise, output IMPOSSIBLE
.
inputFormat
The input will be provided via standard input (stdin). The first line contains an integer \(N\) representing the total number of numbers. The second line contains \(N\) space-separated integers.
outputFormat
Output a single line to standard output (stdout): either POSSIBLE
if it is possible to pair the numbers as specified, or IMPOSSIBLE
if it is not.
4
1 2 3 4
POSSIBLE