SOLVE

LATER

Win-the-Game

Problem

Editorial

Analytics

Kunal and Satyam are playing a game. A game is like this there is a bag consists of R red balls and G green balls.

Both player draw a ball alternatively and never put it back.The player draw the red balls will win the game. Satyam always start the game.If No one can draw the red ball then Satyam will win.
Find the probability that Satyam will win the game.

Input:

The first line will contain the number of test cases T.

The first line of each test case will contain a number R (number of red balls) and G(number of green balls )

Output

For each testcase, print the desired probability.

Constraints:

1<=T<=10

0<=R,G<=10^3

Problem Setter : Surya Pratap Singh

Time Limit:
2.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Scala 2.11.8,
Swift,
Visual Basic

Initializing Code Editor...

{"d6ec37f": "/pagelets/problems-hint/algorithm/win-the-game/", "d6ec525": "/pagelets/recommended-problems/algorithm/win-the-game/", "d6ec356": "/pagelets/problem-author-tester/algorithm/win-the-game/", "d6ebe9f": "/pagelets/show-submission/algorithm/win-the-game/", "d6ec12e": "/pagelets/suggested-problems/algorithm/win-the-game/"}

{}

realtime.hackerearth.com

80

390611c94778306b5e3a7b3984cb408c508bb2f6

58a29e5cae2309f04b28

/realtime/pusher/auth/