{"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\"\u003eIn the game of Three Kingdoms’ Legends, there are 4 players called the Monarch, the Minister, the Rebel and theTraitor. They have $h_1, h_2, h_3, and h_4$ health points at the beginning. The players with positive health points aresurviving; the players with zero health points are dead.\u003cbr\u003eThe players take turns to move in each round of the game: the Monarch moves first, then the Rebel, the Minister,and finally the Traitor. In a player’s turn, if he/she is surviving, he/she must attack a player and the health points of that player will decrease by 1. Note that the dead players cannot attack the other players, and self attacking isnot allowed.\u003cbr\u003eWhen one of the following events happens, the game ends immediately.\u003cbr\u003e$\\bullet$ Both of the Rebel and the Traitor are dead: The Monarch and the Minister win the game, no matter theminister is surviving or not.\u003cbr\u003e$\\bullet$ The Monarch is dead: If the Traitor is surviving and all the other players are dead, the Traitor wins; otherwisethe Rebel wins, no matter he/she is surviving or not.\u003cbr\u003eThe players have the following common knowledge on their strategies.\u003cbr\u003e$\\bullet$ The Monarch and the Minister never attack with each other.\u003cbr\u003e$\\bullet$ After attacking the chosen player, the probability of winning the game is maximized.\u003cbr\u003e$\\bullet$ If there are multiple players to choose, such that the winning probability is the same and maximized, all theseplayers will be chosen by equal chance.\u003cbr\u003eYour task is to calculate the winning probability of each player.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line is the number of test cases up to 10000. For each test case, there is a line containing 4 integers $h_1, h_2, h_3 and h_4$ (0 \u0026lt; $h_1$ \u0026lt; 40, 0 ≤ $h_2$ \u0026lt; 40, 0 ≤ $h_3$ \u0026lt; 40, 0 ≤ $h_4$ \u0026lt; 40).\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output a line of 3 winning probabilities with the precision of 6 digits, in which the first one is the Monarch and the Minister’s winning probability, the second one is the Rebel’s and the last one is the Traitor’s."}},{"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\n1 1 1 1\r\n1 0 1 1\r\n1 1 1 2\r\n2 1 2 6\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1.000000 0.000000 0.000000\r\n0.000000 0.500000 0.500000\r\n0.500000 0.500000 0.000000\r\n0.250000 0.500000 0.250000\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}