Piano in Tina Town

Time Limit: 1500ms
Memory Limit: 131072KB
This problem will be judged on HDU. Original ID: 5395
64-bit integer IO format: %I64d      Java class name: Main
Special Judge

Description

Tina Town is a friendly place. People there care about each other.<br>
One day, Tina was playing the piano. The song that she was going to play consisted of $m$ notes, and the initial stamina of her is $n$. She would spend $k_i$ points stamina on the $i$-th note. Tina was a hardworking girl and she would spend all of her stamina on playing the piano.<br>
After playing a song, she would get $ cos(k_{1}X)cos(k_{2}X) \cdot \cdot \cdot cos(k_{m}X) $ points of happiness.<br>
Of course Tina knew she had many ways to spend all of her $n$ points of stamina to play $m$ notes. She would like to know the sum of happiness gained by all ways of playing. <br>

Input

The first line of input contains an integer $T$, representing the number of cases.

For each test case,
the first line contains 2 integers and a real number $m$,$n$,$X$, according to the text.
$1 \leq T \leq 10,1 \leq m \leq 30,1 \leq n \leq {10}^{9},0 \leq X \leq 10$

Output

For each test case, output an one-digit decimal representing the answer. <br>
Your answer will be judged correct if it has a difference with standard answer at most 1%.

Sample Input

3
3 1 0
2 2 0
2 3 3.1415926

Sample Output

0.0
1.0
0.0

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .