{"extraResources":{"example.01.mu":"TVXzATENCjEgMQ0K"},"scoring":null,"notes":"In the first test case, the expected value is $8 / 3$, which equals $666\\,666\\,674$ modulo $10^9 + 7$.\r\n","legend":"Nikita is preparing for a competition.\r\nThe most challenging part of this task is to find a pair of matching socks.\r\nIn the drawer, there are $p$ different pairs of socks, as well as $m$ single socks whose pairs he has lost long ago.\r\nNikita takes socks one by one until he finds two matching socks among those he has pulled out.\r\nWhat is the expected number of socks Nikita will pull out?\r\n\r\nCalculate this expected value modulo the prime number $10^9 + 7$.\r\nSpecifically, if the answer is a rational number $x / y$, you need to output a number $a$ such that $0 \\le a < 10^9 + 7$ and $a \\cdot y = x \\pmod{10^9 + 7}$.\r\n","authorLogin":"ivan_bochkov","language":"english","timeLimit":1000,"output":"For each test case, output a line containing a single integer: the answer to the problem.\r\n","inputFile":"stdin","outputFile":"stdout","input":"The first line contains an integer $t$: the number of test cases ($1 \\le t \\le 10^4$).\r\nThe following lines describe the test cases.\r\n\r\nEach test case is given on a separate line containing two integers $p$ and $m$: the number of pairs of socks and the number of single socks in the drawer ($1 \\le p \\le 10^6$; $0 \\le m \\le 10^6$).\r\n","authorName":"Иван Бочков","sampleTests":[{"output":"666666674\r\n","input":"1\r\n1 1\r\n","inputFile":"example.01","outputFile":"example.01.a"}],"name":"Wanted: Second Sock","interaction":null,"memoryLimit":1073741824,"tutorial":""}