#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 *, int *, int *);
int main(void) {
  int problem;
  int a;
  int b;
  int times;
  scanf("%d %d %d", &problem, &a, &b);
  if (problem <= 5) {
    times = problem * b;
  } else {
    times = 5 * b + (problem - 5) * a;
  }
  printf("%d\n", times);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
cmpl   $0x5,-0x8(%rbp)
jg     1160 <main+0x40>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1173 <main+0x53>
imul   $0x5,-0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x5,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0xc(%rsp),%esi
cmp    $0x5,%eax
jg     1151 <main+0x31>
imul   %eax,%esi
jmp    1160 <main+0x40>
lea    (%rsi,%rsi,4),%ecx
add    $0xfffffffb,%eax
imul   0x10(%rsp),%eax
add    %ecx,%eax
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 5
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %5
br label %21
13: ; preds = %0
%14 = load i32, i32* %4
%15 = mul nsw i32 5, %14
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 5
%18 = load i32, i32* %3
%19 = mul nsw i32 %17, %18
%20 = add nsw i32 %15, %19
store i32 %20, i32* %5
br label %21
21: ; preds = %13, %9
%22 = load i32, i32* %5
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 0
}

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