#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*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  freopen("finaltest.in", "r", stdin);
  freopen("finaltest.out", "w+", stdout);
  int m, i, score, e;
  double have = 0, money;
  char name[999];
  scanf("%d", &m);
  for (i = 0; i < m; i++) {
    scanf("%s %lf %d", name, &money, &score);
    if (score >= 90)
      have += money;
  }
  scanf("%s", name);
  scanf("%i", &e);
  printf("%.2lf\n", have);
  int a = have / e;
  if (a)
    printf("%d", a);
  else
    puts("ni wei he na me diao!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
lea    0xe97(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <freopen@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edx
lea    0xe8a(%rip),%rdi
lea    0xe91(%rip),%rsi
call   1050 <freopen@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xe87(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1207 <main+0xc7>
lea    -0x420(%rbp),%rsi
lea    0xe54(%rip),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x5a,-0x1c(%rbp)
jl     11f4 <main+0xb4>
movsd  -0x30(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11f9 <main+0xb9>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b2 <main+0x72>
lea    -0x420(%rbp),%rsi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe0a(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cvttsd2si -0x28(%rbp),%esi
lea    0xdf6(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x424(%rbp)
cmpl   $0x0,-0x424(%rbp)
je     127b <main+0x13b>
mov    -0x424(%rbp),%esi
lea    0xdb6(%rip),%rdi
call   1040 <printf@plt>
jmp    1287 <main+0x147>
lea    0xdb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x410,%rsp
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
lea    0xea9(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <freopen@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edx
lea    0xe9c(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1050 <freopen@plt>
lea    0xea1(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1211 <main+0xd1>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
lea    0xe77(%rip),%r14
lea    0x20(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x14(%rsp),%rbx
xor    %ebp,%ebp
jmp    11ef <main+0xaf>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0xe28(%rip),%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jge    121a <main+0xda>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x5a,0x14(%rsp)
jl     11d0 <main+0x90>
movsd  0x18(%rsp),%xmm0
jmp    11d8 <main+0x98>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
lea    0xe11(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe01(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cvttsd2si (%rsp),%esi
lea    0xdec(%rip),%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%esi
test   %esi,%esi
je     1279 <main+0x139>
lea    0xdbd(%rip),%rdi
call   1040 <printf@plt>
jmp    1285 <main+0x145>
lea    0xdbf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"finaltest.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [14 x i8] c"finaltest.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [10 x i8] c"%s %lf %d\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [3 x i8] c"%i\00"
@.str.8 = [7 x i8] c"%.2lf\0A\00"
@.str.9 = [22 x i8] c"ni wei he na me diao!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca [999 x i8]
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* @stdin
%15 = call i32 @freopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @stdout
%17 = call i32 @freopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %16)
store double 0.000000e+00, double* %10
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
store i32 0, i32* %7
br label %19
19: ; preds = %33, %2
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %36
23: ; preds = %19
%24 = getelementptr inbounds [999 x i8], [999 x i8]* %12, i64 0, i64 0
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %24, double* %11, i32* %8)
%26 = load i32, i32* %8
%27 = icmp sge i32 %26, 90
br i1 %27, label %28, label %32
28: ; preds = %23
%29 = load double, double* %11
%30 = load double, double* %10
%31 = fadd double %30, %29
store double %31, double* %10
br label %32
32: ; preds = %28, %23
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %19
36: ; preds = %19
%37 = getelementptr inbounds [999 x i8], [999 x i8]* %12, i64 0, i64 0
%38 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %37)
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %9)
%40 = load double, double* %10
%41 = fptosi double %40 to i32
%42 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %41)
%43 = load double, double* %10
%44 = load i32, i32* %9
%45 = sitofp i32 %44 to double
%46 = fdiv double %43, %45
%47 = fptosi double %46 to i32
store i32 %47, i32* %13
%48 = load i32, i32* %13
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %36
%51 = load i32, i32* %13
%52 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %51)
br label %55
53: ; preds = %36
%54 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
br label %55
55: ; preds = %53, %50
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"finaltest.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [14 x i8] c"finaltest.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [10 x i8] c"%s %lf %d\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [3 x i8] c"%i\00"
@.str.8 = [7 x i8] c"%.2lf\0A\00"
@.str.9 = [22 x i8] c"ni wei he na me diao!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca [999 x i8]
%8 = load i32, i32* @stdin
%9 = tail call i32 @freopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stdout
%11 = tail call i32 @freopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = bitcast i32* %3 to i8*
%13 = bitcast i32* %4 to i8*
%14 = bitcast i32* %5 to i8*
%15 = bitcast double* %6 to i8*
%16 = getelementptr inbounds [999 x i8], [999 x i8]* %7, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %32
20: ; preds = %2, %20
%21 = phi i32 [ %29, %20 ], [ 0, %2 ]
%22 = phi double [ %28, %20 ], [ 0.000000e+00, %2 ]
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %16, double* %6, i32* %4)
%24 = load i32, i32* %4
%25 = icmp sgt i32 %24, 89
%26 = load double, double* %6
%27 = select i1 %25, double %26, double -0.000000e+00
%28 = fadd double %22, %27
%29 = add nuw nsw i32 %21, 1
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %20, label %32
32: ; preds = %20, %2
%33 = phi double [ 0.000000e+00, %2 ], [ %28, %20 ]
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %16)
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %5)
%36 = fptosi double %33 to i32
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %5
%39 = sitofp i32 %38 to double
%40 = fdiv double %33, %39
%41 = fptosi double %40 to i32
%42 = icmp eq i32 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %32
%44 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %41)
br label %47
45: ; preds = %32
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
ret i32 0
}