Erase The Powers

All submissions for this problem are available.
Problem description : Raghu gives Rannvijay a task.There are infinite number of members in Rannvijay,s Team. He also has a blackboard.He write N natural numbers on a blackboard. His first team member come and erase all the numbers which are squares of a natural number.Then, 2nd one comes and erase all the cubes.The 3rd one erase all the fourth power of numbers and so on. Both of them are watching this. Rannvijay wants Raghu to tell him the number of his teammates that will get a chance to erase a number.But Raghu wants you to help him.So, go ahead.
Constraints
 1<=T<= 10.
 1<=L<=1026.
Input
Input description.
 The first line contains a single positive integer T , the number of test cases. T Each test cases consists of following:
 First line contains L i.e. the length of number N i.e. the number of digits in it.
 As Ncan be as large as 10^1024 we will enter it in array digit by digit
Output
Output description.
 For each test case, output a single line containing the answer for the corresponding test case....".
Example
Input: 3 1 2 1 9 10 2 3 0 3 2 5 1 7 9 2 Output: 1 2 11 Explanation In the first test case :1 and 2 are written on board.As 1 is perfect square so ans is 1.
Author:  teamcoadies10 
Tags  teamcoadies10 
Date Added:  27032013 
Time Limit:  0.5 sec 
Source Limit:  50000 Bytes 
Languages:  ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.5, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 