1170: [NOIP2014] 比例简化

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:2 解决:2

题目描述

在社交媒体上,经常会看到针对某一个观点同意与否的民意调查以及结果。例如,对某一观点表示支持的有 lns="http://www.w3.org/1998/Math/MathML">1498 人,反对的有 lns="http://www.w3.org/1998/Math/MathML">902 人,那么赞同与反对的比例可以简单的记为 lns="http://www.w3.org/1998/Math/MathML">1498:902

不过,如果把调查结果就以这种方式呈现出来,大多数人肯定不会满意。因为这个比例的数值太大,难以一眼看出它们的关系。对于上面这个例子,如果把比例记为 lns="http://www.w3.org/1998/Math/MathML">5:3,虽然与真实结果有一定的误差,但依然能够较为准确地反映调查结果,同时也显得比较直观。

现给出支持人数 lns="http://www.w3.org/1998/Math/MathML">,反对人数 lns="http://www.w3.org/1998/Math/MathML">,以及一个上限 lns="http://www.w3.org/1998/Math/MathML">,请你将 lns="http://www.w3.org/1998/Math/MathML"> 比 lns="http://www.w3.org/1998/Math/MathML"> 化简为 lns="http://www.w3.org/1998/Math/MathML"> 比 lns="http://www.w3.org/1998/Math/MathML">,要求在 lns="http://www.w3.org/1998/Math/MathML"> 和 lns="http://www.w3.org/1998/Math/MathML"> 均不大于 lns="http://www.w3.org/1998/Math/MathML"> 且 lns="http://www.w3.org/1998/Math/MathML"> 和 lns="http://www.w3.org/1998/Math/MathML"> 互质(两个整数的最大公约数是 lns="http://www.w3.org/1998/Math/MathML">1)的前提下,lns="http://www.w3.org/1998/Math/MathML">riptlevel="0">riptlevel="0"> 且 lns="http://www.w3.org/1998/Math/MathML">riptlevel="0">riptlevel="0"> 的值尽可能小。

输入

共一行,包含三个整数lns="http://www.w3.org/1998/Math/MathML">,,,每两个整数之间用一个空格隔开,分别表示支持人数、反对人数以及上限。

输出

共一行,包含两个整数lns="http://www.w3.org/1998/Math/MathML">’,lns="http://www.w3.org/1998/Math/MathML">’,中间用一个空格隔开,表示化简后的比例。

样例输入

1498 902 10

样例输出

5 3

提示

对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1106,1106,1100,riptlevel="0">