#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 *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int solve_2750() {
  int nCases, num, nFeet;
  scanf("%d", &nCases);
  for (num = 0; num < nCases; num++) {
    scanf("%d", &nFeet);
    if (nFeet % 2 != 0)
      printf("0 0\n");
    else if (nFeet % 4 != 0)
      printf("%d %d\n", nFeet / 4 + 1, nFeet / 2);
    else
      printf("%d %d\n", nFeet / 4, nFeet / 2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<solve_2750>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1206 <solve_2750+0xe6>
lea    0xeae(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1182 <solve_2750+0x62>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f3 <solve_2750+0xd3>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11c6 <solve_2750+0xa6>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x1,%esi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ee <solve_2750+0xce>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f3 <solve_2750+0xd3>
jmp    11f8 <solve_2750+0xd8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <solve_2750+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_2750>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11cb <solve_2750+0x9b>
lea    0xea5(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0xe9c(%rip),%r15
lea    0xe9c(%rip),%r12
xor    %ebp,%ebp
jmp    1191 <solve_2750+0x61>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jge    11cb <solve_2750+0x9b>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   $0x1,%al
jne    1180 <solve_2750+0x50>
lea    0x3(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x2,%esi
test   $0x3,%al
je     11b6 <solve_2750+0x86>
add    $0x1,%esi
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1188 <solve_2750+0x58>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"0 0\0A\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
define i32 @solve_2750() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
store i32 0, i32* %2
br label %5
5: ; preds = %35, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %38
9: ; preds = %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = srem i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %34
16: ; preds = %9
%17 = load i32, i32* %3
%18 = srem i32 %17, 4
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = load i32, i32* %3
%22 = sdiv i32 %21, 4
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %3
%25 = sdiv i32 %24, 2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %25)
br label %33
27: ; preds = %16
%28 = load i32, i32* %3
%29 = sdiv i32 %28, 4
%30 = load i32, i32* %3
%31 = sdiv i32 %30, 2
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %29, i32 %31)
br label %33
33: ; preds = %27, %20
br label %34
34: ; preds = %33, %14
br label %35
35: ; preds = %34
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %5
38: ; preds = %5
ret i32 0
}

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