Language: C++

/* Hello darkness my old friend, I've come to visit you again! */

#include<bits/stdc++.h>
#define lli long long int
#define FOR(i,a,b) for(i=a;i<b;i++)
#define FORB(i,b,a) for(i=b;i>=a;i--)
#define mod 1000000007
#define PI 2*acos(0.0)
#define gs getline(cin,s)
#define pii pair<double,double>
#define pli pair<long long int,int>
#define pil pair<int,long long int>
#define pll pair<long long int,long long int>
#define pb push_back
#define eb emplace_back
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 1000000005
#define INF 1000000000000000005
#define io ios_base::sync_with_stdio(0);
#define ff first
#define ss second
using namespace std;
vector <pii> v;
int a[1000][1000];
int main()
{
    io;
    cin.tie(0);
    cout.tie(0);
    double d1,d2,n;
    cin>>n>>d1>>d2;
    int i,j;
    FOR(i,0,2*n)
    {
        FOR(j,0,2*n)
        v.pb({(double)i*1.0,(double)j*1.0});
    }
    int sz=v.size();
    FOR(i,0,sz)
    {
        double x=v[i].ff,y=v[i].ss;
        if(a[(int)x][(int)y])
            continue;
        FOR(j,0,2*n)
        {
            double p=(double)j*1.0;
            if(d1>=(x-p)*(x-p))
            {
                double val=sqrt(d1-(x-p)*(x-p));
                if(val+y<2*n)
                {
                    double q=val+y;
                    if(q==floor(q))
                    {
                        if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d1)<1e5)
                            a[(int)p][(int)q]=a[(int)q][(int)p]=1;
                    }
                }
                if(y>=val)
                {
                    double q=y-val;
                    if(q==floor(q))
                    {
                        if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d1)<1e5)
                            a[(int)p][(int)q]=a[(int)q][(int)p]=1;
                    }
                }
            }
            if(d2>=(x-p)*(x-p))
            {
                double val=sqrt(d2-(x-p)*(x-p));
                if(val+y<2*n)
                {
                    double q=val+y;
                    if(q==floor(q))
                    {
                        if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d2)<1e5)
                            a[(int)p][(int)q]=a[(int)q][(int)p]=1;
                    }
                }
                if(y>=val)
                {
                    double q=y-val;
                    if(q==floor(q))
                    {
                        if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d2)<1e5)
                            a[(int)p][(int)q]=a[(int)q][(int)p]=1;
                    }
                }
            }
        }
    }
    int c=0;
    FOR(i,0,2*n)
    {
        FOR(j,0,2*n)
        {
            if(c==n*n)
                return 0;
            if(!a[i][j])
            {
                c++;
                cout<<i<<" "<<j<<"\n";
            }
        }
    }
    return 0;
}

/* This is the end, beautiful friend! */


Compiler output:
a.cc: In function 'int main()':
a.cc:55:58: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator-'
   55 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d1)<1e5)
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:55:65: error: expected ')' before 'd1'
   55 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d1)<1e5)
      |                            ~                                    ^~
      |                                                                 )
a.cc:56:66: error: expected ')' before ';' token
   56 |                             a[(int)p][(int)q]=a[(int)q][(int)p]=1;
      |                                                                  ^
      |                                                                  )
a.cc:55:27: note: to match this '('
   55 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d1)<1e5)
      |                           ^
a.cc:64:58: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator-'
   64 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d1)<1e5)
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:64:65: error: expected ')' before 'd1'
   64 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d1)<1e5)
      |                            ~                                    ^~
      |                                                                 )
a.cc:65:66: error: expected ')' before ';' token
   65 |                             a[(int)p][(int)q]=a[(int)q][(int)p]=1;
      |                                                                  ^
      |                                                                  )
a.cc:64:27: note: to match this '('
   64 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d1)<1e5)
      |                           ^
a.cc:77:58: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator-'
   77 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d2)<1e5)
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:77:65: error: expected ')' before 'd2'
   77 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d2)<1e5)
      |                            ~                                    ^~
      |                                                                 )
a.cc:78:66: error: expected ')' before ';' token
   78 |                             a[(int)p][(int)q]=a[(int)q][(int)p]=1;
      |                                                                  ^
      |                                                                  )
a.cc:77:27: note: to match this '('
   77 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d2)<1e5)
      |                           ^
a.cc:86:58: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator-'
   86 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d2)<1e5)
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:86:65: error: expected ')' before 'd2'
   86 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d2)<1e5)
      |                            ~                                    ^~
      |                                                                 )
a.cc:87:66: error: expected ')' before ';' token
   87 |                             a[(int)p][(int)q]=a[(int)q][(int)p]=1;
      |                                                                  ^
      |                                                                  )
a.cc:86:27: note: to match this '('
   86 |                         if((sqrt((p-x)*(p-x)+(q-y)*(q-y))-(sqrt)d2)<1e5)
      |                           ^