freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-192-best-approximat...

56 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f42c1000cf542c50ff3f
challengeType: 5
title: 'Problem 192: Best Approximations'
videoUrl: ''
localeTitle: 'Проблема 192: Лучшие приближения'
---
## Description
<section id="description"> Пусть х - действительное число. Наилучшее приближение x для знаменателя d - рациональное число r / s в приведенном виде с s ≤ d, такое, что любое рациональное число, которое ближе к x, чем r / s, имеет знаменатель, больший d: <p> | П / QX | &lt;| r / sx | ⇒ q&gt; d </p><p> Например, наилучшее приближение к √13 для значения знаменателя 20 составляет 18/5, а наилучшее приближение к √13 для знаменателя 30 - 101/28. </p><p> Найдите сумму всех знаменателей наилучших приближений к √n для знаменателя, связанного 1012, где n не является идеальным квадратом и 1 &lt;n ≤ 100000. </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler192()</code> должен вернуть 57060635927998344.
testString: 'assert.strictEqual(euler192(), 57060635927998344, "<code>euler192()</code> should return 57060635927998344.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler192() {
// Good luck!
return true;
}
euler192();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>