#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 log10(double);
double pow(int, double);
int /*<<< orphan*/ printf(char *, double);
int scanf(char *, double *, double *);
int main() {
  double p, n, k;
  while (scanf("%lf %lf", &n, &p) == 2) {
    k = pow(10, log10(p) / n);
    printf("%.0lf\n", k);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11a0 <main+0x60>
movsd  -0x10(%rbp),%xmm0
call   1060 <log10@plt>
divsd  -0x18(%rbp),%xmm0
mov    $0xa,%edi
call   1050 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeae(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11b6 <main+0x76>
lea    0xe9b(%rip),%r14
lea    0xe8c(%rip),%r15
lea    0x8(%rsp),%r12
lea    0x10(%rsp),%rbx
xchg   %ax,%ax
movsd  0x10(%rsp),%xmm0
call   1060 <log10@plt>
divsd  0x8(%rsp),%xmm0
mov    $0xa,%edi
call   1050 <pow@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1180 <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"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
br label %5
5: ; preds = %8, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %3, double* %2)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load double, double* %2
%10 = call double @log10(double %9)
%11 = load double, double* %3
%12 = fdiv double %10, %11
%13 = call double @pow(i32 10, double %12)
store double %13, double* %4
%14 = load double, double* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %14)
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.0lf\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 %16
7: ; preds = %0, %7
%8 = load double, double* %1
%9 = call double @log10(double %8)
%10 = load double, double* %2
%11 = fdiv double %9, %10
%12 = call double @pow(i32 10, double %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %1)
%15 = icmp eq i32 %14, 2
br i1 %15, label %7, label %16
16: ; preds = %7, %0
ret i32 0
}