#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 *, double);
int scanf(char *, ...);
int main() {
  int n, i;
  double l, w, h, vol, down;
  while (scanf("%d", &n) == 1) {
    if (n == 0)
      break;
    double max = -1.0;
    vol = 0;
    for (i = 1; i <= n; i++) {
      scanf("%lf %lf %lf", &l, &w, &h);
      down = 9.8 - (9.8 / (2 * h));
      if (down > max) {
        max = down;
        vol = l * w * h;
      }
      if (down == max) {
        if (l * w * h > vol)
          vol = l * w * h;
      }
    }
    printf("%.0lf\n", vol);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1265 <main+0x145>
cmpl   $0x0,-0x8(%rbp)
jne    1159 <main+0x39>
jmp    1265 <main+0x145>
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     124f <main+0x12f>
lea    0xe93(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  0xe6d(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe58(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xe4c(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    11f3 <main+0xd3>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jne    123c <main+0x11c>
jp     123c <main+0x11c>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1237 <main+0x117>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    123c <main+0x11c>
jmp    1241 <main+0x121>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1175 <main+0x55>
movsd  -0x30(%rbp),%xmm0
lea    0xdcc(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1272 <main+0x152>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     1272 <main+0x152>
lea    0x4(%rsp),%r12
lea    0xeb1(%rip),%r13
lea    0x18(%rsp),%rbx
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %eax,%eax
jle    1240 <main+0x120>
xorps  %xmm1,%xmm1
xor    %r15d,%r15d
movsd  0xe6a(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
movaps %xmm2,0x20(%rsp)
movaps %xmm1,0x30(%rsp)
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm1
movsd  0xe29(%rip),%xmm3
movapd %xmm3,%xmm2
divsd  %xmm1,%xmm2
movapd %xmm3,%xmm1
subsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
movapd 0x20(%rsp),%xmm4
maxsd  %xmm4,%xmm2
cmpltsd %xmm1,%xmm4
movapd %xmm4,%xmm3
andpd  %xmm0,%xmm3
andnpd 0x30(%rsp),%xmm4
orpd   %xmm3,%xmm4
cmpeqsd %xmm2,%xmm1
maxsd  %xmm4,%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm4,%xmm1
orpd   %xmm1,%xmm0
add    $0x1,%r15d
movapd %xmm0,%xmm1
cmp    0x4(%rsp),%r15d
jl     11a0 <main+0x80>
jmp    1244 <main+0x124>
xchg   %ax,%ax
xorpd  %xmm0,%xmm0
lea    0xdd4(%rip),%rdi
call   1030 <printf@plt>
lea    0xdb9(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1272 <main+0x152>
mov    0x4(%rsp),%eax
test   %eax,%eax
jne    1180 <main+0x60>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %1
br label %10
10: ; preds = %61, %0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %64
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
br label %64
17: ; preds = %13
store double -1.000000e+00, double* %9
store double 0.000000e+00, double* %7
store i32 1, i32* %3
br label %18
18: ; preds = %58, %17
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %61
22: ; preds = %18
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %4, double* %5, double* %6)
%24 = load double, double* %6
%25 = fmul double 2.000000e+00, %24
%26 = fdiv double 9.800000e+00, %25
%27 = fsub double 9.800000e+00, %26
store double %27, double* %8
%28 = load double, double* %8
%29 = load double, double* %9
%30 = fcmp ogt double %28, %29
br i1 %30, label %31, label %38
31: ; preds = %22
%32 = load double, double* %8
store double %32, double* %9
%33 = load double, double* %4
%34 = load double, double* %5
%35 = fmul double %33, %34
%36 = load double, double* %6
%37 = fmul double %35, %36
store double %37, double* %7
br label %38
38: ; preds = %31, %22
%39 = load double, double* %8
%40 = load double, double* %9
%41 = fcmp oeq double %39, %40
br i1 %41, label %42, label %57
42: ; preds = %38
%43 = load double, double* %4
%44 = load double, double* %5
%45 = fmul double %43, %44
%46 = load double, double* %6
%47 = fmul double %45, %46
%48 = load double, double* %7
%49 = fcmp ogt double %47, %48
br i1 %49, label %50, label %56
50: ; preds = %42
%51 = load double, double* %4
%52 = load double, double* %5
%53 = fmul double %51, %52
%54 = load double, double* %6
%55 = fmul double %53, %54
store double %55, double* %7
br label %56
56: ; preds = %50, %42
br label %57
57: ; preds = %56, %38
br label %58
58: ; preds = %57
%59 = load i32, i32* %3
%60 = add nsw i32 %59, 1
store i32 %60, i32* %3
br label %18
61: ; preds = %18
%62 = load double, double* %7
%63 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %62)
br label %10
64: ; preds = %16, %10
ret i32 0
}

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