F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Piano in Tina Town

Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 114    Accepted Submission(s): 5
Special Judge


Problem 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
 

Hint

In the first test case,Tina has no way to play the pinao.So the answer is 0.
In the second test case,The only way to play the piano is $k_1=1,k_2=1$,So the answer is $cos(0)\times cos(0)=1$
In the third test case,$k_1=1,k_2=2 ~~ or ~~ k_1=2,k_2=1$,so the ans is 0.
Note that please use radians
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-04 20:42:25, Gzip enabled