407585: GYM102835 A Right-Coupled Numbers

Memory Limit:1024 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Right-Coupled Numberstime limit per test1 secondmemory limit per test1024 megabytesinputstandard inputoutputstandard output

An integer $$$x$$$ is said to be a right-coupled number, if you can find two integers, say $$$0 \le a \leq b \leq x$$$ such that $$$a \times b = x$$$ and $$$\frac{a}{b} \geq 0.5$$$. In this problem, your task is to determine whether a given integer is a right-coupled number or not.

Input

The first line of the input is an integer $$$N$$$ denoting the number of test cases ($$$1 \le N \le 1000$$$). Each test case is in one line, which contains a single integer $$$0 < x < 2^{15}$$$.

Output

If the given integer $$$x$$$ is a right-coupled number, output $$$1$$$; otherwise, output $$$0$$$. Each is in a single line.

ExampleInput
4
66
55
105
150
Output
1
0
0
1

加入题单

上一题 下一题 算法标签: