[BOJ 5768] Divide and Conquer

View as PDF

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Given two integers M and N, with 1 ≤ M ≤ N ≤ 5000, you must determine the integer numbers X and Y such that</p>

  • A. M ≤ X ≤ N; and
  • B. Y is the number of divisors of X; and
  • C. Y is the largest possible; and
  • D. X is the largest possible.
## 입력 형식

Your program should process several test cases. Each test case is composed by a single line contain- ing the two integers M and N (1 ≤ M ≤ N ≤ 5000). The end of input is indicated by M = N = 0.

The input must be read from standard input.

출력 형식

For each test case in the input your program should print a single line, containing the two integers X and Y, separated by a space character.</p>

The output must be written to standard output.

예제 입력

1 5
300 500
4500 5000
0 0

예제 출력

4 3
480 24
4680 48

Comments

There are no comments at the moment.