def fact(n) = n.zero?? 1:  1.upto(n).inject(&:*)

def lah(n, k)
  case k
    when 1 then fact(n)
    when n then 1
    when (..1),(n..) then 0
    else n<1? 0: (fact(n)*fact(n-1)) / (fact(k)*fact(k-1)) / fact(n-k)
  end
end

r = (0..12)
puts 
puts %11d

r.each do |row|
  print  % row
  puts %11d
end

puts ;
puts (1..100).map{|a| lah(100,a)}.max