1429 - 埃及分数
Time Limit : 1 秒
Memory Limit : 128 MB
<span style="font-size:24pt;"><span>•</span></span><span style="font-size:24pt;font-family:宋体;color:black;">古埃及曾经创造出灿烂的人类文明,他们的分数表示却很令人不解。古埃及喜欢把一个分数分解为类似:</span><span style="font-size:24pt;font-family:Arial;color:black;"> 1/a + 1/b </span><span style="font-size:24pt;font-family:宋体;color:black;">的格式。</span>
<span style="font-size:24pt;"><span>•</span></span><span style="font-size:24pt;font-family:Arial;color:black;"><span> </span></span><span style="font-size:24pt;font-family:宋体;color:black;">这里,</span><span style="font-size:24pt;font-family:Arial;color:black;">a </span><span style="font-size:24pt;font-family:宋体;color:black;">和</span><span style="font-size:24pt;font-family:Arial;color:black;"> b </span><span style="font-size:24pt;font-family:宋体;color:black;">必须是不同的两个整数,分子必须为</span><span style="font-size:24pt;font-family:Arial;color:black;"> 1</span>
<span style="font-size:24pt;"><span>•</span></span><span style="font-size:24pt;font-family:Arial;color:black;"><span> </span></span><span style="font-size:24pt;font-family:宋体;color:black;">比如,</span><span style="font-size:24pt;font-family:Arial;color:black;">2/15 </span><span style="font-size:24pt;font-family:宋体;color:black;">一共有</span><span style="font-size:24pt;font-family:Arial;color:black;"> 4 </span><span style="font-size:24pt;font-family:宋体;color:black;">种不同的分解法(姑且称为埃及分解法):</span>
<span style="font-size:24pt;"><span>•</span></span><span style="font-size:24pt;font-family:Arial;color:black;">1/8 + 1/120</span>
<span style="font-size:24pt;"><span>•</span></span><span style="font-size:24pt;font-family:Arial;color:black;">1/9 + 1/45</span>
<span style="font-size:24pt;"><span>•</span></span><span style="font-size:24pt;font-family:Arial;color:black;">1/10 + 1/30</span>
<span style="font-size:24pt;"><span>•</span></span><span style="font-size:24pt;font-family:Arial;color:black;">1/12 + 1/20</span>
<span style="font-size:24pt;"><span>•</span></span><span style="font-size:24pt;font-family:Arial;color:black;"><span> </span></span><span style="font-size:24pt;font-family:宋体;color:black;">那么,</span><span style="font-size:24pt;font-family:Arial;color:black;"> 2/45 </span><span style="font-size:24pt;font-family:宋体;color:black;">一共有多少个不同的埃及分解呢(满足加法交换律的算同种分解)?</span>
<span style="font-size:24pt;font-family:宋体;color:black;">编程输出满足要求的分解数目。</span>
Input
Output
一个整数,表示满足要求的分解数目
Examples
Input
Output
7
Source
蓝桥杯-历届试题