Lucky Tickets

题意翻译

### 题目内容 在海象岛,公共交通车票的特点是两个整数:一个是线路号,另一个是票号。线路号由 $a$ 表示,票号由 $b$ 表示,然后车票编号由有序的一对数字 $(a,b)$ 表示。 海象认为,如果 $a\times b= \operatorname{rev}(a)\times\operatorname{rev}(b)$,那么一张票是幸运的。 一般地,函数 $\operatorname{rev}(x)$ 定义为将 $x$ 翻转并去掉先导 $0$。 例如: $$\operatorname{rev}(12343)=34321$$ $$\operatorname{rev}(12000)=21$$ 公共交通管理委员会希望发售 $x$ 条线路的车票,每个线路都包含 $y$ 张票,以便至少发售 $w$ 张幸运票。并且委员会会使发售的票的总数 $(x\times y)$ 最少。而且,公共交通管理委员会一次只能发售不超过 $x_{max}$ 条线路的车票,每条线路只能发售不超过 $y_{max}$ 张车票。 ### 输入格式 输入只有一行,包含3个以空格间隔的整数,分别为 $x_{max},y_{max},w$。 ### 输出格式 输出两个整数,分别为 $x$,$y$ ,以空格间隔。 如果有数种可能的的答案,输出其中的一种即可。 如果不存在这样的 $x$,$y$,请输出 `-1`。 ### 数据范围和约定 对于 $100%$ 的数据: 每条线路的编号 $i$ 满足 $1\leq i \leq x$ ; 每张车票的编号 $j$ 满足 $1\leq j \leq y$ 。 $ 1\leq x_{max},y_{max} \leq 10^5,1 \leq w\leq10^7$。 Translated by Maxwang

题目描述

In Walrusland public transport tickets are characterized by two integers: by the number of the series and by the number of the ticket in the series. Let the series number be represented by $ a $ and the ticket number — by $ b $ , then a ticket is described by the ordered pair of numbers $ (a,b) $ . The walruses believe that a ticket is lucky if $ a*b=rev(a)*rev(b) $ . The function $ rev(x) $ reverses a number written in the decimal system, at that the leading zeroes disappear. For example, $ rev(12343)=34321 $ , $ rev(1200)=21 $ . The Public Transport Management Committee wants to release $ x $ series, each containing $ y $ tickets, so that at least $ w $ lucky tickets were released and the total number of released tickets ( $ x*y $ ) were minimum. The series are numbered from $ 1 $ to $ x $ inclusive. The tickets in each series are numbered from $ 1 $ to $ y $ inclusive. The Transport Committee cannot release more than $ max_{x} $ series and more than $ max_{y} $ tickets in one series.

输入输出格式

输入格式


The first line contains three integers $ max_{x} $ , $ max_{y} $ , $ w $ ( $ 1<=max_{x},max_{y}<=10^{5} $ , $ 1<=w<=10^{7} $ ).

输出格式


Print on a single line two space-separated numbers, the $ x $ and the $ y $ . If there are several possible variants, print any of them. If such $ x $ and $ y $ do not exist, print a single number $ -1 $ .

输入输出样例

输入样例 #1

2 2 1

输出样例 #1

1 1

输入样例 #2

132 10 35

输出样例 #2

7 5

输入样例 #3

5 18 1000

输出样例 #3

-1

输入样例 #4

48 132 235

输出样例 #4

22 111