#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, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int i, j, t, r, x, y, l, w;
  scanf("%d", &t);
  for (i = 1; i <= t; i++) {
    scanf("%d", &r);
    if (r < 1)
      printf("Case %d:\n0 0\n0 0\n0 0\n0 0\n", i);
    else {
      l = r * 5;
      w = r * 3;
      x = (45 * l) / 100;
      y = (55 * l) / 100;
      printf("Case %d:\n-%d %d\n%d %d\n%d -%d\n-%d -%d\n", i, x, w / 2, y,
             w / 2, y, w / 2, x, w / 2);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x48,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xec9(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     122c <main+0x10c>
lea    0xea6(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x1c(%rbp)
jge    1183 <main+0x63>
mov    -0x10(%rbp),%esi
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1219 <main+0xf9>
imul   $0x5,-0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
imul   $0x3,-0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
imul   $0x2d,-0x28(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
imul   $0x37,-0x28(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%r8d
mov    -0x2c(%rbp),%eax
mov    $0x2,%edi
cltd
idiv   %edi
mov    %eax,%r9d
mov    -0x24(%rbp),%ebx
mov    -0x2c(%rbp),%eax
mov    $0x2,%edi
cltd
idiv   %edi
mov    %eax,%r11d
mov    -0x20(%rbp),%r10d
mov    -0x2c(%rbp),%eax
mov    $0x2,%edi
cltd
idiv   %edi
mov    -0x30(%rbp),%edx
lea    0xe1c(%rip),%rdi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121e <main+0xfe>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <main+0x27>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11fc <main+0xdc>
lea    0xeb1(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0xea8(%rip),%r15
lea    0xebb(%rip),%r12
xor    %ebp,%ebp
jmp    11d4 <main+0xb4>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,2),%esi
imul   $0xe1,%eax,%ecx
movslq %ecx,%rcx
imul   $0x51eb851f,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rdx
add    %ecx,%edx
imul   $0x113,%eax,%eax
cltq
imul   $0x51eb851f,%rax,%r8
mov    %r8,%rax
shr    $0x3f,%rax
sar    $0x25,%r8
add    %eax,%r8d
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
mov    %r12,%rdi
mov    %ebp,%esi
mov    %ecx,%r9d
xor    %eax,%eax
push   %rcx
push   %rdx
push   %rcx
push   %r8
call   1030 <printf@plt>
add    $0x20,%rsp
cmp    0x8(%rsp),%ebp
jge    11fc <main+0xdc>
add    $0x1,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jg     1170 <main+0x50>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    0x8(%rsp),%ebp
jl     11d4 <main+0xb4>
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 = [26 x i8] c"Case %d:\0A0 0\0A0 0\0A0 0\0A0 0\0A\00"
@.str.2 = [38 x i8] c"Case %d:\0A-%d %d\0A%d %d\0A%d -%d\0A-%d -%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 1, i32* %2
br label %11
11: ; preds = %48, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %51
15: ; preds = %11
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %2
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %47
22: ; preds = %15
%23 = load i32, i32* %5
%24 = mul nsw i32 %23, 5
store i32 %24, i32* %8
%25 = load i32, i32* %5
%26 = mul nsw i32 %25, 3
store i32 %26, i32* %9
%27 = load i32, i32* %8
%28 = mul nsw i32 45, %27
%29 = sdiv i32 %28, 100
store i32 %29, i32* %6
%30 = load i32, i32* %8
%31 = mul nsw i32 55, %30
%32 = sdiv i32 %31, 100
store i32 %32, i32* %7
%33 = load i32, i32* %2
%34 = load i32, i32* %6
%35 = load i32, i32* %9
%36 = sdiv i32 %35, 2
%37 = load i32, i32* %7
%38 = load i32, i32* %9
%39 = sdiv i32 %38, 2
%40 = load i32, i32* %7
%41 = load i32, i32* %9
%42 = sdiv i32 %41, 2
%43 = load i32, i32* %6
%44 = load i32, i32* %9
%45 = sdiv i32 %44, 2
%46 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %33, i32 %34, i32 %36, i32 %37, i32 %39, i32 %40, i32 %42, i32 %43, i32 %45)
br label %47
47: ; preds = %22, %19
br label %48
48: ; preds = %47
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
br label %11
51: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"Case %d:\0A0 0\0A0 0\0A0 0\0A0 0\0A\00"
@.str.2 = [38 x i8] c"Case %d:\0A-%d %d\0A%d %d\0A%d -%d\0A-%d -%d\0A\00"
define i32 @main() {
%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 slt i32 %6, 1
br i1 %7, label %27, label %8
8: ; preds = %0, %23
%9 = phi i32 [ %24, %23 ], [ 1, %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 = icmp slt i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %23
15: ; preds = %8
%16 = mul nsw i32 %11, 3
%17 = mul i32 %11, 225
%18 = sdiv i32 %17, 100
%19 = mul i32 %11, 275
%20 = sdiv i32 %19, 100
%21 = sdiv i32 %16, 2
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %18, i32 %21, i32 %20, i32 %21, i32 %20, i32 %21, i32 %18, i32 %21)
br label %23
23: ; preds = %13, %15
%24 = add nuw nsw i32 %9, 1
%25 = load i32, i32* %1
%26 = icmp slt i32 %9, %25
br i1 %26, label %8, label %27
27: ; preds = %23, %0
ret i32 0
}