1062: Computer Versus Mankind
| Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
|---|---|---|---|---|---|
| 3s | 8192K | 2474 | 1147 | Standard |
Mike is a fan on programming. He's sure that computer can do everything faster than mankind does if a kind of task is repeated certain amount of times. Now he is proving this conclusion by calculate the gcd and lcm of two positive integers a and b, where a,b>1.
The gcd of two positive integers a and b, where a,b>1, is the greatest common dividor of them. The lcm of two positive integers a and b, where a,b>1, is the least common multiple of them. For example, the gcd of 6 and 8 is 2 while the lcm of them is 24.
Input Specification
The input consists of multilines, each line consists of two integers a and b(0<a,b<231), separated by a single space. a=b=0 marks the end of input, which you shouldn't process.
Output Specification
For each pair a and b in the input, you should output the gcd and lcm on a single line, separated by a single space too.
Sample Input
6 8 5 2 0 0
Sample Output
2 24 1 10
Problem Source: 1st JOJ Cup Online VContest Warmup Problem
This problem is used for contest: 75
Submit / Problem List / Status / Discuss
1015

被折叠的 条评论
为什么被折叠?



