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

Another Panda's Birthday Present

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 197    Accepted Submission(s): 0


Problem Description
On Panda's Birthday party, he received a strange present from Jason. The present is a black box with 9 dices in it which is used to play a game. The dice in the box is unusual. Instead of the digits, only red or blue is painted on each side of the dice. Before the first round of the game, the box can repaint every side of every dice red or blue with equal probability. Then for each round of the game, the box will roll the 9 dices and tell the player the number of red side facing up, which is the point the player get. Now, Panda has play it for k(0<=k<=3) rounds and he tell you the point he has got for each round. Can you tell him the expected point he can get for next round.
 

Input
The first line of the input is number of test case. Each test case contains k+1 integers, k which is the number of rounds and a1...ak, which are the points Panda has got for the first k rounds.(0¡Üai¡Ü9,0<=k<=3)
 

Output
For each test case, output the expected point panda can get for the third round. Round the answer to the third digit after the decimal point.
 

Sample Input
2 2 2 2 2 4 4
 

Sample Output
2.000 2.571
 

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-11-25 09:04:02, Gzip enabled