t = gets.to_i t.times do n = gets.to_i p Math.sqrt(n).floor end