def multiplication_table(n)
  puts  + ( * n) % [*1..n]
  puts  +  * n
  1.upto(n) do |x|
    print  % x
    1.upto(x-1) {|y| print }
    x.upto(n)   {|y| print  % (x*y)}
    puts
  end
end

multiplication_table 12