#include #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") main() { int n, m; scanf("%d %d", &n, &m); int cnt[160010] = {}; int a, b, c, d, t, i; int p[] = {24, 12, 4, 1}; for (a = 0; a * a <= n && a <= m; a++) { for (b = a; b * b <= n - a * a && b <= m; b++) for (c = b; c * c <= n - a * a - a * b - b * b && c <= m; c++) { for (d = c; d * d <= n - a * a - b * b - c * c - a * b - b * c && d <= m; d++) { t = a * a + b * b + c * c + d * d + a * b + a * c + a * d + b * c + b * d + c * d; if (t > n) continue; cnt[t] += p[(a == b) + (b == c) + (c == d)]; } } } for (i = 0; i <= n; i++) printf("%d\n", cnt[i]); }