gets.to_i.times do |i|
    r, t = gets.split.map(&:to_f)
    arr = Array.new
    arr.push((t / 30).floor * 5 + ((r - 100) / 100).floor + 1)
    arr.push((t / 30).floor * 5 + ((r - 100) / 100).ceil + 1)
    arr.push((t / 30).ceil * 5 + ((r - 100) / 100).floor + 1)
    arr.push((t / 30).ceil * 5 + ((r - 100) / 100).ceil + 1)
    puts arr.uniq.join(" ")
end