시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 192 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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