{"trustable":false,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\t\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n\t MathJax.Hub.Config({\n\t extensions: [\"tex2jax.js\"],\n\t jax: [\"input/TeX\", \"output/SVG\"],\n\t tex2jax: {\n\t inlineMath: [ [\u0027$\u0027,\u0027$\u0027], [\"\\\\(\",\"\\\\)\"] ],\n\t displayMath: [ [\u0027$$\u0027,\u0027$$\u0027], [\"\\\\[\",\"\\\\]\"] ],\n\t processEscapes: true\n\t },\n\t });\n\t\u003c/script\u003e\n\t\u003cscript type\u003d\"text/javascript\"\n\t src\u003d\"https://cdn.staticfile.org/mathjax/2.7.0/MathJax.js\"\u003e\n\t\u003c/script\u003e\n \n \u003cp\u003e Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What\u0027s more, he bought a large decorative chessboard with \u003cvar\u003eN\u003c/var\u003e rows and \u003cvar\u003eM\u003c/var\u003e columns. \u003c/p\u003e \n \u003cp\u003e Every day after work, Edward will place a chess piece on a random empty cell. A few days later, he found the chessboard was \u003cem\u003edominated\u003c/em\u003e by the chess pieces. That means there is at least one chess piece in every row. Also, there is at least one chess piece in every column. \u003c/p\u003e \n \u003cp\u003e \"That\u0027s interesting!\" Edward said. He wants to know the expectation number of days to make an empty chessboard of \u003cvar\u003eN\u003c/var\u003e × \u003cvar\u003eM\u003c/var\u003e dominated. Please write a program to help him. \u003c/p\u003e \n 有一个n*m的棋盘,一个无聊的人每天早上在棋盘空白处随机放一颗棋子,有一天他发现所有行和列都至少有一个棋子(他每天都检查一遍棋盘是否满足这个条件),求天数的期望。"}},{"title":"Input","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cp\u003eThere are multiple test cases. The first line of input contains an integer \u003cvar\u003eT\u003c/var\u003e indicating the number of test cases. For each test case:\u003c/p\u003e \n \u003cp\u003e There are only two integers \u003cvar\u003eN\u003c/var\u003e and \u003cvar\u003eM\u003c/var\u003e (1 \u0026lt;\u003d \u003cvar\u003eN\u003c/var\u003e, \u003cvar\u003eM\u003c/var\u003e \u0026lt;\u003d 50). \u003c/p\u003e \n \u003ch4"}},{"title":"Output","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cp\u003e For each test case, output the expectation number of days. \u003c/p\u003e \n \u003cp\u003e Any solution with a relative or absolute error of at most 10\u003csup\u003e-8\u003c/sup\u003e will be accepted. \u003c/p\u003e \n \u003ch4"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cpre\u003e2\n1 3\n2 2\n\u003c/pre\u003e \n \u003ch4"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cpre\u003e3.000000000000\n2.666666666667\n\u003c/pre\u003e \n "}}]}