21790_TheDifferentWorld

2022-5-16 18:20| 发布者: Hocassian| 查看: 30| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505850206900-Problem List-采集的数据-后羿采集器.html

Pro.ID

21790

Title

The Different World

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21790

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/32768 K (Java/Others)
  • 描述

    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
    2
    0

    Sample Output

    47 21
    2161 988

    Source

    样例输入

    1
    2
    0

    样例输出

    47 21
    2161 988

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部