Pro.ID21790 TitleThe Different World Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21790 AC0 Submit0 Ratio- 时间&空间限制描述The conflict between two-dimensional world TWO and three-dimensional world THREE had lasted for thousands years. Until the THREE won the TWO on the world war, this conflict was finished by the result --- the TWO became the colonial country of THREE. People of TWO became the slaves of THREE. The king of THREE decided to establish a monument to remember this historic event. The monument is one cube for King's preference. The small cube which has one unit length is the material to build this monument, and the slaves had to finish this project. The King had many strict requirements. (1) The workers can not move the materials until the materials can form a flat square. (2) Only m workers to move the material. (3) In the process of moving, the first worker only can move the square which has length k+1, the second can move k+2's square, and so on, the m-th worker move the lenth k+m's square. When all the materials have reached the target, the workers find that the king is an outstanding mathematician. Because the materials can just build one monument has length m. For example m=47, k=21, can build the monument with length m. Follow all the requriments, with different m and k, how many cube can be the king's monument? Could you sort all the monument with length by ascending sort. Then, when the king wants the N-th monument, could you give out the m and k of the N-th monument. The last problem is the important. 输入The input contains many test cases. Each test case contains only one line of one integer, N ( N ≤ 100 ). When N=0, the input file is end. 输出Description The conflict between two-dimensional world TWO and three-dimensional world THREE had lasted for thousands years. Until the THREE won the TWO on the world war, this conflict was finished by the result --- the TWO became the colonial country of THREE. People of TWO became the slaves of THREE. The king of THREE decided to establish a monument to remember this historic event. The monument is one cube for King's preference. The small cube which has one unit length is the material to build this monument, and the slaves had to finish this project. The King had many strict requirements. (1) The workers can not move the materials until the materials can form a flat square. (2) Only m workers to move the material. (3) In the process of moving, the first worker only can move the square which has length k+1, the second can move k+2's square, and so on, the m-th worker move the lenth k+m's square. When all the materials have reached the target, the workers find that the king is an outstanding mathematician. Because the materials can just build one monument has length m. For example m=47, k=21, can build the monument with length m. Follow all the requriments, with different m and k, how many cube can be the king's monument? Could you sort all the monument with length by ascending sort. Then, when the king wants the N-th monument, could you give out the m and k of the N-th monument. The last problem is the important. Input The input contains many test cases. Each test case contains only one line of one integer, N ( N ≤ 100 ). When N=0, the input file is end. Output Each test case output two integers in one line, m and k for N-th monument, separate by one space. Sample Input 1 Sample Output 47 21 Source 样例输入1 样例输出47 21 作者 |