{"trustable":false,"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":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n One day, sssworld and DDD play games together, but there are some special rules in this games. \n \u003cbr\u003eThey both have their own HP. Each round they dice respectively and get the points P1 and P2 (1 \u0026lt;\u003d P1, P2 \u0026lt;\u003d 6). Small number who, whose HP to reduce 1, the same points will remain unchanged. If one of them becomes 0 HP, he loses. \n \u003cbr\u003eAs a result of technical differences between the two, each person has different probability of throwing 1, 2, 3, 4, 5, 6. So we couldn’t predict who the final winner. \n \u003cbr\u003e \n \u003cbr\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are multiple test cases. \n\u003cbr\u003eFor each case, the first line are two integer HP1, HP2 (1 \u0026lt;\u003d HP1, HP2 \u0026lt;\u003d 2000), said the first player sssworld’s HP and the second player DDD’s HP. \n\u003cbr\u003eThe next two lines each have six floating-point numbers per line. The jth number on the ith line means the the probability of the ith player gets point j. The input data ensures that the game always has an end. \n\u003cbr\u003e\n每组测试数据,第一行两个整数,表示第二个人血量和第一个人的血量\n接下来2行,第一行表示第1个人掷出每个点数的概率,第二行表示第2个人掷出每个点数的概率,"}},{"title":"Output","value":{"format":"HTML","content":"One float with six digits after point, indicate the probability sssworld won the game."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e5 5\n1.000 0.000 0.000 0.000 0.000 0.000\n0.000 0.000 0.000 0.000 0.000 1.000\n5 5\n0.000 0.000 0.000 0.000 0.000 1.000\n1.000 0.000 0.000 0.000 0.000 0.000\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e0.000000\n1.000000\u003c/pre\u003e"}}]}