Display Size
题意翻译
一个高端大气上档次的公司决定推出一款新系列的矩形显示器。并且他们规定:这个矩形显示器必须有n个像素。
现在,他们交给你一个任务:确定矩形显示器的显示大小。
当然,他们还有一些条件:
第一,显示器上必须正好有n个像素;
第二,每一行的像素个数a不能超过每一列的像素个数b,
即a<=b;
第三,你必须让b-a的差尽可能小。
输入:
一个自然数n(1<=n<=1e6)
输出:
a和b
题目描述
A big company decided to launch a new series of rectangular displays, and decided that the display must have exactly $ n $ pixels.
Your task is to determine the size of the rectangular display — the number of lines (rows) of pixels $ a $ and the number of columns of pixels $ b $ , so that:
- there are exactly $ n $ pixels on the display;
- the number of rows does not exceed the number of columns, it means $ a<=b $ ;
- the difference $ b-a $ is as small as possible.
输入输出格式
输入格式
The first line contains the positive integer $ n $ ( $ 1<=n<=10^{6} $ ) — the number of pixels display should have.
输出格式
Print two integers — the number of rows and columns on the display.
输入输出样例
输入样例 #1
8
输出样例 #1
2 4
输入样例 #2
64
输出样例 #2
8 8
输入样例 #3
5
输出样例 #3
1 5
输入样例 #4
999999
输出样例 #4
999 1001
说明
In the first example the minimum possible difference equals 2, so on the display should be 2 rows of 4 pixels.
In the second example the minimum possible difference equals 0, so on the display should be 8 rows of 8 pixels.
In the third example the minimum possible difference equals 4, so on the display should be 1 row of 5 pixels.