{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003e\u003ci class\u003d\"itshape\"\u003eRR\u003c/i\u003e and \u003ci class\u003d\"itshape\"\u003eFlash\u003c/i\u003e\n are playing a game with a list of numbers that are distinct\n initially. In this game two players will take alternative\n turns. In each turn, a player can select a number \u003cspan class\u003d\"tex2jax_process\"\u003e$X$\u003c/span\u003e in the list and replace it with\n number \u003cspan class\u003d\"tex2jax_process\"\u003e$D$\u003c/span\u003e iff\n \u003cspan class\u003d\"tex2jax_process\"\u003e$D$\u003c/span\u003e is a divisor of\n \u003cspan class\u003d\"tex2jax_process\"\u003e$X$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$D$\u003c/span\u003e is smaller than \u003cspan class\u003d\"tex2jax_process\"\u003e$X$\u003c/span\u003e.\u003c/p\u003e\n \u003cp\u003eFor example, with the list \u003cspan class\u003d\"tex2jax_process\"\u003e$(1, 3, 12)$\u003c/span\u003e, the valid moves are:\u003c/p\u003e\n \u003cul class\u003d\"itemize\"\u003e\n \u003cli\u003e\n \u003cp\u003ereplacing \u003cspan class\u003d\"tex2jax_process\"\u003e$12$\u003c/span\u003e with\n one of the following number: \u003cspan class\u003d\"tex2jax_process\"\u003e$1, 2, 3, 4$\u003c/span\u003e or \u003cspan class\u003d\"tex2jax_process\"\u003e$6$\u003c/span\u003e;\u003c/p\u003e\n \u003c/li\u003e\n \u003cli\u003e\n \u003cp\u003ereplacing \u003cspan class\u003d\"tex2jax_process\"\u003e$3$\u003c/span\u003e with\n \u003cspan class\u003d\"tex2jax_process\"\u003e$1$\u003c/span\u003e.\u003c/p\u003e\n \u003c/li\u003e\n \u003c/ul\u003e\n \u003cp\u003eThe player who takes the last move will lose the game. At\n the beginning, \u003ci class\u003d\"itshape\"\u003eFlash\u003c/i\u003e will select a\n non-empty initial list of distinct numbers between \u003cspan class\u003d\"tex2jax_process\"\u003e$A$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$B$\u003c/span\u003e inclusively and \u003ci class\u003d\"itshape\"\u003eRR\u003c/i\u003e is the one who makes the first move.\u003c/p\u003e\n \u003cp\u003eYour task is to calculate the number of possible ways for\n \u003ci class\u003d\"itshape\"\u003eFlash\u003c/i\u003e to select the initial list where\n he can be sure that he would win the game assuming both players\n play optimally.\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eThe input consists of several datasets. The first line of\n the input contains the number of datasets which is a positive\n number and is not greater than \u003cspan class\u003d\"tex2jax_process\"\u003e$100$\u003c/span\u003e. The following lines describe\n the datasets. Each dataset is described in a single line\n containing two integers \u003cspan class\u003d\"tex2jax_process\"\u003e$A$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$B$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$(1\n \u0026lt; A \\leq B \\leq {10}^{12}, B - A \\leq {10}^{5})$\u003c/span\u003e.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eFor each dataset, output the result modulo \u003cspan class\u003d\"tex2jax_process\"\u003e${10}^{9}+7$\u003c/span\u003e.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\n2 4\n2 5\n2 6\n2 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n4\n8\n16\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}