#t301. 极值问题(acme)
极值问题(acme)
Background
Special for beginners, ^_^
Extreme Value Problem
Problem Description
and are integers satisfying the following two conditions:
- , i.e. ;
- .
Your task: given a positive integer (), find a pair of satisfying the two conditions above such that is maximised. For example, if is entered from the keyboard, the output is:
m=987
n=1597
Input Format
One positive integer .
Output Format
Output lines: the first line contains one integer, the value of ; the second line contains one integer, the value of . The output format is exactly as in the sample, with no spaces in between.
Note: the lines m=987 and n=1597 must be printed exactly as shown — the judge compares them character by character, so do not change the letters or add/remove spaces.
Sample Input
1995
Sample Output
m=987
n=1597
Constraints
1s, 1024KiB for each test case.