Knock! Knock!

0

0 votes
Problem

There are N doors initially closed, a person walks through them Multiple times and  toggles ( if open then close and if closed then open).

  • In the first walk, the person toggles every door
  • in the second walk 2nd, 4th, 6th,8th,.......so on
  • in the third walk 3rd,6th,9th,.... so on
  • similar fashion person continues............
  • in the Nth walk, person toggles Nth door.

Print the index of all the doors which are open in the end.


INPUT:

First line of Input contains integer T, that is the number of testcases

then T lines follow an Integer N , the number of doors.

OUTPUT: 

For each N, print  Multiple lines containing list all doors which will be open in the end.


CONSTRAINTS :

0<T<=100

0<N<=10^6

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In both the cases only door 1 will remain open.

In second case, initially all doors are closed, person walks through all the doors and toggle them to open, now person again walks through them but this time starting from door 2 and closing it, finally person walks through door 3 closing it. 

Editor Image

?