{"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":"\u003cp\u003e\r\n\tThe branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the question of \u003cspan data-scayt_word\u003d\"primality\" data-scaytid\u003d\"2\"\u003eprimality\u003c/span\u003e. A prime number is a number that is has no proper factors (it is only evenly divisible by 1 and itself). The first prime numbers are 2,3,5,7 but they quickly become less frequent. One of the interesting questions is how dense they are in various ranges. Adjacent primes are two numbers that are both primes, but there are no other prime numbers between the adjacent primes. For example, 2,3 are the only adjacent primes that are also adjacent numbers.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tYour program is given 2 numbers: L and U (1 \u0026lt;\u003d L \u0026lt; U \u0026lt;\u003d 2,147,483,647), and you are to find the two adjacent primes \u003cspan data-scayt_word\u003d\"C1\" data-scaytid\u003d\"3\"\u003eC1\u003c/span\u003e and \u003cspan data-scayt_word\u003d\"C2\" data-scaytid\u003d\"5\"\u003eC2\u003c/span\u003e (L \u0026lt;\u003d \u003cspan data-scayt_word\u003d\"C1\" data-scaytid\u003d\"4\"\u003eC1\u003c/span\u003e \u0026lt; \u003cspan data-scayt_word\u003d\"C2\" data-scaytid\u003d\"6\"\u003eC2\u003c/span\u003e \u0026lt;\u003d U) that are closest (\u003cspan data-scayt_word\u003d\"i.e\" data-scaytid\u003d\"1\"\u003ei.e\u003c/span\u003e. \u003cspan data-scayt_word\u003d\"C2-C1\" data-scaytid\u003d\"7\"\u003eC2-C1\u003c/span\u003e is the minimum). If there are other pairs that are the same distance apart, use the first pair. You are also to find the two adjacent primes \u003cspan data-scayt_word\u003d\"D1\" data-scaytid\u003d\"8\"\u003eD1\u003c/span\u003e and \u003cspan data-scayt_word\u003d\"D2\" data-scaytid\u003d\"11\"\u003eD2\u003c/span\u003e (L \u0026lt;\u003d \u003cspan data-scayt_word\u003d\"D1\" data-scaytid\u003d\"9\"\u003eD1\u003c/span\u003e \u0026lt; \u003cspan data-scayt_word\u003d\"D2\" data-scaytid\u003d\"12\"\u003eD2\u003c/span\u003e \u0026lt;\u003d U) where \u003cspan data-scayt_word\u003d\"D1\" data-scaytid\u003d\"10\"\u003eD1\u003c/span\u003e and \u003cspan data-scayt_word\u003d\"D2\" data-scaytid\u003d\"13\"\u003eD2\u003c/span\u003e are as distant from each other as possible (again choosing the first pair if there is a tie).\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cbr /\u003e\r\n\u003cbr /\u003e\r\n\u003cp\u003e\r\n\tEach line of input will contain two positive integers, L and U, with L \u0026lt; U. The difference between L and U will not exceed 1,000,000.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cbr /\u003e\r\n\u003cbr /\u003e\r\n\u003cp\u003e\r\n\tFor each L and U, the output will either be the statement that there are no adjacent primes (because there are less than two primes between the two given numbers) or a line giving the two pairs of adjacent primes.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cbr /\u003e\r\n\u003cbr /\u003e\r\n\u003cp\u003e\r\n\t2 17\u003cbr /\u003e\r\n\t14 17\u003c/p\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cbr /\u003e\r\n\u003cbr /\u003e\r\n\u003cp\u003e\r\n\t2,3 are closest, 7,11 are most distant.\u003cbr /\u003e\r\n\tThere are no adjacent primes.\u003c/p\u003e"}}]}