n = gets.to_i result = [] n.times{ p = gets.to_i count = 0 (1..p-1).each{ |i| count += i * ( i - 1 ) } result << count * 2 } puts result