943,923 Members | Top Members by Rank

Ad:
May 10th, 2008
0

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

Expand Post »
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!!!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
usmanabb is offline Offline
23 posts
since May 2008
May 10th, 2008
0

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

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
Administrator
Staff Writer
Reputation Points: 1418
Solved Threads: 37
Freelance Word Punk
happygeek is offline Offline
5,569 posts
since Mar 2006
May 10th, 2008
0

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

Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
May 10th, 2008
-1

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

Glad to have you with us!
Featured Poster
Reputation Points: 129
Solved Threads: 26
Nearly a Posting Maven
zandiago is offline Offline
2,463 posts
since Jun 2007
May 10th, 2008
-1

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

Click to Expand / Collapse  Quote originally posted by zandiago ...
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.
Featured Poster
Reputation Points: 533
Solved Threads: 53
Senior Poster
jasimp is offline Offline
3,593 posts
since Aug 2007
May 11th, 2008
0

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

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.

:-(
Administrator
Staff Writer
Reputation Points: 1418
Solved Threads: 37
Freelance Word Punk
happygeek is offline Offline
5,569 posts
since Mar 2006
May 11th, 2008
0

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

OK Im, Sorry i've posted it in the right thread!!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
usmanabb is offline Offline
23 posts
since May 2008
May 11th, 2008
0

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

welcome. marked as solved. dont do it again
Moderator
Featured Poster
Reputation Points: 1784
Solved Threads: 574
Moderator
jbennet is offline Offline
16,520 posts
since Apr 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Community Introductions Forum Timeline: New member: anxious to learn
Next Thread in Community Introductions Forum Timeline: Hello





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC