Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	vector<pair<long long,long long> >v;
	long long k,x,y;
	cin>>k>>x>>y;
	if((x+y)%2==1&&k%2==0){
		cout<<-1;
		return 0;
	}
	if(fabs(x)+fabs(y)==k)
	{
		cout<<1<<endl<<x<<' '<<y;
		return 0;
	}
	if(fabs(x)+fabs(y)<k){
		if(x>=0&&y>=0&&(x+y!=0)){
			if(k%2==0){
				cout<<2<<endl;
				cout<<-(2*k-fabs(x)-fabs(y))/2<<' '<<(fabs(x)+fabs(y))/2<<endl;
				cout<<fabs(x)<<' '<<fabs(y)<<endl;
			}
			if(k%2==1){
				cout<<3<<endl;
				cout<<fabs(x)<<' '<<fabs(x)-k;
				cout<<(k+3*fabs(x)-fabs(y))/2<<' '<<(k+fabs(y)-fabs(x))/2+fabs(x)-k<<endl;
				cout<<fabs(x)<<' '<<fabs(y)<<endl;
			}
		}
		if(x>=0&&y<0){
			if(k%2==0){
				cout<<2<<endl;
				cout<<-(2*k-fabs(x)-fabs(y))/2<<' '<<-(fabs(x)+fabs(y))/2<<endl;
				cout<<fabs(x)<<' '<<-fabs(y)<<endl;
			}
			if(k%2==1){
				cout<<3<<endl;
				cout<<fabs(x)<<' '<<-fabs(x)+k;
				cout<<(k+3*fabs(x)-fabs(y))/2<<' '<<-(k+fabs(y)-fabs(x))/2-fabs(x)+k<<endl;
				cout<<fabs(x)<<' '<<-fabs(y)<<endl;
			}
		}
		if(x<0&&y>=0){
			if(k%2==0){
				cout<<2<<endl;
				cout<<(2*k-fabs(x)-fabs(y))/2<<' '<<(fabs(x)+fabs(y))/2<<endl;
				cout<<-fabs(x)<<' '<<fabs(y)<<endl;
			}
			if(k%2==1){
				cout<<3<<endl;
				cout<<-fabs(x)<<' '<<fabs(x)-k;
				cout<<-(k+3*fabs(x)-fabs(y))/2<<' '<<(k+fabs(y)-fabs(x))/2+fabs(x)-k<<endl;
				cout<<-fabs(x)<<' '<<fabs(y)<<endl;
			}
		}if(x<0&&y<0){
			if(k%2==0){
				cout<<2<<endl;
				cout<<(2*k-fabs(x)-fabs(y))/2<<' '<<-(fabs(x)+fabs(y))/2<<endl;
				cout<<-fabs(x)<<' '<<-fabs(y)<<endl;
			}
			if(k%2==1){
				cout<<3<<endl;
				cout<<-fabs(x)<<' '<<-fabs(x)+k;
				cout<<-(k+3*fabs(x)-fabs(y))/2<<' '<<-(k+fabs(y)-fabs(x))/2-fabs(x)+k<<endl;
				cout<<-fabs(x)<<' '<<-fabs(y)<<endl;
			}
		}
		return 0; 
	}
	long long rx=x,ry=y;
	x=0;y=0;
	if(rx>=0&&ry>=0){
		if(k%2==0){
			if(int(fabs(rx)+fabs(ry))%int(k))
			{
				v.push_back(make_pair(0,k)),
				v.push_back(make_pair(k-(int(fabs(rx)+fabs(ry))%k)/2,k-(int(fabs(rx)+fabs(ry))%k)/2));
			}
		}else{
			cout<<-fabs(x)<<' '<<-fabs(x)+k;
			cout<<-(k+3*fabs(x)-fabs(y))/2<<' '<<-(k+fabs(y)-fabs(x))/2-fabs(x)+k<<endl;
			cout<<-fabs(x)<<' '<<-fabs(y)<<endl;
		} 
	}else if(rx<0&&ry>=0){
		if(k%2==0){
			if(int(fabs(rx)+fabs(y))%int(k)){
				v.push_back(make_pair(0,k)),
				v.push_back(make_pair(-k+(int(fabs(rx)+fabs(ry))%k)/2,k-(int(fabs(rx)+fabs(ry))%k)/2));
				int tmp=k-(int(fabs(rx)+fabs(ry))%k)/2,
				x=x+tmp,
				y=y-tmp;
			}
		}
		else
			
	}else if(rx>=0&&ry<0){
		if(k%2==0){
			if(int(fabs(rx)+fabs(ry))%int(k)){
				v.push_back(make_pair(0,-k)),
				v.push_back(make_pair(k-(int(fabs(rx)+fabs(ry))%k)/2,-k+(int(fabs(rx)+fabs(ry))%k)/2));
				long long tmp=k-(int(fabs(rx)+fabs(ry))%k)/2,
				x=x-tmp,
				y=y+tmp;
			}
		}
	}else{
		if(k%2==0){
			if(int(fabs(rx)+fabs(ry))%int(k))
			{
				v.push_back(make_pair(0,-k)),
				v.push_back(make_pair(-k+(int(fabs(rx)+fabs(ry))%k)/2,-k+(int(fabs(rx)+fabs(ry))%k)/2));
				long long tmp=k-(int(fabs(rx)+fabs(ry))%k)/2,
				x=x+tmp,
				y=y+tmp;
			}
		}
	}
	x=v.back().first;
	y=v.back().second;
	if(x>rx)while(x-k-rx==fabs(x-k-rx))x=x-k,v.push_back(make_pair(x,y));
	if(x<rx)while(fabs(x+k-rx)!=x+k-rx)x=x+k,v.push_back(make_pair(x,y));
	if(y>ry)while(y-k-ry==fabs(y-k-ry))y=y-k,v.push_back(make_pair(x,y));
	if(y<ry)while(fabs(y+k-ry)!=y+k-ry)y=y+k,v.push_back(make_pair(x,y));
	if(x!=rx||y!=ry)v.push_back(make_pair(rx,ry));
	cout<<v.size()<<endl;
	for(int i=0;i<v.size();i++)cout<<v[i].first<<' '<<v[i].second<<endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:96:9: error: expected primary-expression before '}' token
   96 |         }else if(rx>=0&&ry<0){
      |         ^