mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
34 lines
863 B
HTML
34 lines
863 B
HTML
|
<p>一个正整数如果能被 <code>a</code> 或 <code>b</code> 整除,那么它是神奇的。</p>
|
|||
|
|
|||
|
<p>给定三个整数 <code>n</code> , <code>a</code> , <code>b</code> ,返回第 <code>n</code> 个神奇的数字。因为答案可能很大,所以返回答案 <strong>对 </strong><code>10<sup>9</sup> + 7</code> <strong>取模 </strong>后的值。</p>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<ol>
|
|||
|
</ol>
|
|||
|
|
|||
|
<p><strong>示例 1:</strong></p>
|
|||
|
|
|||
|
<pre>
|
|||
|
<strong>输入:</strong>n = 1, a = 2, b = 3
|
|||
|
<strong>输出:</strong>2
|
|||
|
</pre>
|
|||
|
|
|||
|
<p><strong>示例 2:</strong></p>
|
|||
|
|
|||
|
<pre>
|
|||
|
<strong>输入:</strong>n = 4, a = 2, b = 3
|
|||
|
<strong>输出:</strong>6
|
|||
|
</pre>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<p><strong>提示:</strong></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><code>1 <= n <= 10<sup>9</sup></code></li>
|
|||
|
<li><code>2 <= a, b <= 4 * 10<sup>4</sup></code></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p> </p>
|