## Scary Sphere

### Problem 360

Published on Sunday, 27th November 2011, 01:00 am; Solved by 414; Difficulty rating: 50%
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}).