#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 */
double acos(double);
int /*<<< orphan*/ printf(char *, double);
int scanf(char *, double *, double *);
double sin(double);
int main() {
  double n, r, area, degree, red;
  while (scanf("%lf %lf", &r, &n) == 2) {
    degree = 360 / n;
    red = sin(degree * 2 * acos(0.0) / 180);
    area = .5 * n * r * r * red;
    printf("%.3lf\n", area);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    11f1 <main+0xb1>
movsd  0xea4(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe8a(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
call   1040 <acos@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe5c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe3e(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xede(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11d2 <main+0xa2>
lea    0xecb(%rip),%r14
lea    0xebc(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
movsd  0xe88(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
mulsd  0xe7e(%rip),%xmm0
divsd  0xe7e(%rip),%xmm0
call   1040 <sin@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xe73(%rip),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
br label %7
7: ; preds = %10, %0
%8 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %3, double* %2)
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %29
10: ; preds = %7
%11 = load double, double* %2
%12 = fdiv double 3.600000e+02, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = fmul double %13, 2.000000e+00
%15 = call double @acos(double 0.000000e+00)
%16 = fmul double %14, %15
%17 = fdiv double %16, 1.800000e+02
%18 = call double @sin(double %17)
store double %18, double* %6
%19 = load double, double* %2
%20 = fmul double 5.000000e-01, %19
%21 = load double, double* %3
%22 = fmul double %20, %21
%23 = load double, double* %3
%24 = fmul double %22, %23
%25 = load double, double* %6
%26 = fmul double %24, %25
store double %26, double* %4
%27 = load double, double* %4
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %27)
br label %7
29: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %1)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %23
7: ; preds = %0, %7
%8 = load double, double* %1
%9 = fdiv double 3.600000e+02, %8
%10 = fmul double %9, 2.000000e+00
%11 = fmul double %10, 0x3FF921FB54442D18
%12 = fdiv double %11, 1.800000e+02
%13 = call double @sin(double %12)
%14 = load double, double* %1
%15 = fmul double %14, 5.000000e-01
%16 = load double, double* %2
%17 = fmul double %15, %16
%18 = fmul double %16, %17
%19 = fmul double %13, %18
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %19)
%21 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %1)
%22 = icmp eq i32 %21, 2
br i1 %22, label %7, label %23
23: ; preds = %7, %0
ret i32 0
}