User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Community Introductions section within the Coffee House category of DaniWeb, a massive community of 374,193 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,555 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Community Introductions advertiser:
Views: 338 | Replies: 7 | Solved
Reply
Join Date: May 2008
Posts: 14
Reputation: usmanabb is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
usmanabb usmanabb is offline Offline
Newbie Poster

I need Help..plz Solve this problem!!!

  #1  
May 10th, 2008
Recently, there was an international volleyball championship. Speaking of volleyball, we are interested in the probability of winning of one or another team, if we know some information about the teams. Here are the rules of the game and the necessary information:

the match is played by two teams: A and B;

the first team to win K games in a match, wins the match;

each game consists of rounds; each round is won by one of the teams, and the team adds one point to its score for the current game;

the first team to win L points in a game, wins the game;

if team A serves the ball in a round, it has Pa% chance to win the round (and (100-Pa)% to loose it);

if team B serves the ball in a round, it has Pb% chance to win the round (and (100-Pb)% to loose it);

if a round is not the first in a game, the ball in the round is served by the team that won the last round;

if a game is not the first in a match, the ball in the first round of the game is served by the team that did not served the ball in the first round of the previous game;

both teams have an equal chance to serve the ball in the first round of the very first game of a match.

So, for given values of Pa, Pb, K, and L, you have to compute the probability, as a percent, for team A to win the match.


Input

There is one number in the first line - the number of data sets. Each data set consists of a single line with four integers on it: Pa, Pb, K, and L (1 <= K <= 100, 1 <= L <= 100).


Output

For each test you must write on one line the required result with exactly one digit after the decimal point (the number should be rounded to the first digit after the decimal point).


Sample Input

2
100 50 1 3
100 1 1 1


Sample Output

93.8
99.5

Plz use simple programming im just a beginner if (simple) not possible then plz do it anyway!!
Thankyou very much!!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2006
Location: Yorkshire, UK
Posts: 2,883
Reputation: happygeek is an unknown quantity at this point 
Rep Power: 8
Solved Threads: 7
Admin
Staff Writer
Featured Blogger
happygeek's Avatar
happygeek happygeek is offline Offline
He's The Daddy

Re: I need Help..plz Solve this problem!!!

  #2  
May 10th, 2008
A whole host of things crop up here:

1 - read the rules before posting, after which you might have discovered you need to
2 - post in the appropriate forum (this one is for saying hello only) and
3 - not expect people to answer your homework assignments for you when all you have done is copy the question, showing no work of your own
Davey Winder
Information Security Journalist of the Year (2008)
www.happygeek.com
Author: Being Virtual
Reply With Quote  
Join Date: Dec 2005
Posts: 3,043
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 19
Solved Threads: 344
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: I need Help..plz Solve this problem!!!

  #3  
May 10th, 2008
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Reply With Quote  
Join Date: Jun 2007
Location: Home
Posts: 2,295
Reputation: zandiago is on a distinguished road 
Rep Power: 6
Solved Threads: 23
Featured Poster
zandiago's Avatar
zandiago zandiago is offline Offline
Nearly a Posting Maven

Re: I need Help..plz Solve this problem!!!

  #4  
May 10th, 2008
Glad to have you with us!
I shot the sheriff....but I didn't shoot the deputy
Reply With Quote  
Join Date: Aug 2007
Location: New Hampshire
Posts: 3,298
Reputation: jasimp is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 18
jasimp's Avatar
jasimp jasimp is offline Offline
Nearly a Senior Poster

Re: I need Help..plz Solve this problem!!!

  #5  
May 10th, 2008
Originally Posted by zandiago View Post
Glad to have you with us!
You really need to read what the poster is saying first. I would rather have them leave then stay. They just wanted us to do their homework for them.
A room without books is like a body without a soul.
Facts are meaningless. They can be used to prove anything that is even remotely true.
Go then, there are other worlds than these.
Reply With Quote  
Join Date: Mar 2006
Location: Yorkshire, UK
Posts: 2,883
Reputation: happygeek is an unknown quantity at this point 
Rep Power: 8
Solved Threads: 7
Admin
Staff Writer
Featured Blogger
happygeek's Avatar
happygeek happygeek is offline Offline
He's The Daddy

Re: I need Help..plz Solve this problem!!!

  #6  
May 11th, 2008
No, everyone deserves a second chance.

That said, his second chance posting was also in this thread, and also still asking for his homework to be done.

:-(
Davey Winder
Information Security Journalist of the Year (2008)
www.happygeek.com
Author: Being Virtual
Reply With Quote  
Join Date: May 2008
Posts: 14
Reputation: usmanabb is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
usmanabb usmanabb is offline Offline
Newbie Poster

Re: I need Help..plz Solve this problem!!!

  #7  
May 11th, 2008
OK Im, Sorry i've posted it in the right thread!!!
Reply With Quote  
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation: jbennet is a jewel in the rough jbennet is a jewel in the rough jbennet is a jewel in the rough jbennet is a jewel in the rough 
Rep Power: 30
Solved Threads: 263
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Microsoft Fanboy

Re: I need Help..plz Solve this problem!!!

  #8  
May 11th, 2008
welcome. marked as solved. dont do it again
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Community Introductions Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Community Introductions Forum

All times are GMT -4. The time now is 5:03 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC