Language: C++

#pragma GCC optimize("O3") 

#include <bits/stdc++.h>
using namespace std;

typedef long long int           ll;
typedef unsigned long long int  ull;
typedef long double             ld;

typedef pair<int, int>          pii;
typedef pair<ll,ll>             pll;
typedef vector<int>             vi;
typedef vector<ll>              vll;
typedef vector<pii>             vpii;
typedef vector<pll>             vpll;

#define test(t)		        int t; cin >> t; while(t--)
#define f(i, a, b)	        for(int (i) = (a); (i) < (b); ++(i))
#define all(a)		        (a).begin(), (a).end()
#define endl 		        "\n"
#define maxvec(vec)             *max_element(all(vec))
#define minvec(vec)             *min_element(all(vec))
#define maxarr(arr)             *max_element(arr, arr + n)
#define minarr(arr)             *min_element(arr, arr + n)
#define deb(x)		        cout << #x << "--" << x << "--" << endl;
#define deb2(x,y)	        cout << #x << "-" << x << "-" << " ~~ " <<  #y << "-" << y << "-" << endl;
#define deba(arr)	        cout << #arr << " ~ [ "; for(auto n: arr) cout << n << " "; cout << "]" << endl;
#define debap(arr)	        cout << #arr << " ~ [ "; for(auto n: arr) cout << n.first << "-" << n.second << " "; cout << "]" << endl;
#define fast 		        ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define mx9		1000000007
#define mx7		10000007
#define mx6		1000006
#define mx5		200005
#define inf		1<<30                                 
#define eps		1e-9
#define mod		1000000007
#define PI		3.141592653589793238462643383279502884L
int f(int x, int y, int z) 
{
	return x * x + y * y + z * z + x * y + y * z + z * x;
}

void solve() {
	int n;
	cin >> n;
    ll ans[10000] = {0};
	for (int x = 1; x * x <= n; ++x) 
      for (int y = 1; x * x + y * y + x * y <= n; ++y) 
		for (int z = 1; f(x, y, z) <= n; ++z) 
          ans[f(x, y, z)]++;
	for (int i = 1; i <= n; ++i) 
      cout << ans[i] << endl;
}

int main()
{
    fast;
    test(t)
        solve();
    return 0;
}

Compiler output:
a.cc:18:33: error: expected unqualified-id before 'for'
   18 | #define f(i, a, b)              for(int (i) = (a); (i) < (b); ++(i))
      |                                 ^~~
a.cc:39:5: note: in expansion of macro 'f'
   39 | int f(int x, int y, int z)
      |     ^
a.cc:39:7: error: expected unqualified-id before 'int'
   39 | int f(int x, int y, int z)
      |       ^~~
a.cc:18:53: note: in definition of macro 'f'
   18 | #define f(i, a, b)              for(int (i) = (a); (i) < (b); ++(i))
      |                                                     ^
a.cc:39:7: error: expected ')' before 'int'
   39 | int f(int x, int y, int z)
      |       ^~~
a.cc:18:53: note: in definition of macro 'f'
   18 | #define f(i, a, b)              for(int (i) = (a); (i) < (b); ++(i))
      |                                                     ^
a.cc:18:52: note: to match this '('
   18 | #define f(i, a, b)              for(int (i) = (a); (i) < (b); ++(i))
      |                                                    ^
a.cc:39:5: note: in expansion of macro 'f'
   39 | int f(int x, int y, int z)
      |     ^
a.cc:18:63: error: expected unqualified-id before '++' token
   18 | #define f(i, a, b)              for(int (i) = (a); (i) < (b); ++(i))
      |                                                               ^~
a.cc:39:5: note: in expansion of macro 'f'
   39 | int f(int x, int y, int z)
      |     ^
a.cc: In function 'void solve()':
a.cc:18:33: error: expected primary-expression before 'for'
   18 | #define f(i, a, b)              for(int (i) = (a); (i) < (b); ++(i))
      |                                 ^~~
a.cc:50:33: note: in expansion of macro 'f'
   50 |                 for (int z = 1; f(x, y, z) <= n; ++z)
      |                                 ^
a.cc:50:32: error: expected ';' before 'for'
   50 |                 for (int z = 1; f(x, y, z) <= n; ++z)
      |                                ^
      |                                ;
a.cc:18:33: error: expected primary-expression before 'for'
   18 | #define f(i, a, b)              for(int (i) = (a); (i) < (b); ++(i))
      |                                 ^~~
a.cc:50:33: note: in expansion of macro 'f'
   50 |                 for (int z = 1; f(x, y, z) <= n; ++z)
      |                                 ^
a.cc:50:32: error: expected ')' before 'for'
   50 |                 for (int z = 1; f(x, y, z) <= n; ++z)
      |                     ~          ^
      |                                )
a.cc:50:44: error: expected primary-expression before '<=' token
   50 |                 for (int z = 1; f(x, y, z) <= n; ++z)
      |                                            ^~
a.cc:50:52: error: 'z' was not declared in this scope
   50 |                 for (int z = 1; f(x, y, z) <= n; ++z)
      |                                                    ^
a.cc:51:17: error: 'x' was not declared in this scope
   51 |           ans[f(x, y, z)]++;
      |                 ^
a.cc:18:53: note: in definition of macro 'f'
   18 | #define f(i, a, b)              for(int (i) = (a); (i) < (b); ++(i))
      |                                                     ^