#1016
Unrated
PARKET
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Author: Adrian Satja Kurdija

Ivica has set up a new parquet flooring in his room. The room is L decimeters long and W decimeters wide. The blocks are of quadratic shape and each has an area of one quadratic decimeter. Once Ivica had set up the flooring, which consists of brown-colored blocks, he decided to paint the blocks on the edge of the room red. The picture below illustrates the scenario from the test case #2 – outer blocks are red, while the remaining two inner blocks are brown:

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

입력

The first and only line of input contains two integers separated by a space, R (the number of red blocks) and B (the number of brown blocks). The following constraints will apply: 8 ≤ R ≤ 5000, 1 ≤ B ≤ 2 000 000.

출력

The first and only line of output must contain the dimensions of the room, L and W, respectively. If the numbers differ, output the greater one first. The test data will ensure that a unique solution always exists.

예제 입력 1

8 1

예제 출력 1

3 3

예제 입력 2

10 2

예제 출력 2

4 3

예제 입력 3

24 24

예제 출력 3

8 6
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.