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:  C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, PYP3, CLOJ, FS 
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. 