• محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

Pari has set up a new parquet flooring for her room. Her room is WW meters wide and LL meters long.

The blocks are of quadratic shape and each has an area of one quadratic meter. Once Pari had set up the flooring, which consists of yellow-colored blocks, she decided to paint the blocks on the edge of the room black.

توضیح

The picture above illustrates the floor from the test case #2 – outer blocks are black, while the remaining two inner blocks are yellow.

Mari has come to visit Pari. While Pari was serving her biscuits, she counted the number of blocks of each color. When Mary returned home, she recalled of the two numbers and wished to calculate the dimensions of Pari’s room. Help her!

ورودی

The first and only line of input contains two integers separated by a space, RR (the number of black blocks) and BB (the number of yellow blocks).

8R50008 \le R \le 5000 1B2 000 0001 \le B \le 2\ 000\ 000

خروجی

The first and only line of output must contain the dimensions of Pari's room, LL and WW, respectively. If the numbers differ, output the bigger one first. The test data is designed to somehow ensure that a unique solution always exists.

مثال

ورودی نمونه ۱

8 1
Plain text

خروجی نمونه ۱

3 3
Plain text

ورودی نمونه ۲

10 2
Plain text

خروجی نمونه ۲

4 3
Plain text

ورودی نمونه ۳

24 24
Plain text

خروجی نمونه ۳

8 6
Plain text

ارسال پاسخ برای این سؤال
فایلی انتخاب نشده است.