Given a number N, check whether it is** sparse or not**. A number is said to be a sparse number if **in the binary representation** of the number **no two or more consecutive bits are set**.

**Input:**

The first line of input contains an integer **T** denoting the number of test cases. The first line of each test case is number 'N'.

**Output:**

Print '**1**' if the number is sparse and '**0**' if the number is not sparse.

**Constraints:**

1 <= T <= 100

1 <= N <= 10^{3}

**Example:**

**Input:**

2

2

3

**Output:**

1

0

**Explanation:
Testcase 1:** Binary Representation of 2 is 10, which is not having consecutive set bits. So, it is sparse number.

lakshmi_pandey | 72 |

abbatta7 | 68 |

Ashish Kumar Vaishy | 62 |

aman19 | 58 |

Kumar Gaurav Singh | 58 |

saumitra13325 | 612 |

ashujack | 551 |

lakshmi_pandey | 544 |

aman19 | 538 |

piyushmittal25 | 514 |

blackshadows | 5249 |

akhayrutdinov | 5111 |

Ibrahim Nash | 5087 |

Quandray | 4354 |

sanjay05 | 3668 |

Login to report an issue on this page.