2018-10-10 18:03:03 -04:00
---
id: 5900f3931000cf542c50fea6
challengeType: 5
title: 'Problem 39: Integer right triangles'
2019-08-28 16:26:13 +03:00
forumTopicId: 302054
localeTitle: 'Problem 39: Integer right triangles'
2018-10-10 18:03:03 -04:00
---
## Description
2019-08-28 16:26:13 +03:00
<section id='description'>
Если p - периметр прямоугольного треугольника с о сторонами целой длины, {a, b, c}, то существует ровно три решения для p = 120. {20,48,52}, {24,45,51}, { 30,40,50} Для какого значения p ≤ n, число решений максимизировано?
</section>
2018-10-10 18:03:03 -04:00
## Instructions
2019-08-28 16:26:13 +03:00
<section id='instructions'>
2018-10-10 18:03:03 -04:00
</section>
## Tests
<section id='tests'>
```yml
tests:
2019-08-28 16:26:13 +03:00
- text: <code>intRightTriangles(500)</code> should return 420.
testString: assert(intRightTriangles(500) == 420);
- text: <code>intRightTriangles(800)</code> should return 420.
testString: assert(intRightTriangles(800) == 420);
- text: <code>intRightTriangles(900)</code> should return 840.
testString: assert(intRightTriangles(900) == 840);
- text: <code>intRightTriangles(1000)</code> should return 840.
testString: assert(intRightTriangles(1000) == 840);
2018-10-10 18:03:03 -04:00
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function intRightTriangles(n) {
// Good luck!
return n;
}
intRightTriangles(1000);
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
2019-08-28 16:26:13 +03:00
2018-10-10 18:03:03 -04:00
</section>