FourSquares/IvanB
FourSquares/rnm27
n1 n
2 
3N = int(input())1N = int(input())
n4 n
5 
6x = 02x = 0
7while x * x * 4 < N:3while x * x * 4 < N:
8    x += 14    x += 1
9Y = x5Y = x
10while x * x <= N:6while x * x <= N:
n11    while (Y and (Y - 1) * (Y - 1) * 3 >= N - x * x):n7    while Y and (Y - 1) * (Y - 1) * 3 >= N - x * x:
12        Y -= 18        Y -= 1
13    y = Z = Y9    y = Z = Y
n14    while (y <= x and x * x + y * y <= N):n10    while y <= x and x * x + y * y <= N:
15        while (Z and (Z - 1) * (Z - 1) * 2 >= N - x * x - y * y):11        while Z and (Z - 1) * (Z - 1) * 2 >= N - x * x - y * y:
16            Z -= 112            Z -= 1
17        z = t = Z13        z = t = Z
n18        while (z <= y and x * x + y * y + z * z <= N):n14        while z <= y and x * x + y * y + z * z <= N:
19            while(t * t > N - x * x - y * y - z * z):15            while t * t > N - x * x - y * y - z * z:
20                t -= 116                t -= 1
t21            if(x * x + y * y + z * z + t * t == N):t17            if x * x + y * y + z * z + t * t == N:
22                print(x, y, z, t)18                print(x, y, z, t)
23            z += 119            z += 1
24        y += 120        y += 1
25    x += 121    x += 1
2622
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op