def n_queens(n)
  if n == 1
    return 
  elsif n < 4
    puts 
    return 
  end

  evens = (2..n).step(2).to_a
  odds = (1..n).step(2).to_a

  rem = n % 12  
  nums = evens  

  nums.rotate if rem == 3 or rem == 9  

  
  if rem == 8
    odds = odds.each_slice(2).flat_map(&:reverse)
  end
  nums.concat(odds)

  
  if rem == 2
    nums[nums.index(1)], nums[nums.index(3)] = nums[nums.index(3)], nums[nums.index(1)]
    nums << nums.delete(5)
  end

  
  if rem == 3 or rem == 9
    nums << nums.delete(1)
    nums << nums.delete(3)
  end

  
  nums.map do |q|
    a = Array.new(n,)
    a[q-1] = 
    a*()
  end
end

(1 .. 15).each {|n| puts ; puts n_queens(n); puts}