01 | #include<stdio.h> |
02 | int main() |
03 | { |
04 | int i,j,flag; |
05 | double x,n,y,a,b; |
06 | while ( scanf ( "%lf %lf" ,&x,&n)!=EOF ) |
07 | { |
08 | y=1; |
09 | flag=1; |
10 | for (i=1; i<=n; i++) |
11 | { |
12 | a=1; |
13 | b=1; |
14 | for (j=1; j<=2*i; j++) |
15 | { |
16 | a*=x; |
17 | b*=j; |
18 | } |
19 | flag=-flag; |
20 | y+=flag*1.0*a*1.0/b; |
21 | } |
22 | printf ( "%.4lf\n" ,y); |
23 | } |
24 | return 0; |
25 | } |