Given an integer N, check if it is possible to represent it as a sum of two squares of integers.

**Input:**

First line of input contains an integer T, denoting number of test cases. Then T lines follow, each of them consisting of exactly one integer N.

**Output:**

For each test case output 1 if it is possible to represent given number as a sum of two squares and 0 if it is not possible.

**Constraints:**

1<=T<=100

1<=N<=10^6

**Example:
Input:**

3

1

2

7

1

1

0

Author: saksham seth

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

sabka_din_aayega | 342 |

maggiiiii | 262 |

Savage_19 | 226 |

thanuvinu94 | 211 |

lost_found | 173 |

Bishnu Dev Panda | 803 |

sabka_din_aayega | 653 |

Anugrah_kumar | 562 |

okayboss | 561 |

maggiiiii | 545 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4925 |

Quandray | 4547 |

Login to report an issue on this page.