#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned long long);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, unsigned long long *,
                          unsigned long long *, unsigned long long *);
int main() {
  FILE *f = fopen("INP.TXT", "r");
  unsigned long long x, y, k, i;
  fscanf(f, "%lld %lld %lld", &x, &y, &k);
  fclose(f);
  i = y / (x * 6 + k) * 6;
  while (i * x + (i + 5) / 6 * k < y)
    i++;
  f = fopen("OUT.TXT", "w");
  fprintf(f, "%lld\n", i);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rax
imul   $0x6,-0x18(%rbp),%rcx
add    -0x28(%rbp),%rcx
xor    %edx,%edx
div    %rcx
imul   $0x6,%rax,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
add    $0x5,%rax
mov    $0x6,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
imul   -0x28(%rbp),%rcx
add    %rcx,%rax
cmp    -0x20(%rbp),%rax
jae    11ee <main+0xae>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11a5 <main+0x65>
lea    0xe24(%rip),%rdi
lea    0xe25(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xe0f(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xeb0(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea4(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%rsi
lea    (%rsi,%rsi,2),%rax
mov    0x8(%rsp),%rdi
lea    (%rdi,%rax,2),%rbx
mov    %rcx,%rax
or     %rbx,%rax
shr    $0x20,%rax
je     11b2 <main+0x72>
mov    %rcx,%rax
xor    %edx,%edx
div    %rbx
jmp    11b8 <main+0x78>
mov    %ecx,%eax
xor    %edx,%edx
div    %ebx
add    %rax,%rax
lea    (%rax,%rax,2),%rax
movabs $0xaaaaaaaaaaaaaaab,%r8
aa aa aa
nopl   0x0(%rax)
mov    %rax,%r15
mov    %rax,%rbx
imul   %rsi,%rbx
add    $0x5,%rax
mul    %r8
shr    $0x2,%rdx
imul   %rdi,%rdx
add    %rbx,%rdx
lea    0x1(%r15),%rax
cmp    %rcx,%rdx
jb     11d0 <main+0x90>
lea    0xe1d(%rip),%rdi
lea    0xe1e(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xe11(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rdx
call   1050 <fprintf@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"%lld %lld %lld\00"
@.str.3 = [8 x i8] c"OUT.TXT\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = call i32 @fscanf(i32* %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64* %3, i64* %4, i64* %5)
%10 = load i32*, i32** %2
%11 = call i32 @fclose(i32* %10)
%12 = load i64, i64* %4
%13 = load i64, i64* %3
%14 = mul i64 %13, 6
%15 = load i64, i64* %5
%16 = add i64 %14, %15
%17 = udiv i64 %12, %16
%18 = mul i64 %17, 6
store i64 %18, i64* %6
br label %19
19: ; preds = %31, %0
%20 = load i64, i64* %6
%21 = load i64, i64* %3
%22 = mul i64 %20, %21
%23 = load i64, i64* %6
%24 = add i64 %23, 5
%25 = udiv i64 %24, 6
%26 = load i64, i64* %5
%27 = mul i64 %25, %26
%28 = add i64 %22, %27
%29 = load i64, i64* %4
%30 = icmp ult i64 %28, %29
br i1 %30, label %31, label %34
31: ; preds = %19
%32 = load i64, i64* %6
%33 = add i64 %32, 1
store i64 %33, i64* %6
br label %19
34: ; preds = %19
%35 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %35, i32** %2
%36 = load i32*, i32** %2
%37 = load i64, i64* %6
%38 = call i32 @fprintf(i32* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64 %37)
%39 = load i32*, i32** %2
%40 = call i32 @fclose(i32* %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"%lld %lld %lld\00"
@.str.3 = [8 x i8] c"OUT.TXT\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = bitcast i64* %1 to i8*
%6 = bitcast i64* %2 to i8*
%7 = bitcast i64* %3 to i8*
%8 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64* %1, i64* %2, i64* %3)
%9 = call i32 @fclose(i32* %4)
%10 = load i64, i64* %2
%11 = load i64, i64* %1
%12 = mul i64 %11, 6
%13 = load i64, i64* %3
%14 = add i64 %12, %13
%15 = udiv i64 %10, %14
%16 = mul i64 %15, 6
br label %17
17: ; preds = %17, %0
%18 = phi i64 [ %16, %0 ], [ %25, %17 ]
%19 = mul i64 %18, %11
%20 = add i64 %18, 5
%21 = udiv i64 %20, 6
%22 = mul i64 %21, %13
%23 = add i64 %22, %19
%24 = icmp ult i64 %23, %10
%25 = add i64 %18, 1
br i1 %24, label %17, label %26
26: ; preds = %17
%27 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 @fprintf(i32* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64 %18)
%29 = call i32 @fclose(i32* %27)
ret i32 0
}