Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 2957
Concise mathematics problem

Time Limit: 2 Seconds      Memory Limit: 65536 KB

F0(x) = sin(x) / x
F1(x)= (sin(x) - x * cos(x)) / x / x
Fn+1(x) = (2 * n + 1) * Fn(x) / x - Fn-1(x)
You are to calculate Fn(x) for given n and x.

Input

There are multiple test cases. Each test case consists of one line containing two numbers. The first number specifies n, a non-negative integer not more than 20. The second number specifies x, a positive real number between 0.10 and 20.00.

Output

For each test case, output Fn(x), using scientific expression with four valid digits as the sample output. It is guaranteed that the exponentials of the answers are all negative.

Sample Input

3 10.0
5 1.00
8 0.10

Sample Output

-3.950*10^-2
9.256*10^-5
2.901*10^-16


Author: HE, Rongqiang
Source: ZOJ Monthly, May 2008
Submit    Status