eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Twin Apparent Primes!!

Twin Apparent Primes!!

Prime numbers have very interesting applications in Computer Science. This problem is obviously related with prime numbers but you need to know the following two definitions to solve this problem. \textbf{Apparent Prime}: A positive number that is not divisible by all integer numbers greater than \textbf{1} and less than or equal to \textbf{t} is called apparent prime. The value of \textbf{t} will be supplied for you. \textbf{Twin Apparent Primes}: If the difference of two apparent primes is \textbf{2} then they are called twin apparent primes. Given the value of \textbf{n} and \textbf{t} you will have to find two \textbf{n}-digit apparent prime numbers \textbf{p} and \textbf{(p+2)}. \InputFile The input file contains at most \textbf{1001} lines of inputs. Each line contains two positive integers \textbf{n} (\textbf{3500} ≤ \textbf{n} ≤ \textbf{5000}) and\textbf{t} (\textbf{t} ≤ \textbf{8000}). Input is terminated by a line containing two zeroes. These two numbers are of course invalid input and should not be processed. \OutputFile For each line of input produce one line of output. This line contains an n-digit apparent prime number \textbf{p}, such that\textbf{(p+2)} is also an apparent prime. If here is more than one such number, anyone will do.
Лимит времени 1 секунда
Лимит использования памяти 64 MiB
Входные данные #1
2 6
0 0
Выходные данные #1
17

Объяснение: Although n>=3500, in the sample n=2 so that the output fits in reasonable space.

Источник ACM-ICPC Asia Phuket Regional Programming Contest - 4 November 2011 – PSU, Phuket Campus