951 B
951 B
id | title | challengeType | forumTopicId | dashedName |
---|---|---|---|---|
5900f4d41000cf542c50ffe7 | Problem 360: Scary Sphere | 5 | 302021 | problem-360-scary-sphere |
--description--
Given two points (x_1
, y_1
, z_1
) and (x_2
, y_2
, z_2
) in three dimensional space, the Manhattan distance between those points is defined as |x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|
.
Let C(r)
be a sphere with radius r
and center in the origin O(0, 0, 0)
.
Let I(r)
be the set of all points with integer coordinates on the surface of C(r)
.
Let S(r)
be the sum of the Manhattan distances of all elements of I(r)
to the origin O
.
E.g. S(45)=34518
.
Find S({10}^{10})
.
--hints--
scarySphere()
should return 878825614395267100
.
assert.strictEqual(scarySphere(), 878825614395267100);
--seed--
--seed-contents--
function scarySphere() {
return true;
}
scarySphere();
--solutions--
// solution required