F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

The Different World

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 322    Accepted Submission(s): 46


Problem 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 mth 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 Nth monument,could you give out the m and k of the Nth 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 Nth monument,separate by one space.
 

Sample Input
1 2 0
 

Sample Output
47 21 2161 988
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-20 22:19:53, Gzip enabled