Given a number N. You need to write a program to print the minimum number of squares of this number that sums to N. For Example: If N = 100 , N can be expressed as (10*10) and also as (5*5 + 5*5 + 5*5 + 5*5) but the output will be 1 as minimum number of square is 1 , i.e (10*10).

**Input:**

First line of input contains a single integer T, which denotes the number of test cases. Then T test cases follows. First line of each test case contains a single integer N.

**Output:**

For each test case print the minimum number of squares that sums to N.

**Constraints:**

1<=T<=100

1<=N<=10^{4}

**Example:
Input:**

3

100

6

25

1

3

1

Author: harsh.agarwal0

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.

murli01 | 343 |

decoder_101 | 216 |

Sulagna | 189 |

kya_bolti_public | 172 |

madhursengar24 | 172 |

PiyushPandey4 | 717 |

john_wick | 681 |

ASWATHAMA | 565 |

akhyasharma01 | 547 |

jagrit_ | 507 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.