#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() {
  int da, de, ma, me, ya, ye;
  scanf("%d %d %d", &da, &ma, &ya);
  scanf("%d %d %d", &de, &me, &ye);
  int fine = 0;
  if (ya > ye)
    fine = 10000;
  else if (ya == ye && ma > me)
    fine = 500 * (ma - me);
  else if (ya == ye && ma == me && da > de)
    fine = 15 * (da - de);
  printf("%d", fine);
  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    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    117e <main+0x5e>
movl   $0x2710,-0x20(%rbp)
jmp    11e4 <main+0xc4>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    11aa <main+0x8a>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11aa <main+0x8a>
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
imul   $0x1f4,%eax,%eax
mov    %eax,-0x20(%rbp)
jmp    11df <main+0xbf>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    11da <main+0xba>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11da <main+0xba>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11da <main+0xba>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
imul   $0xf,%eax,%eax
mov    %eax,-0x20(%rbp)
jmp    11df <main+0xbf>
jmp    11e4 <main+0xc4>
mov    -0x20(%rbp),%esi
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rbx
lea    0x1c(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
mov    $0x2710,%esi
cmp    %ecx,%eax
jg     1195 <main+0x75>
xor    %esi,%esi
cmp    %ecx,%eax
jne    1195 <main+0x75>
mov    0x14(%rsp),%eax
sub    0x10(%rsp),%eax
jle    1183 <main+0x63>
imul   $0x1f4,%eax,%esi
jmp    1195 <main+0x75>
jne    1195 <main+0x75>
mov    0x1c(%rsp),%eax
sub    0x18(%rsp),%eax
jle    1195 <main+0x75>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %3, i32* %5)
%14 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %4, i32* %6)
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = icmp sgt i32 %15, %16
br i1 %17, label %36, label %18
18: ; preds = %0
%19 = icmp eq i32 %15, %16
br i1 %19, label %20, label %36
20: ; preds = %18
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = sub nsw i32 %21, %22
%26 = mul nsw i32 %25, 500
br label %36
27: ; preds = %20
%28 = icmp eq i32 %21, %22
br i1 %28, label %29, label %36
29: ; preds = %27
%30 = load i32, i32* %1
%31 = load i32, i32* %2
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = sub nsw i32 %30, %31
%35 = mul nsw i32 %34, 15
br label %36
36: ; preds = %18, %0, %24, %33, %29, %27
%37 = phi i32 [ %26, %24 ], [ %35, %33 ], [ 0, %29 ], [ 0, %27 ], [ 10000, %0 ], [ 0, %18 ]
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %37)
ret i32 0
}