FourSquares/warnachinka
FourSquares/sver
f1N = int(input())f1N = int(input())
n2a = 0n
3while 4 * a ** 2 < N:
4    a += 1
5B = a
6while a * a <= N:
7    while B and 3 * (B - 1) ** 2 >= N - a * a:
8        B -= 1
9    b = C = B
10    while b <= a and a ** 2 + b ** 2 <= N:
11        while C and 2 * (C - 1) ** 2 >= N - a ** 2 - b ** 2:
12            C -= 1
13        c = d = C
14        while c <= b and a ** 2 + b ** 2 + c ** 2 <= N:
15            while d ** 2 > N - a ** 2 - b ** 2 - c ** 2:
16                d -= 1
17            if a ** 2 + b ** 2 + c ** 2 + d ** 2 == N:
18                print(a, b, c, d)
19            c += 1
20        b += 1
21    a += 1
222
tt3x = 0
4while 4 * (x ** 2) < N:
5    x += 1
6Y = x
7while x ** 2 <= N:
8    while Y and 3 * (Y - 1) ** 2 >= N - x ** 2:
9        Y -= 1
10    y = Z = Y
11    while y <= x and x ** 2 + y ** 2 <= N:
12        while Z and 2*(Z - 1) ** 2 >= N - x ** 2 - y ** 2:
13            Z -= 1
14        z = t = Z
15        while z <= y and x ** 2 + y ** 2 + z ** 2 <= N:
16            while t ** 2 > N - x ** 2 - y ** 2 - z ** 2:
17                t -= 1
18            if x ** 2 + y ** 2 + z ** 2 + t ** 2 == N:
19                print(x, y, z, t)
20            z += 1
21        y += 1
22    x += 1
23 
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op