#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 *, float);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main(int argc, char *argv[]) {
  int a, i, c = 0, m = 0;
  float n = 0.0, tol = 0.0;
  scanf("%i", &a);
  for (i = 0; i < a; i++) {
    scanf("%i%f", &m, &n);
    tol += m * n;
    c += m;
  }
  printf("%.2f", tol / c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
lea    0xea5(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c2 <main+0xa2>
lea    0xe83(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cvtsi2ssl -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x28(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116d <main+0x4d>
movss  -0x28(%rbp),%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xec2(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11b8 <main+0x98>
xorps  %xmm0,%xmm0
lea    0xea8(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%r12
xor    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movss  %xmm0,0xc(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
mov    0x4(%rsp),%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
mulss  (%rsp),%xmm1
addss  %xmm1,%xmm0
add    %eax,%ebp
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
jl     1170 <main+0x50>
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
divss  %xmm1,%xmm0
jmp    11c0 <main+0xa0>
movss  0xe40(%rip),%xmm0
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [5 x i8] c"%i%f\00"
@.str.2 = [5 x i8] c"%.2f\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 float
%11 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
store float 0.000000e+00, float* %10
store float 0.000000e+00, float* %11
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %7
br label %13
13: ; preds = %27, %2
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %9, float* %10)
%19 = load i32, i32* %9
%20 = sitofp i32 %19 to float
%21 = load float, float* %10
%22 = load float, float* %11
%23 = call float @llvm.fmuladd.f32(float %20, float %21, float %22)
store float %23, float* %11
%24 = load i32, i32* %9
%25 = load i32, i32* %8
%26 = add nsw i32 %25, %24
store i32 %26, i32* %8
br label %27
27: ; preds = %17
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %13
30: ; preds = %13
%31 = load float, float* %11
%32 = load i32, i32* %8
%33 = sitofp i32 %32 to float
%34 = fdiv float %31, %33
%35 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), float %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [5 x i8] c"%i%f\00"
@.str.2 = [5 x i8] c"%.2f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %5
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %28
12: ; preds = %2, %12
%13 = phi float [ %20, %12 ], [ 0.000000e+00, %2 ]
%14 = phi i32 [ %21, %12 ], [ 0, %2 ]
%15 = phi i32 [ %22, %12 ], [ 0, %2 ]
%16 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %4, float* %5)
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to float
%19 = load float, float* %5
%20 = call float @llvm.fmuladd.f32(float %18, float %19, float %13)
%21 = add nsw i32 %17, %14
%22 = add nuw nsw i32 %15, 1
%23 = load i32, i32* %3
%24 = icmp slt i32 %22, %23
br i1 %24, label %12, label %25
25: ; preds = %12
%26 = sitofp i32 %21 to float
%27 = fdiv float %20, %26
br label %28
28: ; preds = %25, %2
%29 = phi float [ %27, %25 ], [ 0x7FF8000000000000, %2 ]
%30 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), float %29)
ret i32 0
}