#t280. 最接近的分数

最接近的分数

Closest Fraction

Problem Background

Special for beginners, ^_^

Problem Description

What is the largest reduced fraction whose denominator does not exceed NN and that is strictly less than A/BA/B?

Input Format

Three positive integers NN, AA, BB, separated by single spaces. 1≤A<B<N≤10001 \le A < B < N \le 1000.

Output Format

Two positive integers: the numerator and denominator of the required fraction, separated by a single space.

Sample Input

100 7 13

Sample Output

50 93

Constraints

1s, 1024KiB for each test case.