C - 4-adjacent
Time limit : 2sec / Memory limit : 256MB
Score : 400 points
We have a sequence of length N, a=(a1,a2,…,aN). Each ai is a positive integer.
Snuke's objective is to permute the element in a so that the following condition is satisfied:
For each 1≤i≤N−1, the product of ai and ai+1 is a multiple of 4.Determine whether Snuke can achieve his objective.
Input is given from Standard Input in the following format:
N a1 a2 … aNIf Snuke can achieve his objective, print Yes; otherwise, print No.
One solution is (1,100,10).
It is impossible to permute a so that the condition is satisfied.
The condition is already satisfied initially.