Square Numbers
Submissions: 1085   Accuracy:

5.03%

  Difficulty: Medium   Marks: 4

A number k is called a square number if for some value of d > 1,  k % (d*d) = 0.
Given a number N, the task is to find the total number of positive square numbers less than or equal to N.

Input: 
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of a sinlge line containing a single integer N.

Output:
Corresponding to each test case, print in a new line an integer denoting the total number of positive square numbers less than or equal to N.

Constraints:
1<=T<=100
1<=N<=10^9

Example:
Input:
3
2
4
10

Output:
0
1
3

Explanation:

4 -> (divisible by 2*2)
8 ->(divisible by 2*2)
9 ->(divisible by 3*3)

For 2-> no numbers less than or equal 2 are square numbers
For 4-> only 4 is a square number
For 10-> 4,8,9 are square numbers

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Pranay Pandey
Author: pra1nay7_313


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.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.