package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var out = bufio.NewWriter(os.Stdout) func main() { //bufサイズ以上の文字列入力が必要な場合は拡張すること buf := make([]byte, 9*1024*1024) sc.Buffer(buf, bufio.MaxScanTokenSize) sc.Split(bufio.ScanWords) t := nextInt() var ans []int for i := 0; i < t; i++ { n := nextInt() ans = append(ans, solve(n)) } PrintVertically(ans) } func solve(n int) int { return n * (n + 1) } func nextInt() int { sc.Scan() i, _ := strconv.Atoi(sc.Text()) return int(i) } func PrintInt(x int) { defer out.Flush() fmt.Fprintln(out, x) } func PrintVertically(x []int) { defer out.Flush() for _, v := range x { fmt.Fprintln(out, v) } }