#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;
scalar_t__ ceilf(float);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, ...);
int main() {
  float v, t, ar, arrival;
  int i, n;
  while ((scanf("%d", &n) != EOF) && (n > 0)) {
    arrival = 1e+10;
    for (i = 0; i < n; i++) {
      scanf("%f %f", &v, &t);
      if ((t > -0.1) && ((ar = 4.5 / v * 3600.0 + t) < arrival))
        arrival = ar;
    }
    printf("%d\n", (int)ceilf(arrival));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
mov    0x2e8b(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x1d(%rbp)
je     1173 <main+0x43>
cmpl   $0x0,-0x1c(%rbp)
setg   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1183 <main+0x53>
jmp    1253 <main+0x123>
movss  0xe75(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1236 <main+0x106>
lea    0xe79(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1223 <main+0xf3>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe33(%rip),%xmm0
divsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe16(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm1
movss  %xmm1,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1223 <main+0xf3>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1228 <main+0xf8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1197 <main+0x67>
movss  -0x14(%rbp),%xmm0
call   1040 <ceilf@plt>
mov    %eax,%esi
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xedb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%rax
je     1257 <main+0x127>
cmpl   $0x0,0xc(%rsp)
jle    1257 <main+0x127>
movss  0xe8c(%rip),%xmm0
lea    0xea8(%rip),%r14
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%rbx
lea    0xe94(%rip),%r13
lea    0xc(%rsp),%rbp
xor    %r12d,%r12d
movss  %xmm0,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd 0xe46(%rip),%xmm0
jbe    11fe <main+0xce>
movss  0x14(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe3a(%rip),%xmm2
divsd  %xmm1,%xmm2
mulsd  0xe36(%rip),%xmm2
addsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    11fe <main+0xce>
movss  %xmm0,0x8(%rsp)
add    $0x1,%r12d
cmp    0xc(%rsp),%r12d
jl     11a0 <main+0x70>
movss  0x8(%rsp),%xmm0
call   1040 <ceilf@plt>
lea    0xe0e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %r12d,%r12d
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2daf(%rip),%rcx
cmp    (%rcx),%rax
je     1257 <main+0x127>
cmpl   $0x0,0xc(%rsp)
movss  0xdb5(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
jg     11a0 <main+0x70>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
br label %8
8: ; preds = %43, %0
%9 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %7
%14 = icmp sgt i32 %13, 0
br label %15
15: ; preds = %12, %8
%16 = phi i1 [ false, %8 ], [ %14, %12 ]
br i1 %16, label %17, label %48
17: ; preds = %15
store float 1.000000e+10, float* %5
store i32 0, i32* %6
br label %18
18: ; preds = %40, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %43
22: ; preds = %18
%23 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%24 = load float, float* %3
%25 = fpext float %24 to double
%26 = fcmp ogt double %25, -1.000000e-01
br i1 %26, label %27, label %39
27: ; preds = %22
%28 = load float, float* %2
%29 = fpext float %28 to double
%30 = fdiv double 4.500000e+00, %29
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = call double @llvm.fmuladd.f64(double %30, double 3.600000e+03, double %32)
%34 = fptrunc double %33 to float
store float %34, float* %4
%35 = load float, float* %5
%36 = fcmp olt float %34, %35
br i1 %36, label %37, label %39
37: ; preds = %27
%38 = load float, float* %4
store float %38, float* %5
br label %39
39: ; preds = %37, %27, %22
br label %40
40: ; preds = %39
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %18
43: ; preds = %18
%44 = load float, float* %5
%45 = call i64 @ceilf(float %44)
%46 = trunc i64 %45 to i32
%47 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %46)
br label %8
48: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %13, label %46
13: ; preds = %0, %33
%14 = phi i32 [ %34, %33 ], [ 0, %0 ]
%15 = phi float [ %35, %33 ], [ 1.000000e+10, %0 ]
%16 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = fcmp ogt double %18, -1.000000e-01
br i1 %19, label %20, label %28
20: ; preds = %13
%21 = load float, float* %1
%22 = fpext float %21 to double
%23 = fdiv double 4.500000e+00, %22
%24 = call double @llvm.fmuladd.f64(double %23, double 3.600000e+03, double %18)
%25 = fptrunc double %24 to float
%26 = fcmp ogt float %15, %25
br i1 %26, label %27, label %28
27: ; preds = %20
br label %28
28: ; preds = %13, %20, %27
%29 = phi float [ %25, %27 ], [ %15, %20 ], [ %15, %13 ]
%30 = add nuw nsw i32 %14, 1
%31 = load i32, i32* %3
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %28, %36
%34 = phi i32 [ %30, %28 ], [ 0, %36 ]
%35 = phi float [ %29, %28 ], [ 1.000000e+10, %36 ]
br label %13
36: ; preds = %28
%37 = call i64 @ceilf(float %29)
%38 = trunc i64 %37 to i32
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%41 = load i64, i64* @EOF
%42 = icmp ne i64 %40, %41
%43 = load i32, i32* %3
%44 = icmp sgt i32 %43, 0
%45 = select i1 %42, i1 %44, i1 false
br i1 %45, label %33, label %46
46: ; preds = %36, %0
ret i32 0
}