mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
45 lines
1.6 KiB
HTML
45 lines
1.6 KiB
HTML
<p>你是一位施工队的工长,根据设计师的要求准备为一套设计风格独特的房子进行室内装修。</p>
|
||
|
||
<p>房子的客厅大小为 <code>n</code> x <code>m</code>,为保持极简的风格,需要使用尽可能少的 <strong>正方形</strong> 瓷砖来铺盖地面。</p>
|
||
|
||
<p>假设正方形瓷砖的规格不限,边长都是整数。</p>
|
||
|
||
<p>请你帮设计师计算一下,最少需要用到多少块方形瓷砖?</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/10/25/sample_11_1592.png" style="height: 106px; width: 154px;"></p>
|
||
|
||
<pre><strong>输入:</strong>n = 2, m = 3
|
||
<strong>输出:</strong>3
|
||
<code><strong>解释:</strong>3</code> 块地砖就可以铺满卧室。
|
||
<code> 2</code> 块 <code>1x1 地砖</code>
|
||
<code> 1</code> 块 <code>2x2 地砖</code></pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/10/25/sample_22_1592.png" style="height: 126px; width: 224px;"></p>
|
||
|
||
<pre><strong>输入:</strong>n = 5, m = 8
|
||
<strong>输出:</strong>5
|
||
</pre>
|
||
|
||
<p><strong>示例 3:</strong></p>
|
||
|
||
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/10/25/sample_33_1592.png" style="height: 189px; width: 224px;"></p>
|
||
|
||
<pre><strong>输入:</strong>n = 11, m = 13
|
||
<strong>输出:</strong>6
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= n <= 13</code></li>
|
||
<li><code>1 <= m <= 13</code></li>
|
||
</ul>
|