#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 main() {
  char ch;
  int i, j, n;
  float sum = 0.0, a;
  scanf("%d ", &n);
  scanf("%c", &ch);
  for (i = 0; i < 12; i++) {
    for (j = 0; j < 12; j++) {
      scanf("%f", &a);
      if (i == n) {
        sum = sum + a;
      }
    }
  }
  if (ch == 'S') {
    printf("%.1f\n", sum);
  } else {
    printf("%.1f\n", sum / 12);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jge    11d0 <main+0xb0>
movl   $0x0,-0x10(%rbp)
cmpl   $0xc,-0x10(%rbp)
jge    11bd <main+0x9d>
lea    0xe87(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11aa <main+0x8a>
movss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11af <main+0x8f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1173 <main+0x53>
jmp    11c2 <main+0xa2>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x42>
movsbl -0x5(%rbp),%eax
cmp    $0x53,%eax
jne    11f3 <main+0xd3>
movss  -0x18(%rbp),%xmm0
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
jmp    1210 <main+0xf0>
movss  -0x18(%rbp),%xmm0
movss  0xe00(%rip),%xmm1
divss  %xmm1,%xmm0
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xed9(%rip),%rdi
xor    %ebp,%ebp
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
lea    0xeb5(%rip),%r14
lea    0x4(%rsp),%rbx
jmp    1206 <main+0xe6>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  0xe87(%rip),%xmm8
movss  0x3c(%rsp),%xmm0
movss  0x38(%rsp),%xmm2
movss  0x34(%rsp),%xmm3
movss  0x30(%rsp),%xmm4
movss  0x2c(%rsp),%xmm5
movss  0x28(%rsp),%xmm6
movss  0x24(%rsp),%xmm7
movss  0x20(%rsp),%xmm1
movss  0x1c(%rsp),%xmm9
movss  0x18(%rsp),%xmm10
movss  0x14(%rsp),%xmm11
movss  0x10(%rsp),%xmm12
addss  %xmm2,%xmm0
addss  %xmm3,%xmm0
addss  %xmm4,%xmm0
addss  %xmm5,%xmm0
addss  %xmm6,%xmm0
addss  %xmm7,%xmm0
addss  %xmm1,%xmm0
addss  %xmm9,%xmm0
addss  %xmm10,%xmm0
addss  %xmm11,%xmm0
addss  %xmm12,%xmm0
addss  %xmm8,%xmm0
add    $0x1,%ebp
cmp    $0xc,%ebp
je     143f <main+0x31f>
movss  %xmm0,0x3c(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     1230 <main+0x110>
movss  0xdd9(%rip),%xmm0
jmp    1236 <main+0x116>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x38(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     1260 <main+0x140>
movss  0xda9(%rip),%xmm0
jmp    1266 <main+0x146>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x34(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     1290 <main+0x170>
movss  0xd79(%rip),%xmm0
jmp    1296 <main+0x176>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     12c0 <main+0x1a0>
movss  0xd49(%rip),%xmm0
jmp    12c6 <main+0x1a6>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     12f0 <main+0x1d0>
movss  0xd19(%rip),%xmm0
jmp    12f6 <main+0x1d6>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     1320 <main+0x200>
movss  0xce9(%rip),%xmm0
jmp    1326 <main+0x206>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     1350 <main+0x230>
movss  0xcb9(%rip),%xmm0
jmp    1356 <main+0x236>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     1380 <main+0x260>
movss  0xc89(%rip),%xmm0
jmp    1386 <main+0x266>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     13b0 <main+0x290>
movss  0xc59(%rip),%xmm0
jmp    13b6 <main+0x296>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     13e0 <main+0x2c0>
movss  0xc29(%rip),%xmm0
jmp    13e6 <main+0x2c6>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
je     1410 <main+0x2f0>
movss  0xbf9(%rip),%xmm0
jmp    1416 <main+0x2f6>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0x8(%rsp),%ebp
jne    1170 <main+0x50>
movss  0x4(%rsp),%xmm8
jmp    1179 <main+0x59>
cmpb   $0x53,0xf(%rsp)
je     144e <main+0x32e>
divss  0xbb6(%rip),%xmm0
lea    0xbbd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %6
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i32 0, i32* %3
br label %10
10: ; preds = %31, %0
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 12
br i1 %12, label %13, label %34
13: ; preds = %10
store i32 0, i32* %4
br label %14
14: ; preds = %27, %13
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 12
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %7)
%19 = load i32, i32* %3
%20 = load i32, i32* %5
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %17
%23 = load float, float* %6
%24 = load float, float* %7
%25 = fadd float %23, %24
store float %25, float* %6
br label %26
26: ; preds = %22, %17
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %14
30: ; preds = %14
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %10
34: ; preds = %10
%35 = load i8, i8* %2
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 83
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load float, float* %6
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float %39)
br label %45
41: ; preds = %34
%42 = load float, float* %6
%43 = fdiv float %42, 1.200000e+01
%44 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float %43)
br label %45
45: ; preds = %41, %38
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %0, %8
%9 = phi float [ 0.000000e+00, %0 ], [ %82, %8 ]
%10 = phi i32 [ 0, %0 ], [ %83, %8 ]
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%12 = load i32, i32* %2
%13 = icmp eq i32 %10, %12
%14 = load float, float* %3
%15 = select i1 %13, float %14, float -0.000000e+00
%16 = fadd float %9, %15
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%18 = load i32, i32* %2
%19 = icmp eq i32 %10, %18
%20 = load float, float* %3
%21 = select i1 %19, float %20, float -0.000000e+00
%22 = fadd float %16, %21
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%24 = load i32, i32* %2
%25 = icmp eq i32 %10, %24
%26 = load float, float* %3
%27 = select i1 %25, float %26, float -0.000000e+00
%28 = fadd float %22, %27
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%30 = load i32, i32* %2
%31 = icmp eq i32 %10, %30
%32 = load float, float* %3
%33 = select i1 %31, float %32, float -0.000000e+00
%34 = fadd float %28, %33
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%36 = load i32, i32* %2
%37 = icmp eq i32 %10, %36
%38 = load float, float* %3
%39 = select i1 %37, float %38, float -0.000000e+00
%40 = fadd float %34, %39
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%42 = load i32, i32* %2
%43 = icmp eq i32 %10, %42
%44 = load float, float* %3
%45 = select i1 %43, float %44, float -0.000000e+00
%46 = fadd float %40, %45
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%48 = load i32, i32* %2
%49 = icmp eq i32 %10, %48
%50 = load float, float* %3
%51 = select i1 %49, float %50, float -0.000000e+00
%52 = fadd float %46, %51
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%54 = load i32, i32* %2
%55 = icmp eq i32 %10, %54
%56 = load float, float* %3
%57 = select i1 %55, float %56, float -0.000000e+00
%58 = fadd float %52, %57
%59 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%60 = load i32, i32* %2
%61 = icmp eq i32 %10, %60
%62 = load float, float* %3
%63 = select i1 %61, float %62, float -0.000000e+00
%64 = fadd float %58, %63
%65 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%66 = load i32, i32* %2
%67 = icmp eq i32 %10, %66
%68 = load float, float* %3
%69 = select i1 %67, float %68, float -0.000000e+00
%70 = fadd float %64, %69
%71 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%72 = load i32, i32* %2
%73 = icmp eq i32 %10, %72
%74 = load float, float* %3
%75 = select i1 %73, float %74, float -0.000000e+00
%76 = fadd float %70, %75
%77 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%78 = load i32, i32* %2
%79 = icmp eq i32 %10, %78
%80 = load float, float* %3
%81 = select i1 %79, float %80, float -0.000000e+00
%82 = fadd float %76, %81
%83 = add nuw nsw i32 %10, 1
%84 = icmp eq i32 %83, 12
br i1 %84, label %85, label %8
85: ; preds = %8
%86 = load i8, i8* %1
%87 = icmp eq i8 %86, 83
%88 = fdiv float %82, 1.200000e+01
%89 = select i1 %87, float %82, float %88
%90 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float %89)
ret i32 0
}