freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.md
Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1.4 KiB
Raw Blame History

id, title, challengeType, videoUrl, dashedName
id title challengeType videoUrl dashedName
5900f4be1000cf542c50ffd1 问题338切割矩形网格纸 5 problem-338-cutting-rectangular-grid-paper

--description--

给出了具有整数尺寸w×h的矩形网格纸。它的网格间距为1.当我们沿着网格线将纸张切割成两个部分并重新排列这些部分而没有重叠时我们可以制作具有不同尺寸的新矩形。例如从尺寸为9×4的纸张中我们可以通过切割和重新排列来制作尺寸为18×2,12×3和6×6的矩形如下所示

同样从尺寸为9×8的纸张中我们可以制作尺寸为18×4和12×6的矩形。

对于w和h对让Fwh是可以由尺寸为w×h的薄片制成的不同矩形的数量。例如F2,1= 0F2,2= 1F9,4= 3和F9,8= 2.注意与初始一致的矩形不计算在内在Fwh。还要注意尺寸为w×h且尺寸为h×w的矩形不被认为是不同的。

对于整数N令GN为满足0 <h≤w≤N的所有w和h的Fwh之和。我们可以验证G10= 55G103 = 971745和G105= 9992617687。

找到G1012。给你的答案模数108。

--hints--

euler338()应该返回15614292。

assert.strictEqual(euler338(), 15614292);

--seed--

--seed-contents--

function euler338() {

  return true;
}

euler338();

--solutions--

// solution required