Squares and Cubes
Medium
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Let's write out in a row the squares and cubes of positive integers: , ....
For the given value of , count the number of written numbers from to . In other words, find the number of such that is a square or a cube of a positive integer (or both a square and a cube simultaneously).
Input
The first line contains the number of test cases .
Each of the next lines contains one positive integer .
Output
For each test print the answer — the number of integers from to that belong to the list.
Examples
Input #1
Answer #1
Submissions 562
Acceptance rate 50%