Files

49 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f4d41000cf542c50ffe7
title: 'Задача 360: Страшна Сфера'
challengeType: 5
forumTopicId: 302021
dashedName: problem-360-scary-sphere
---
# --description--
Враховуючи дві точки ($x_1$, $y_1$, $z_1$) та ($x_2$, $y_2$, $z_2$) у тривимірному просторі, Манхеттенська відстань між цими точками визначається як $| x_1 - x_2 | + | y_1 - y_2 | + | z_1 - z_2 |$.
Нехай $C(r)$ - куля з радіусом $r$ і центром у початку координат $O(0, 0, 0)$.
Нехай $I(r)$ - множина всіх точок з цілими координатами на поверхні $C(r)$.
Нехай $S(r)$ це сума Манхеттенських відстаней всіх елементів $I(r)$ до початку координат $O$.
Наприклад. $S(45)=34518$.
Знайдіть $S({10}^{10})$.
# --hints--
`scarySphere()` повинен повертати `878825614395267100`.
```js
assert.strictEqual(scarySphere(), 878825614395267100);
```
# --seed--
## --seed-contents--
```js
function scarySphere() {
return true;
}
scarySphere();
```
# --solutions--
```js
// solution required
```