{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\"text/css\"\u003e pre { text-align:left; font-family: \"Courier New\", Courier, monospace; font-size: 16px; white-space: pre; line-height:20px; text-indent: 0px; }\u003c/style\u003e\u003cdiv class\u003d\"pro_desc\"\u003e\n \u003cp\u003eEveryone knows there is a computer game names \"hearth stone\", recently xzz likes this game very much. If you want to win, you need both capacity and good luck. \u003c/p\u003e\n \u003cp\u003eThere is a spell card names \"Arcane Missiles\", which can deal 3 damages randomly split among all enemies. \u003c/p\u003e\n \u003cp\u003exzz have a \"Arcane Missiles Plus\" can deal n damage randomly split among all enemies. The enemy battle field have only two characters: the enemy hero and enemy minion. \u003c/p\u003e\n \u003cp\u003eNow we assume the enemy hero have infinite health, the enemy minion has m health. \u003c/p\u003e\n \u003cp\u003exzz wants to know the probability of the \"Arcane Missiles Plus\" to kill the enemy minion (the minion has not more than 0 health after \"Arcane Missiles Plus\"), can you help him? \u003c/p\u003e\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"pro_desc\"\u003e\n \u003cp\u003eThe first line of the input contains an integer T, the number of test cases. T test cases follow. (1 ≤ T ≤ 100000) \u003c/p\u003e\n \u003cp\u003eEach test case consists of a single line containing two integer n and m. (0 ≤ m ≤ n ≤ 1000) \u003c/p\u003e\n\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"pro_desc\"\u003e\n \u003cp\u003eFor each test case, because the probability can be written as x / y, please output x * y^-1 mod 1000000007. .(y * y^-1 ≡ 1 mod 10^9 + 7) \u003c/p\u003e\n\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n3 3\n2 1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e125000001\n750000006\u003c/pre\u003e"}},{"title":"tips","value":{"format":"HTML","content":"就是说n次攻击,每次对敌方英雄和敌方小兵随机二选一造成1点伤害"}}]}