#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; for (a = 0; a * a <= n and a <= m; a++) { for (b = 0; b * b <= n - a * a and b <= m; b++) for (c = 0; c * c <= n - a * a - a * b - b * b and c <= m; c++) { for (d = 0; d * d <= n - a * a - b * b - c * c - a * b - b * c and 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) cnt[t]++; } } } for (i = 0; i <= n; i++) printf("%d\n", cnt[i]); }