{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eDid you watch the movie \"Animal World\"? There is an interesting game in this movie.\u003cbr\u003e\u003cbr\u003eThe rule is like traditional Stone-Paper-Scissors. At the beginning of the game, each of the two players receives several cards, and there are three types of cards: scissors, stone, paper. And then in each round, two players need to play out a card simultaneously. The chosen cards will be discarded and can not be used in the remaining part of the game.\u003cbr\u003e\u003cbr\u003eThe result of each round follows the basic rule: Scissors beat Paper, Paper beats Stone, Stone beats Scissors. And the winner will get $1$ point, the loser will lose $1$ point, and the points will not change in the case of a draw. \u003cbr\u003e\u003cbr\u003eNow, Rikka is playing this game with Yuta. At first, Yuta gets $a$ Scissors cards, $b$ Stone cards and $c$ Paper cards; Rikka gets $a\u0027$ Scissors cards, $b\u0027$ Stone cards, $c\u0027$ Paper cards. The parameters satisfy $a+b+c\u003da\u0027+b\u0027+c\u0027$. And then they will play the game exactly $a+b+c$ rounds (i.e., they will play out all the cards). \u003cbr\u003e\u003cbr\u003eYuta\u0027s strategy is \"random\". Each round, he will choose a card among all remaining cards with equal probability and play it out. \u003cbr\u003e\u003cbr\u003eNow Rikka has got the composition of Yuta\u0027s cards (i.e., she has got the parameters $a,b,c$) and Yuta\u0027s strategy (random). She wants to calculate the maximum expected final points she can get, i.e., the expected final points she can get if she plays optimally.\u003cbr\u003e\u003cbr\u003eHint: Rikka can make decisions using the results of previous rounds and the types of cards Yuta has played.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains a single number $t(1\\leq t \\leq 10^4)$.\u003cbr\u003e\u003cbr\u003eFor each testcase, the first line contains three numbers $a,b,c$ and the second line contains three numbers $a\u0027,b\u0027,c\u0027(0 \\leq a,b,c,a\u0027,b\u0027,c\u0027 \\leq 10^9, a+b+c \u003da\u0027 + b\u0027 + c\u0027\u0026gt; 0)$."}},{"title":"Output","value":{"format":"HTML","content":"For each testcase, if the result is an integer, print it in a line directly. \u003cbr\u003e\u003cbr\u003eOtherwise, if the result equals to $\\frac{a}{b}(|\\gcd(a,b)| \u003d 1, b \u0026gt; 0,$ $a$ and $b$ are integers$)$, output \"$a$/$b$\" (without the quote) in a single line."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n2 0 0\r\n0 2 0\r\n1 1 1\r\n1 1 1\r\n1 0 0\r\n0 0 1\r\n123 456 789\r\n100 200 1068\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n0\r\n-1\r\n3552/19\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}