#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long int a, i, b = (long)0, d, e, diff, dif;
  scanf("%ld\n", &a);
  for (i = 1; i <= a; i++) {
    scanf("%ld\n", &e);
    if (e == 1) {
      printf("%ld\n", b);
    } else if (e >= 2 && e % 2 == 0) {
      diff = e / 2;
      d = diff * diff;
      printf("%ld\n", d);
    } else {
      dif = e / 2;
      dif = dif * dif + dif;
      printf("%ld\n", dif);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1232 <main+0x112>
lea    0xe9c(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
cmpq   $0x1,-0x30(%rbp)
jne    118d <main+0x6d>
mov    -0x20(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    121c <main+0xfc>
cmpq   $0x2,-0x30(%rbp)
jl     11e4 <main+0xc4>
mov    -0x30(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    11e4 <main+0xc4>
mov    -0x30(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
imul   -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
jmp    1217 <main+0xf7>
mov    -0x30(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
imul   -0x40(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
jmp    121c <main+0xfc>
jmp    1221 <main+0x101>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmpq   $0x0,(%rsp)
jle    11a9 <main+0x89>
xor    %ebx,%ebx
lea    0xeb8(%rip),%r15
lea    0x8(%rsp),%r14
jmp    1164 <main+0x44>
nop
xor    %esi,%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    (%rsp),%rbx
jge    11a9 <main+0x89>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rsi
cmp    $0x1,%rsi
je     1150 <main+0x30>
jle    1190 <main+0x70>
mov    %esi,%eax
and    $0x1,%eax
test   %rax,%rax
jne    1190 <main+0x70>
shr    %rsi
imul   %rsi,%rsi
jmp    1152 <main+0x32>
nop
mov    %rsi,%rax
shr    $0x3f,%rax
add    %rsi,%rax
sar    %rax
mov    %rax,%rsi
imul   %rax,%rsi
add    %rax,%rsi
jmp    1152 <main+0x32>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %4
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
store i64 1, i64* %3
br label %10
10: ; preds = %48, %0
%11 = load i64, i64* %3
%12 = load i64, i64* %2
%13 = icmp sle i64 %11, %12
br i1 %13, label %14, label %51
14: ; preds = %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %6)
%16 = load i64, i64* %6
%17 = icmp eq i64 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i64, i64* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %19)
br label %47
21: ; preds = %14
%22 = load i64, i64* %6
%23 = icmp sge i64 %22, 2
br i1 %23, label %24, label %36
24: ; preds = %21
%25 = load i64, i64* %6
%26 = srem i64 %25, 2
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %24
%29 = load i64, i64* %6
%30 = sdiv i64 %29, 2
store i64 %30, i64* %7
%31 = load i64, i64* %7
%32 = load i64, i64* %7
%33 = mul nsw i64 %31, %32
store i64 %33, i64* %5
%34 = load i64, i64* %5
%35 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %34)
br label %46
36: ; preds = %24, %21
%37 = load i64, i64* %6
%38 = sdiv i64 %37, 2
store i64 %38, i64* %8
%39 = load i64, i64* %8
%40 = load i64, i64* %8
%41 = mul nsw i64 %39, %40
%42 = load i64, i64* %8
%43 = add nsw i64 %41, %42
store i64 %43, i64* %8
%44 = load i64, i64* %8
%45 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %44)
br label %46
46: ; preds = %36, %28
br label %47
47: ; preds = %46, %18
br label %48
48: ; preds = %47
%49 = load i64, i64* %3
%50 = add nsw i64 %49, 1
store i64 %50, i64* %3
br label %10
51: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %1
%7 = icmp slt i64 %6, 1
br i1 %7, label %31, label %8
8: ; preds = %0, %25
%9 = phi i64 [ %28, %25 ], [ 1, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%11 = load i64, i64* %2
%12 = icmp eq i64 %11, 1
br i1 %12, label %25, label %13
13: ; preds = %8
%14 = icmp sgt i64 %11, 1
%15 = and i64 %11, 1
%16 = icmp eq i64 %15, 0
%17 = and i1 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = lshr i64 %11, 1
%20 = mul nsw i64 %19, %19
br label %25
21: ; preds = %13
%22 = sdiv i64 %11, 2
%23 = mul nsw i64 %22, %22
%24 = add nsw i64 %23, %22
br label %25
25: ; preds = %8, %21, %18
%26 = phi i64 [ %24, %21 ], [ %20, %18 ], [ 0, %8 ]
%27 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %26)
%28 = add nuw nsw i64 %9, 1
%29 = load i64, i64* %1
%30 = icmp slt i64 %9, %29
br i1 %30, label %8, label %31
31: ; preds = %25, %0
ret i32 0
}