freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-39-integer-right-triangles.russian.md

1.4 KiB
Raw Blame History

id, challengeType, title, forumTopicId, localeTitle
id challengeType title forumTopicId localeTitle
5900f3931000cf542c50fea6 5 Problem 39: Integer right triangles 302054 Problem 39: Integer right triangles

Description

Если p - периметр прямоугольного треугольника со сторонами целой длины, {a, b, c}, то существует ровно три решения для p = 120. {20,48,52}, {24,45,51}, { 30,40,50} Для какого значения p ≤ n, число решений максимизировано?

Instructions

Tests

tests:
  - 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);

Challenge Seed

function intRightTriangles(n) {
  // Good luck!
  return n;
}

intRightTriangles(1000);

Solution

// solution required