local q = io.read("*n") for iq = 1, q do local n = io.read("*n") n = 1LL * n local ret = (n - 1) * n * (n + n - 1) / 6LL ret = ret - n * (n - 1) / 2LL ret = ret * 2LL ret = tostring(ret):gsub("LL", "") print(ret) end