#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 */
scalar_t__ EOF;
long long Jie(int);
int /*<<< orphan*/ printf(char *, long long, long long);
scalar_t__ scanf(char *, int *);
int main() {
  long long y1, y2;
  int i, n;
  while (scanf("%d", &n) != EOF) {
    y1 = y2 = 0;
    for (i = 1; i <= n; i++) {
      if (i % 2 == 1)
        y1 = y1 + Jie(i);
      else
        y2 = y2 + Jie(i);
    }
    printf("%lld %lld\n", y1, y2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     1203 <main+0xd3>
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     11ea <main+0xba>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11b9 <main+0x89>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <Jie@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    11d7 <main+0xa7>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <Jie@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    11dc <main+0xac>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1176 <main+0x46>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe0a(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e95(%rip),%r14
cmp    (%r14),%rax
jne    1169 <main+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r15d,%r15d
lea    0x4(%rsp),%r12
jmp    11ab <main+0x7b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ebx,%ebx
xor    %r13d,%r13d
lea    0xe77(%rip),%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1030 <printf@plt>
lea    0xe62(%rip),%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    (%r14),%rax
je     1158 <main+0x28>
cmpl   $0x0,0x4(%rsp)
jle    1180 <main+0x50>
xor    %ebp,%ebp
xor    %r13d,%r13d
xor    %ebx,%ebx
nopl   0x0(%rax)
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <Jie@plt>
test   $0x1,%bpl
mov    %rax,%rcx
cmove  %r15,%rcx
cmovne %r15,%rax
add    %rcx,%rbx
add    %rax,%r13
cmp    0x4(%rsp),%ebp
jl     11c0 <main+0x90>
jmp    1185 <main+0x55>

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

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