Three Cats and Two Omens
At the moonlit fish market, Griffithm presents Gats and two other cats with a positive integer . Each cat chooses one positive integer, producing an ordered triple . The cats are distinct, so changing which cat receives a value produces a different triple.
The chest of fish opens if
and at least one of the following omens occurs:
- is a perfect square;
- is a perfect cube.
A triple satisfying both omens is counted only once. A perfect square has the form , and a perfect cube has the form , for some positive integer . In particular, is both a perfect square and a perfect cube.
For each given value of , count the feast-worthy ordered triples .
Input
The first line contains an integer (), the number of test cases.
Each of the next lines contains one integer ().
Output
For each test case, print one integer: the number of feast-worthy ordered triples.
Samples
Sample 1
Input
4 1 2 8 64
Output
1 3 9 25
For , the only triple is . For , the valid triples are the three permutations of . For , there are ten ordered product triples, and only satisfies neither omen. For , exactly ordered triples are feast-worthy.