#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 *, unsigned long long);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  long long int t;
  unsigned long long int ans, n;
  scanf("%lld", &t);
  while (t--) {
    scanf("%llu", &n);
    if (n % 4 == 1)
      ans = (((n - 1) / 4) * 1000) + 192;
    if (n % 4 == 2)
      ans = (((n - 1) / 4) * 1000) + 442;
    if (n % 4 == 3)
      ans = (((n - 1) / 4) * 1000) + 692;
    if (n % 4 == 0)
      ans = (((n - 1) / 4) * 1000) + 942;
    printf("%llu\n", ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     123d <main+0x11d>
lea    0xea4(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x20(%rbp),%rax
and    $0x3,%rax
cmp    $0x1,%rax
jne    119b <main+0x7b>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
shr    $0x2,%rax
imul   $0x3e8,%rax,%rax
add    $0xc0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
and    $0x3,%rax
cmp    $0x2,%rax
jne    11ca <main+0xaa>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
shr    $0x2,%rax
imul   $0x3e8,%rax,%rax
add    $0x1ba,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
and    $0x3,%rax
cmp    $0x3,%rax
jne    11f9 <main+0xd9>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
shr    $0x2,%rax
imul   $0x3e8,%rax,%rax
add    $0x2b4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
jne    1228 <main+0x108>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
shr    $0x2,%rax
imul   $0x3e8,%rax,%rax
add    $0x3ae,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xdd7(%rip),%rdi
call   1030 <printf@plt>
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subq   $0x1,(%rsp)
jb     11d6 <main+0xb6>
lea    0xeb5(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xeae(%rip),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%rax
mov    %eax,%ecx
and    $0x3,%ecx
add    $0xffffffffffffffff,%rax
shr    $0x2,%rax
imul   $0x3e8,%rax,%rbx
lea    0xc0(%rbx),%rax
cmp    $0x1,%rcx
cmovne %r13,%rax
lea    0x1ba(%rbx),%rdx
cmp    $0x2,%rcx
cmovne %rax,%rdx
lea    0x2b4(%rbx),%rax
cmp    $0x3,%rcx
cmovne %rdx,%rax
add    $0x3ae,%rbx
test   %rcx,%rcx
cmovne %rax,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
subq   $0x1,(%rsp)
mov    %rbx,%r13
jae    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [5 x i8] c"%llu\00"
@.str.2 = [6 x i8] c"%llu\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 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %1
%7 = add nsw i64 %6, -1
store i64 %7, i64* %1
%8 = icmp eq i64 %6, 0
br i1 %8, label %33, label %9
9: ; preds = %0, %9
%10 = phi i64 [ %28, %9 ], [ undef, %0 ]
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%12 = load i64, i64* %2
%13 = and i64 %12, 3
%14 = icmp eq i64 %13, 1
%15 = add i64 %12, -1
%16 = lshr i64 %15, 2
%17 = mul i64 %16, 1000
%18 = add i64 %17, 192
%19 = select i1 %14, i64 %18, i64 %10
%20 = icmp eq i64 %13, 2
%21 = add i64 %17, 442
%22 = select i1 %20, i64 %21, i64 %19
%23 = icmp eq i64 %13, 3
%24 = add i64 %17, 692
%25 = select i1 %23, i64 %24, i64 %22
%26 = icmp eq i64 %13, 0
%27 = add i64 %17, 942
%28 = select i1 %26, i64 %27, i64 %25
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %28)
%30 = load i64, i64* %1
%31 = add nsw i64 %30, -1
store i64 %31, i64* %1
%32 = icmp eq i64 %30, 0
br i1 %32, label %33, label %9
33: ; preds = %9, %0
ret i32 0
}