cswork / OAOpen practice workspace

OracleOA #7

Powers of 2

Estimated EasyJudge-ready

Topics (AI-labelled)Bits & Math

Determine whether each number in the array equals 2 raised to some non-negative integer power, returning 1 or 0.

Input

The first line contains n, and the second line contains n integers. Full original bounds: 1≤n≤100, 0≤a[i]≤50000000.

Output

Output n values 0 or 1 in input order, separated by spaces.

Example 1

Input:

5
1 2 3 4 0

Output:

1 1 0 1 0

Example 2

Input:

1
0

Output:

0

Example 3

Input:

2
33554432 50000000

Output:

1 0

Example notes

The outputs of the three public examples are, in order: 1 1 0 1 0; 0; 1 0. They were verified by independent enumeration or direct simulation.

Editorial

Loading solution…