시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 62 7 7 15.909%

문제

양의 정수 n과 k가 주어졌을 때, n = p * q이고, p ≤ q, |q-kp| ≤ 105를 만족하는 소수 p와 q를 찾는 프로그램을 작성하시오.

입력

첫째 줄에 n과 k가 주어진다. (1 < n < 10120, 1 < k < 108)

출력

첫째 줄에 문제의 조건을 만족하는 소수 p와 q를 "p * q"형태로 출력한다.

예제 입력 1

35 1

예제 출력 1

5 * 7
W3sicHJvYmxlbV9pZCI6IjM3MzQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJSU0EgXHVjNzc4XHVjMjE4IFx1YmQ4NFx1ZDU3NCIsImRlc2NyaXB0aW9uIjoiPHA+XHJcblx0XHVjNTkxXHVjNzU4IFx1YzgxNVx1YzIxOCBuXHVhY2ZjIGtcdWFjMDAgXHVjOGZjXHVjNWI0XHVjODRjXHVjNzQ0IFx1YjU0YywgbiA9IHAgKiBxXHVjNzc0XHVhY2UwLCBwICZsZTsgcSwgfHEta3B8ICZsZTsmbmJzcDsxMDxzdXA+NTxcL3N1cD5cdWI5N2MgXHViOWNjXHVjODcxXHVkNTU4XHViMjk0IFx1YzE4Y1x1YzIxOCBwXHVjNjQwIHFcdWI5N2MgXHVjYzNlXHViMjk0IFx1ZDUwNFx1Yjg1Y1x1YWRmOFx1YjdhOFx1Yzc0NCBcdWM3OTFcdWMxMzFcdWQ1NThcdWMyZGNcdWM2MjQuPFwvcD5cclxuIiwiaW5wdXQiOiI8cD5cclxuXHRcdWNjYWJcdWM5ZjggXHVjOTA0XHVjNWQwIG5cdWFjZmMga1x1YWMwMCBcdWM4ZmNcdWM1YjRcdWM5YzRcdWIyZTQuICgxICZsdDsgbiAmbHQ7IDEwPHN1cD4xMjA8XC9zdXA+LCAxICZsdDsgayAmbHQ7IDEwPHN1cD44PFwvc3VwPik8XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5cclxuXHRcdWNjYWJcdWM5ZjggXHVj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