|Online Judge||Problem Set||Authors||Online Contests||User|
Panda's Birthday Present
On Panda's Birthday party, he received a strange present from Jason. The present is a black box with 4 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 4 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 two 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.
The first line of the input is number of test case. Each test case contains two integers, pand q, which are the points Panda has got for the first two rounds.(0≤p,q≤4)
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.
2 2 2 4 4
[Submit] [Go Back] [Status] [Discuss]
Home Page Go Back To top
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator