using System;
public class Program
{
public static void Main()
int[] a = {1, 2, 3, 5, 6};
Console.WriteLine(isPaired(a));
}
public static int isPaired(int[] a)
int flag = 0;
int halfLength = a.Length / 2;
//Console.WriteLine(halfLength);
for (int i = 0; i <= halfLength; i++)
int even = 2 * i;
//Console.WriteLine(even);
if (even < a.Length)
if (a[even] % 2 == 0)
flag = 0;
break;
else
flag = 1;
int odd = (2 * i) + 1;
//Console.WriteLine(odd);
if (odd < a.Length)
if (a[odd] % 2 == 0)
return flag;