2018-09-30 23:01:58 +01:00
---
id: 5900f47c1000cf542c50ff8e
title: 'Problem 270: Cutting Squares'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 301920
2021-01-13 03:31:00 +01:00
dashedName: problem-270-cutting-squares
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2021-07-24 09:09:54 +02:00
A square piece of paper with integer dimensions $N× N$ is placed with a corner at the origin and two of its sides along the $x$- and $y$-axes. Then, we cut it up respecting the following rules:
2020-11-27 19:02:05 +01:00
2021-07-24 09:09:54 +02:00
- We only make straight cuts between two points lying on different sides of the square, and having integer coordinates.
- Two cuts cannot cross, but several cuts can meet at the same border point.
- Proceed until no more legal cuts can be made.
2020-11-27 19:02:05 +01:00
2021-07-24 09:09:54 +02:00
Counting any reflections or rotations as distinct, we call $C(N)$ the number of ways to cut an $N× N$ square. For example, $C(1) = 2$ and $C(2) = 30$ (shown below).
2020-11-27 19:02:05 +01:00
2021-07-24 09:09:54 +02:00
<img class="img-responsive center-block" alt="ways to cut 2x2 square, counting reflections and rotations as distinct" src="https://cdn.freecodecamp.org/curriculum/project-euler/cutting-squares.gif" style="background-color: white; padding: 10px;">
2018-09-30 23:01:58 +01:00
2021-07-24 09:09:54 +02:00
What is $C(30)\bmod {10}^8$ ?
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
# --hints--
2018-09-30 23:01:58 +01:00
2021-07-24 09:09:54 +02:00
`cuttingSquares()` should return `82282080` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
2021-07-24 09:09:54 +02:00
assert.strictEqual(cuttingSquares(), 82282080);
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --seed--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
## --seed-contents--
2018-09-30 23:01:58 +01:00
```js
2021-07-24 09:09:54 +02:00
function cuttingSquares() {
2020-09-15 09:57:40 -07:00
2018-09-30 23:01:58 +01:00
return true;
}
2021-07-24 09:09:54 +02:00
cuttingSquares();
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
// solution required
```