- محدودیت زمان: ۱ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
We want to engrave the names of several distinguished professors on the wall of Amirkabir University. The name of each professor will be written on a tile . We intend to select a rectangle of size on the wall with tiles and inscribe the professors' names on them.
The university will approve this request if the following conditions are met:
- First, the names of faculty members of the Computer Engineering Department must be included in this tribute.
- Second, the perimeter of this rectangle, that is, , must be minimized.
- Third, the values of and must be prime numbers.
Given a natural number , you are asked to calculate the minimum possible perimeter for this tribute.
ورودی
The first line of input contains a positive integer , representing the number of test cases.
In the next lines, each line contains an integer , representing the number of professors for that test case.
خروجی
For each of the test cases, print a natural number representing the minimum required perimeter.
مثالها
ورودی نمونه ۱
خروجی نمونه ۱
ارسال پاسخ برای این سؤال