FourSquares/rnm27
FourSquares/IvanB
nn1 
2 
1N = int(input())3N = int(input())
nn4 
5 
2x = 06x = 0
3while x * x * 4 < N:7while x * x * 4 < N:
4    x += 18    x += 1
5Y = x9Y = x
6while x * x <= N:10while x * x <= N:
n7    while Y and (Y - 1) * (Y - 1) * 3 >= N - x * x:n11    while (Y and (Y - 1) * (Y - 1) * 3 >= N - x * x):
8        Y -= 112        Y -= 1
9    y = Z = Y13    y = Z = Y
n10    while y <= x and x * x + y * y <= N:n14    while (y <= x and x * x + y * y <= N):
11        while Z and (Z - 1) * (Z - 1) * 2 >= N - x * x - y * y:15        while (Z and (Z - 1) * (Z - 1) * 2 >= N - x * x - y * y):
12            Z -= 116            Z -= 1
13        z = t = Z17        z = t = Z
n14        while z <= y and x * x + y * y + z * z <= N:n18        while (z <= y and x * x + y * y + z * z <= N):
15            while t * t > N - x * x - y * y - z * z:19            while(t * t > N - x * x - y * y - z * z):
16                t -= 120                t -= 1
t17            if x * x + y * y + z * z + t * t == N:t21            if(x * x + y * y + z * z + t * t == N):
18                print(x, y, z, t)22                print(x, y, z, t)
19            z += 123            z += 1
20        y += 124        y += 1
21    x += 125    x += 1
2226
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op