#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 *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long *, long *, long *);
int main() {
  FILE *infd;
  FILE *outfd;
  long n, m, k;
  infd = fopen("input.txt", "r");
  outfd = fopen("output.txt", "w");
  fscanf(infd, "%ld %ld %ld", &n, &m, &k);
  if (n >= m) {
    fprintf(outfd, "%ld\n", 1);
    return 0;
  }
  if (n <= k) {
    fprintf(outfd, "NO\n");
    return 0;
  }
  fprintf(outfd, "%ld\n", (m - n - 1) / (n - k) + 2);
  fclose(infd);
  fclose(outfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9f(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1040 <fscanf@plt>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jl     11ca <main+0x8a>
mov    -0x18(%rbp),%rdi
lea    0xe73(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1241 <main+0x101>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jg     11f6 <main+0xb6>
mov    -0x18(%rbp),%rdi
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1241 <main+0x101>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rax
sub    -0x20(%rbp),%rax
sub    $0x1,%rax
mov    -0x20(%rbp),%rcx
sub    -0x30(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rdx
add    $0x2,%rdx
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xea2(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe98(%rip),%rdi
lea    0xe9c(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xe8f(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
mov    %rbx,%rdi
call   1040 <fscanf@plt>
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%rax
cmp    %rdx,%rax
jle    11d0 <main+0x80>
mov    %rdx,%rcx
sub    (%rsp),%rcx
jle    11e8 <main+0x98>
not    %rdx
add    %rdx,%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1203 <main+0xb3>
cqto
idiv   %rcx
jmp    1207 <main+0xb7>
lea    0xe4e(%rip),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    122f <main+0xdf>
lea    0xe3b(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
jmp    122f <main+0xdf>
xor    %edx,%edx
div    %ecx
add    $0x2,%rax
lea    0xe13(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"output.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [12 x i8] c"%ld %ld %ld\00"
@.str.5 = [5 x i8] c"%ld\0A\00"
@.str.6 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 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 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load i32*, i32** %2
%10 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i64* %4, i64* %5, i64* %6)
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = icmp sge i64 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = load i32*, i32** %3
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 1)
store i32 0, i32* %1
br label %40
17: ; preds = %0
%18 = load i64, i64* %4
%19 = load i64, i64* %6
%20 = icmp sle i64 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32*, i32** %3
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %40
24: ; preds = %17
%25 = load i32*, i32** %3
%26 = load i64, i64* %5
%27 = load i64, i64* %4
%28 = sub nsw i64 %26, %27
%29 = sub nsw i64 %28, 1
%30 = load i64, i64* %4
%31 = load i64, i64* %6
%32 = sub nsw i64 %30, %31
%33 = sdiv i64 %29, %32
%34 = add nsw i64 %33, 2
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64 %34)
%36 = load i32*, i32** %2
%37 = call i32 @fclose(i32* %36)
%38 = load i32*, i32** %3
%39 = call i32 @fclose(i32* %38)
store i32 0, i32* %1
br label %40
40: ; preds = %24, %21, %14
%41 = load i32, i32* %1
ret i32 %41
}

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