#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 /*<<< orphan*/ scanf(char *, ...);
int main() {
  int j = 0, i = 0, terget;
  double a, total = 0;
  char word[2];
  scanf("%d", &terget);
  scanf(" %s", &word);
  for (i = 0; i < 12; i++) {
    for (j = 0; j < 12; j++) {
      if (i == terget) {
        scanf("%lf", &a);
        total += a;
      } else {
        scanf("%lf", &a);
      }
    }
  }
  if (word[0] == 'S') {
    printf("%.1lf\n", total);
  } else {
    printf("%.1lf\n", total / 12);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xead(%rip),%rdi
lea    -0x22(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jge    11f5 <main+0xd5>
movl   $0x0,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jge    11e2 <main+0xc2>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11bd <main+0x9d>
lea    0xe71(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11cf <main+0xaf>
lea    0xe4b(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    11d4 <main+0xb4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1181 <main+0x61>
jmp    11e7 <main+0xc7>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <main+0x50>
movsbl -0x22(%rbp),%eax
cmp    $0x53,%eax
jne    1218 <main+0xf8>
movsd  -0x20(%rbp),%xmm0
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
jmp    1235 <main+0x115>
movsd  -0x20(%rbp),%xmm0
movsd  0xddb(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xde3(%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   %rbx
sub    $0x78,%rsp
lea    0xedf(%rip),%rdi
xor    %ebp,%ebp
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
lea    0x16(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xorpd  %xmm0,%xmm0
lea    0xeba(%rip),%r14
lea    0x8(%rsp),%r15
jmp    1206 <main+0xe6>
nopw   0x0(%rax,%rax,1)
movsd  0xe87(%rip),%xmm8
movsd  0x70(%rsp),%xmm0
movsd  0x68(%rsp),%xmm2
movsd  0x60(%rsp),%xmm3
movsd  0x58(%rsp),%xmm4
movsd  0x50(%rsp),%xmm5
movsd  0x48(%rsp),%xmm6
movsd  0x40(%rsp),%xmm7
movsd  0x38(%rsp),%xmm1
movsd  0x30(%rsp),%xmm9
movsd  0x28(%rsp),%xmm10
movsd  0x20(%rsp),%xmm11
movsd  0x18(%rsp),%xmm12
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm7,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm9,%xmm0
addsd  %xmm10,%xmm0
addsd  %xmm11,%xmm0
addsd  %xmm12,%xmm0
addsd  %xmm8,%xmm0
add    $0x1,%ebp
cmp    $0xc,%ebp
je     1441 <main+0x321>
movsd  %xmm0,0x70(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     1230 <main+0x110>
movsd  0xdd7(%rip),%xmm0
jmp    1236 <main+0x116>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     1260 <main+0x140>
movsd  0xda7(%rip),%xmm0
jmp    1266 <main+0x146>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     1290 <main+0x170>
movsd  0xd77(%rip),%xmm0
jmp    1296 <main+0x176>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     12c0 <main+0x1a0>
movsd  0xd47(%rip),%xmm0
jmp    12c6 <main+0x1a6>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     12f0 <main+0x1d0>
movsd  0xd17(%rip),%xmm0
jmp    12f6 <main+0x1d6>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     1320 <main+0x200>
movsd  0xce7(%rip),%xmm0
jmp    1326 <main+0x206>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     1350 <main+0x230>
movsd  0xcb7(%rip),%xmm0
jmp    1356 <main+0x236>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     1380 <main+0x260>
movsd  0xc87(%rip),%xmm0
jmp    1386 <main+0x266>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     13b0 <main+0x290>
movsd  0xc57(%rip),%xmm0
jmp    13b6 <main+0x296>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     13e0 <main+0x2c0>
movsd  0xc27(%rip),%xmm0
jmp    13e6 <main+0x2c6>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
je     1410 <main+0x2f0>
movsd  0xbf7(%rip),%xmm0
jmp    1416 <main+0x2f6>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebx,%ebp
jne    1170 <main+0x50>
movsd  0x8(%rsp),%xmm8
jmp    1179 <main+0x59>
cmpb   $0x53,0x16(%rsp)
je     1450 <main+0x330>
divsd  0xbb8(%rip),%xmm0
lea    0xbc4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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