#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 acos(double);
double cos(int);
int /*<<< orphan*/ printf(char *, int, double, double);
int scanf(char *, int *, double *);
double sin(int);
double sqrt(int);
int main() {
  int n, i = 1;
  double area, r, o_r, circle, degree, area_s, area_c, area_o;
  while (scanf("%d %lf", &n, &area) == 2) {
    if (n < 3)
      break;
    else {
      degree = sin(2 * 2 * acos(0.0) / n);
      r = sqrt((2 * area) / (n * degree));
      area_c = 2 * acos(0.0) * r * r;
      area_s = area_c - area;
      o_r = r * cos(2 * acos(0.0) / n);
      area_o = area - 2 * acos(0.0) * o_r * o_r;
      printf("Case %d: %.5lf %.5lf\n", i, area_s, area_o);
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xe8b(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    12b7 <main+0x157>
cmpl   $0x3,-0x8(%rbp)
jge    11a2 <main+0x42>
jmp    12b7 <main+0x157>
xorps  %xmm0,%xmm0
call   1040 <acos@plt>
shl    $0x2,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
call   1050 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe3b(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1080 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
call   1040 <acos@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
call   1040 <acos@plt>
shl    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
call   1040 <acos@plt>
movsd  -0x58(%rbp),%xmm1
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0xc(%rbp),%esi
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
lea    0xd6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x16>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
lea    0xe8c(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x18(%rsp),%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    12b7 <main+0x157>
cmpl   $0x3,0xc(%rsp)
jl     12b7 <main+0x157>
mov    $0x1,%ebx
lea    0xe64(%rip),%r14
lea    0xe56(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x18(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorpd  %xmm0,%xmm0
call   1040 <acos@plt>
shl    $0x2,%eax
cltd
idivl  0xc(%rsp)
mov    %eax,%edi
call   1050 <sin@plt>
movsd  0x18(%rsp),%xmm1
addsd  %xmm1,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sdl 0xc(%rsp),%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1080 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
call   1040 <acos@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
subsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
xorpd  %xmm0,%xmm0
call   1040 <acos@plt>
add    %eax,%eax
cltd
idivl  0xc(%rsp)
mov    %eax,%edi
call   1070 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
call   1040 <acos@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
mov    %r14,%rdi
mov    %ebx,%esi
movsd  0x28(%rsp),%xmm0
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    12b7 <main+0x157>
add    $0x1,%ebx
cmpl   $0x2,0xc(%rsp)
jg     11c0 <main+0x60>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [22 x i8] c"Case %d: %.5lf %.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %1
store i32 1, i32* %3
br label %12
12: ; preds = %64, %0
%13 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, double* %4)
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %67
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %15
br label %67
19: ; preds = %15
%20 = call i32 @acos(double 0.000000e+00)
%21 = mul nsw i32 4, %20
%22 = load i32, i32* %2
%23 = sdiv i32 %21, %22
%24 = call double @sin(i32 %23)
store double %24, double* %8
%25 = load double, double* %4
%26 = fmul double 2.000000e+00, %25
%27 = load i32, i32* %2
%28 = sitofp i32 %27 to double
%29 = load double, double* %8
%30 = fmul double %28, %29
%31 = fdiv double %26, %30
%32 = fptosi double %31 to i32
%33 = call double @sqrt(i32 %32)
store double %33, double* %5
%34 = call i32 @acos(double 0.000000e+00)
%35 = mul nsw i32 2, %34
%36 = sitofp i32 %35 to double
%37 = load double, double* %5
%38 = fmul double %36, %37
%39 = load double, double* %5
%40 = fmul double %38, %39
store double %40, double* %10
%41 = load double, double* %10
%42 = load double, double* %4
%43 = fsub double %41, %42
store double %43, double* %9
%44 = load double, double* %5
%45 = call i32 @acos(double 0.000000e+00)
%46 = mul nsw i32 2, %45
%47 = load i32, i32* %2
%48 = sdiv i32 %46, %47
%49 = call double @cos(i32 %48)
%50 = fmul double %44, %49
store double %50, double* %6
%51 = load double, double* %4
%52 = call i32 @acos(double 0.000000e+00)
%53 = mul nsw i32 2, %52
%54 = sitofp i32 %53 to double
%55 = load double, double* %6
%56 = fmul double %54, %55
%57 = load double, double* %6
%58 = fneg double %56
%59 = call double @llvm.fmuladd.f64(double %58, double %57, double %51)
store double %59, double* %11
%60 = load i32, i32* %3
%61 = load double, double* %9
%62 = load double, double* %11
%63 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %60, double %61, double %62)
br label %64
64: ; preds = %19
%65 = load i32, i32* %3
%66 = add nsw i32 %65, 1
store i32 %66, i32* %3
br label %12
67: ; preds = %18, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [22 x i8] c"Case %d: %.5lf %.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2)
%6 = icmp ne i32 %5, 2
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 3
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %52, label %10
10: ; preds = %0, %10
%11 = phi i32 [ %46, %10 ], [ 1, %0 ]
%12 = call i32 @acos(double 0.000000e+00)
%13 = shl nsw i32 %12, 2
%14 = load i32, i32* %1
%15 = sdiv i32 %13, %14
%16 = call double @sin(i32 %15)
%17 = load double, double* %2
%18 = fmul double %17, 2.000000e+00
%19 = load i32, i32* %1
%20 = sitofp i32 %19 to double
%21 = fmul double %16, %20
%22 = fdiv double %18, %21
%23 = fptosi double %22 to i32
%24 = call double @sqrt(i32 %23)
%25 = call i32 @acos(double 0.000000e+00)
%26 = shl nsw i32 %25, 1
%27 = sitofp i32 %26 to double
%28 = fmul double %24, %27
%29 = fmul double %24, %28
%30 = load double, double* %2
%31 = fsub double %29, %30
%32 = call i32 @acos(double 0.000000e+00)
%33 = shl nsw i32 %32, 1
%34 = load i32, i32* %1
%35 = sdiv i32 %33, %34
%36 = call double @cos(i32 %35)
%37 = fmul double %24, %36
%38 = load double, double* %2
%39 = call i32 @acos(double 0.000000e+00)
%40 = shl nsw i32 %39, 1
%41 = sitofp i32 %40 to double
%42 = fneg double %37
%43 = fmul double %42, %41
%44 = call double @llvm.fmuladd.f64(double %43, double %37, double %38)
%45 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %11, double %31, double %44)
%46 = add nuw nsw i32 %11, 1
%47 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2)
%48 = icmp ne i32 %47, 2
%49 = load i32, i32* %1
%50 = icmp slt i32 %49, 3
%51 = select i1 %48, i1 true, i1 %50
br i1 %51, label %52, label %10
52: ; preds = %10, %0
ret i32 0
}