시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 201 41 25 23.364%

문제

보통 작도는 눈금없는 자와 컴퍼스를 사용한다.

컴퍼스가 있기 때문에 기준 길이(길이 1)의 임의의 정수배는 손쉽게 작도할 수 있다.

그리고 더 나아가 자연수의 제곱근을 작도할 수 있다. 예를 들어 √33의 길이를 가지는 선분을 작도한다고 해보자. 먼저 수평선 위에 한 점 X를 잡고 X를 끝으로 하는 길이 4의 수평선과 수직한 선분을 작도한다. 이 선분의 끝 점을 H라고 하자. H를 중심으로 하는 길이 7의 원을 작도 한 뒤 수평선과 만나 생기는 교점 중 하나를 Y라고 하면 피타고라스 정리에 의해 선분 XY의 길이는 √33이 된다.

 

예시로 든 방법을 사용해서 √N을 작도하려고 한다. 필요한 원의 반지름과 선분의 길이를 구하자. 쓸 수 있는 길이가 여러 가지가 있다면 그들 중 최솟값을 사용한다.

(길이는 0이 되어도 된다.)

입력

첫 번째 줄에는 테스트 케이스의 개수가 주어진다. 다음 줄부터 각각의 테스트 케이스에 대해 정수 1≤N≤109 이 한 줄마다 주어진다.

출력

각각의 테스트 케이스에 대해 한 줄에 두 개의 음이 아닌 정수를 출력해야 한다.

두 정수는 각각 원의 반지름과 선분의 길이를 나타낸다. 답이 여러 가지면 최솟값을 출력한다. 답이 존재하지 않는 경우 "IMPOSSIBLE"을 출력한다.

예제 입력 1

4
33
16
50
101

예제 출력 1

4 7
0 4
IMPOSSIBLE
50 51
W3sicHJvYmxlbV9pZCI6IjUzODkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM4MWNcdWFjZjFcdWFkZmMgXHVjNzkxXHViM2M0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWJjZjRcdWQxYjUgXHVjNzkxXHViM2M0XHViMjk0IFx1YjIwOFx1YWUwOFx1YzVjNlx1YjI5NCBcdWM3OTBcdWM2NDAgXHVjZWY0XHVkMzdjXHVjMmE0XHViOTdjIFx1YzBhY1x1YzZhOVx1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