criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define all(a) a.begin(), a.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;

struct point{
    ll x, y;
    point(ll x = 0, ll y = 0) : x(x), y(y) {}
};

void answer(vector<point>& vec, ll size, bool x, bool y, bool s){
    cout << (ll)vec.size() << endl;
    for(point p : vec){
        if(s)swap(p.x, p.y);
        if(y)p.y = -p.y;
        if(x)p.x = -p.x;
        cout << p.x << ' ' << p.y << endl;
    }
}

ll main(){

    ll K, X, Y;
    cin >> K >> X >> Y;

    bool xnegative = false;
    if(X < 0){
        X = -X;
        xnegative = true;
    }
    bool ynegative = false;
    if(Y < 0){
        Y = -Y;
        ynegative = true;
    }
    bool swapped = false;
    if(X < Y){
        swap(X, Y);
        swapped = true;
    }

    ll D = X + Y;
    if(K % 2 == 0 and D % 2 == 1){
        cout << -1 << endl;
        return 0;
    }

    ll step = 0;
    vector<point> ans;

    if(D < K and D % 2 == 1){
        step = 3;
        ans.push_back(point(X, X - K));
        ans.push_back(point(X + (K + X - Y) / 2, Y - K + (K + X - Y) / 2));
        ans.push_back(point(X, Y));
        answer(ans, step, xnegative, ynegative, swapped);
        return 0;
    } else {
        if(D < K and D % 2 == 0)step = 2;
        else if(((K - D % K) % K) % 2 == 0)step = (D + K - 1) / K;
        else step = ((D + K - 1) / K) + 1;
        ll down = (D - K * step) / 2;
        assert(D - 2 * down == step * K);
        point now(0, 0);
        while(now.y - K >= down){
            now.y -= K;
            ans.push_back(now);
        }
        now.x = K - (now.y - down);
        now.y = down;
        assert((abs(now.x) + abs(now.y)) % K == 0);
        ans.push_back(now);
        while(now.x + K <= X){
            now.x += K;
            ans.push_back(now);
        }
        now.y = down + K - (X - now.x);
        now.x = X;
        assert((Y - now.y) % K == 0);
        ans.push_back(now);
        ll tmp = (Y - now.y) / K;
        assert(tmp * K + now.y == Y); //ここまではREにならない
        rep(i, tmp){
            now.y += K;
            ans.push_back(now);
        }
        assert(now.y == Y); //ここでRE
        answer(ans, step, xnegative, ynegative, swapped);
        return 0;
    }

}


Compiler output:
a.cc:24:1: error: '::main' must return 'int'
   24 | ll main(){
      | ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair

bool judge1 = false,judge2 = false,judge3 = false;
void print_ans(vector<pair<long long,long long>> a){
	cout << a.size() << endl;
	for(auto i : a){
		long long x = i.first,y = i.second;
		if(judge3) swap(x,y);
		if(judge2) x *= -1;
		if(judge1) y *= -1;
		cout << x << " " << y << endl;
	}
}
int main(void){
	long long k,x,y;cin >> k >> x >> y;
	
	/*絶対に到達しない条件*/
	if((x+y)%2 != 0 && k %2 == 0){
		cout << -1 << endl;
		return 0;
	}
	
	if(y < 0){
		judge1 = true; y *= -1;
	}
	if(x < 0){
		judge2 = true; x *= -1;
	}
	if(abs(x) < abs(y)){
		judge3 = true; swap(x,y);
	}
	
	vector<pair<long long,long long>> a;
	//a.push_back(make_pair(0,0));
	
	if((x+y) < k && (x+y) %2 != 0){
		a.push_back(make_pair(x,x - k));
		a.push_back(make_pair(x + (k+x-y)/2,(x-k) + (k-x+y)/2));
		a.push_back(make_pair(x,y));
		print_ans(a);
		return 0;
	}else{
		long long c = (k - ((x+y)%k))%k;
		long long p,q; //(p,q)が現在いるところ
		p = 0,q = 0;
		
		long long L1 = (k*n - x - y)/2;// cout << "L1:" << L1 << endl; 
		long long c1 = L1/k; //prlong longf("c1 = %d\n",c1);
		long long dx = (L1 % k);
		
		for(long long i = 0;i < c1;i++){
			q-=k;
			a.pb(mp(p,q));
		}
		p = k - dx;
		q = -1*L1;
		a.pb(mp(p,q));
		
		long long L2 = x - (k - dx);
		long long c2 = L2/k;
		long long dy = (L2 % k);
		
		for(long long i = 0;i < c2;i++){
			p += k;
			a.pb(mp(p,q));
		}
		p = x;
		q += k - dy;
		a.pb(mp(p,q));
		
		long long L3 = (k*n - x + y)/2 - (k - dy);
		long long c3 = L3/k;
		for(long long i = 0;i < c3;i++){
			q+=k;
			a.pb(mp(p,q));
		}
		
		print_ans(a);
		return 0;
	}
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:35: error: 'n' was not declared in this scope
   50 |                 long long L1 = (k*n - x - y)/2;// cout << "L1:" << L1 << endl;
      |                                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair

bool judge1 = false,judge2 = false,judge3 = false;
void prlong long_ans(vector<pair<long long,long long>> a){
	cout << a.size() << endl;
	for(auto i : a){
		long long x = i.first,y = i.second;
		if(judge3) swap(x,y);
		if(judge2) x *= -1;
		if(judge1) y *= -1;
		cout << x << " " << y << endl;
	}
}
int main(void){
	long long k,x,y;cin >> k >> x >> y;
	
	/*絶対に到達しない条件*/
	if((x+y)%2 != 0 && k %2 == 0){
		cout << -1 << endl;
		return 0;
	}
	
	if(y < 0){
		judge1 = true; y *= -1;
	}
	if(x < 0){
		judge2 = true; x *= -1;
	}
	if(abs(x) < abs(y)){
		judge3 = true; swap(x,y);
	}
	
	vector<pair<long long,long long>> a;
	//a.push_back(make_pair(0,0));
	
	if((x+y) < k && (x+y) %2 != 0){
		a.push_back(make_pair(x,x - k));
		a.push_back(make_pair(x + (k+x-y)/2,(x-k) + (k-x+y)/2));
		a.push_back(make_pair(x,y));
		prlong long_ans(a);
		return 0;
	}else{
		long long c = (k - ((x+y)%k))%k;
		long long p,q; //(p,q)が現在いるところ
		p = 0,q = 0;
		
		long long L1 = (k*n - x - y)/2;// cout << "L1:" << L1 << endl; 
		long long c1 = L1/k; //prlong longf("c1 = %d\n",c1);
		long long dx = (L1 % k);
		
		for(long long i = 0;i < c1;i++){
			q-=k;
			a.pb(mp(p,q));
		}
		p = k - dx;
		q = -1*L1;
		a.pb(mp(p,q));
		
		long long L2 = x - (k - dx);
		long long c2 = L2/k;
		long long dy = (L2 % k);
		
		for(long long i = 0;i < c2;i++){
			p += k;
			a.pb(mp(p,q));
		}
		p = x;
		q += k - dy;
		a.pb(mp(p,q));
		
		long long L3 = (k*n - x + y)/2 - (k - dy);
		long long c3 = L3/k;
		for(long long i = 0;i < c3;i++){
			q+=k;
			a.pb(mp(p,q));
		}
		
		prlong long_ans(a);
		return 0;
	}
	
}

Compiler output:
a.cc:7:13: error: expected initializer before 'long_ans'
    7 | void prlong long_ans(vector<pair<long long,long long>> a){
      |             ^~~~~~~~
a.cc: In function 'int main()':
a.cc:43:17: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   43 |                 prlong long_ans(a);
      |                 ^~~~~~
      |                 ulong
a.cc:50:35: error: 'n' was not declared in this scope
   50 |                 long long L1 = (k*n - x - y)/2;// cout << "L1:" << L1 << endl;
      |                                   ^
a.cc:81:17: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   81 |                 prlong long_ans(a);
      |                 ^~~~~~
      |                 ulong
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair

bool judge1 = false,judge2 = false,judge3 = false;
void prlong long_ans(vector<pair<long long,long long>> a){
	cout << a.size() << endl;
	for(auto i : a){
		long long x = i.first,y = i.second;
		if(judge3) swap(x,y);
		if(judge2) x *= -1;
		if(judge1) y *= -1;
		cout << x << " " << y << endl;
	}
}
long long main(void){
	long long k,x,y;cin >> k >> x >> y;
	
	/*絶対に到達しない条件*/
	if((x+y)%2 != 0 && k %2 == 0){
		cout << -1 << endl;
		return 0;
	}
	
	if(y < 0){
		judge1 = true; y *= -1;
	}
	if(x < 0){
		judge2 = true; x *= -1;
	}
	if(abs(x) < abs(y)){
		judge3 = true; swap(x,y);
	}
	
	vector<pair<long long,long long>> a;
	//a.push_back(make_pair(0,0));
	
	if((x+y) < k && (x+y) %2 != 0){
		a.push_back(make_pair(x,x - k));
		a.push_back(make_pair(x + (k+x-y)/2,(x-k) + (k-x+y)/2));
		a.push_back(make_pair(x,y));
		prlong long_ans(a);
		return 0;
	}else{
		long long c = (k - ((x+y)%k))%k;
		long long p,q; //(p,q)が現在いるところ
		p = 0,q = 0;
		
		long long L1 = (k*n - x - y)/2;// cout << "L1:" << L1 << endl; 
		long long c1 = L1/k; //prlong longf("c1 = %d\n",c1);
		long long dx = (L1 % k);
		
		for(long long i = 0;i < c1;i++){
			q-=k;
			a.pb(mp(p,q));
		}
		p = k - dx;
		q = -1*L1;
		a.pb(mp(p,q));
		
		long long L2 = x - (k - dx);
		long long c2 = L2/k;
		long long dy = (L2 % k);
		
		for(long long i = 0;i < c2;i++){
			p += k;
			a.pb(mp(p,q));
		}
		p = x;
		q += k - dy;
		a.pb(mp(p,q));
		
		long long L3 = (k*n - x + y)/2 - (k - dy);
		long long c3 = L3/k;
		for(long long i = 0;i < c3;i++){
			q+=k;
			a.pb(mp(p,q));
		}
		
		prlong long_ans(a);
		return 0;
	}
	
}

Compiler output:
a.cc:7:13: error: expected initializer before 'long_ans'
    7 | void prlong long_ans(vector<pair<long long,long long>> a){
      |             ^~~~~~~~
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:43:17: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   43 |                 prlong long_ans(a);
      |                 ^~~~~~
      |                 ulong
a.cc:50:35: error: 'n' was not declared in this scope
   50 |                 long long L1 = (k*n - x - y)/2;// cout << "L1:" << L1 << endl;
      |                                   ^
a.cc:81:17: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   81 |                 prlong long_ans(a);
      |                 ^~~~~~
      |                 ulong
Language: C++

k = int(input())
x, y = [int(i) for i in raw_input().split()]
 
def solve(k, x, y):
    if x < 0:
        x = -x
    if y < 0:
        y = -y
 
    if x==0 and y==0:
        print 0
        return
 
    if (x-y)%2==1 and k%2==0:
        print -1
        return
 
    output = [(x,y)]
    while True:
        # print 'while', x,y
        if x+y == k:
            break
        if x==0 and y == 0:
            break
        if x+y<k:
            output.append((abs((x-y)/2), k - abs((x-y)/2)))
            x, y = abs((x-y)/2), k - abs((x-y)/2)
 
        elif x+y <2*k:
            output.append((abs((x-y)/2), k - abs((x-y)/2)))
            x, y = abs((x-y)/2), k - abs((x-y)/2)
            # print 'x,y',x,y
        elif x > k:
            x -= k
            output.append((x,y))
        elif y > k:
            y -= k
            output.append((x,y))
        else:
            x = 0
            y -= x
            output.append((x,y))
 
    print len(output)
 
    for (a,b) in output[::-1]:
        print a, b
 
# k=4
# x,y=9,9
solve(k, x, y)


Compiler output:
a.cc:20:11: error: invalid preprocessing directive #print
   20 |         # print 'while', x,y
      |           ^~~~~
a.cc:32:15: error: invalid preprocessing directive #print
   32 |             # print 'x,y',x,y
      |               ^~~~~
a.cc:49:3: error: invalid preprocessing directive #k
   49 | # k=4
      |   ^
a.cc:50:3: error: invalid preprocessing directive #x
   50 | # x,y=9,9
      |   ^
a.cc:1:1: error: 'k' does not name a type
    1 | k = int(input())
      | ^
Language: C++

#include <iostream>
#include <vector>

int main() {
  int64_t k, x, y;
  std::cin >> k >> x >> y;
  // 符号
  auto sx = x < 0 ? -1 : 1;
  auto sy = y < 0 ? -1 : 1;
  x *= sx;
  y *= sy;
  
  if(k % 2 == 0 && (x + y) % 2 == 1) {
    std::cout << -1 << std::endl;
    return 0;
  }
  if(x + y == k) {
    std::cout << 1 << std::endl;
    std::cout << x << " " << y << std::endl;
    return 0;
  }
  
  std::vector<std::pair<int64_t, int64_t>> p;
  if((std::abs(x) + std::abs(y)) % 2 && k % 2) {
    p.emplace_back(x * sx, y * sy);
    auto tmp = std::min(k, x);
    x -= tmp;
    y -= k - tmp;
  }
  while((std::abs(x) + std::abs(y)) >= 2 * k) {
    for(int i = 0; i < 1 + k % 2; ++i) {
      p.emplace_back(x * sx, y * sy);
      auto res = k;
      auto buf = std::min(x, res);
      x -= buf;
      res -= buf;
      y -= std::min(y, res);
    }
  }
  if (std::abs(x) + std::abs(y) == k) {
    p.emplace_back(x * sx, y * sy);
  } else if((std::abs(x) + std::abs(y))) {
    p.emplace_back(x, y);
    if(x >= y) {
      x = (std::abs(x) + std::abs(y)) / 2;
      y = k - x;
      if(x < 0) {x *= -1;}
      if(y >= 0) {y *= -1;}
    } else {
      y = (std::abs(x) + std::abs(y)) / 2;
      x = k - y;
      if(x > 0) {x *= -1;}
      if(y < 0) {y *= -1;}
    }
    p.emplace_back(x, y);
  }
  
  std::reverse(p.begin(), p.end());
  std::cout << p.size() << std::endl;
  for(const auto& tmp : p) {
    std::cout << tmp.first << " " << tmp.second << std::endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:8: error: 'reverse' is not a member of 'std'
   58 |   std::reverse(p.begin(), p.end());
      |        ^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:37: error: expected ';' before 'x'
   29 |         if(k%2==0&&(x+y)<k&&v.size()x=v.back().first,y=v.back().second,v.pop_back();
      |                                     ^
      |                                     ;
a.cc:30:9: error: expected primary-expression before 'if'
   30 |         if((x+y)%k)
      |         ^~
a.cc:29:85: error: expected ')' before 'if'
   29 |         if(k%2==0&&(x+y)<k&&v.size()x=v.back().first,y=v.back().second,v.pop_back();
      |           ~                                                                         ^
      |                                                                                     )
   30 |         if((x+y)%k)
      |         ~~                                                                           
a.cc:46:21: error: 'i' was not declared in this scope
   46 |         for(int i=0;i<v.size();i++){
      |                     ^
Language: Java

import java.util.*;
class Main{
	static int a,b;
	static boolean s;
	public static void main(String[]$){
		Scanner c=new Scanner(System.in);
		int k=c.nextInt(),x=c.nextInt(),y=c.nextInt();
		x*=a=x<0?-1:1;
		y*=b=y<0?-1:1;
		if(s=x<y)x^=y^(y=x);
		int n=(x+y+k-1)/k;
		if(k%2==0&&(x+y)%2==1){
			System.out.println(-1);
			return;
		}else if(x+y<k)if((x+y)%(n=2)==1){
			System.out.println(3);
			p(x,x-k);
			p(x+(k+x-y)/2,x-k+(k-x+y)/2);
			p(x,y);
			return;
		}else if((k-(x+y)%k)%k%2==1)n++;
		System.out.println(n);
		int m=(k*n-x-y)/2,i=0;
        for (int i = 1; i <= n; i++) {
            if (m > k * i) {
                p(0, -k * i);
            } else if (x + m > k * i) {
                p(k * i - m, -m);
            } else {
                p(x, k * i - 2 * m - x);
            }
        }
	}
	static void p(int x,int y){
		System.out.println(a*(s?y:x)+" "+b*(s?x:y));
	}
}

Compiler output:
Main.java:24: error: variable i is already defined in method main(String[])
        for (int i = 1; i <= n; i++) {
                 ^
1 error
Language: Java

import java.util.*;
class Main{
	static int a,b;
	static boolean s;
	public static void main(String[]$){
		Scanner c=new Scanner(System.in);
		int k=c.nextInt(),x=c.nextInt(),y=c.nextInt();
		x*=a=x<0?-1:1;
		y*=b=y<0?-1:1;
        if (x < y) {
            swap = true;
            int t = x;
            x = y;
            y = t;
        }
		int n=(x+y+k-1)/k;
		if(k%2==0&&(x+y)%2==1){
			System.out.println(-1);
			return;
		}else if(x+y<k)if((x+y)%(n=2)==1){
			System.out.println(3);
			p(x,x-k);
			p(x+(k+x-y)/2,x-k+(k-x+y)/2);
			p(x,y);
			return;
		}else if((k-(x+y)%k)%k%2==1)n++;
		System.out.println(n);
		int m=(k*n-x-y)/2,i=0;
		while(++i<=n)if(m>k*i)p(0,-k*i);
			else if(x+m>k*i) p(k*i-m,-m);
			else p(x,k*i-2*m-x);
	}
	static void p(int x,int y){
		System.out.println(a*(s?y:x)+" "+b*(s?x:y));
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
            swap = true;
            ^
  symbol:   variable swap
  location: class Main
1 error
Language: C++

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

Compiler output:
a.cc:1:17: error: 'v' does not name a type
    1 |                 v.push_back(make_pair(x,y)),
      |                 ^
Language: Java

import java.io.PrintWriter;
import java.util.Scanner;

public class ABC135E {
	static boolean xFlg, yFlg, swap;
	static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		sc.close();

		if (x < 0) {
			x *= -1;
			xFlg = true;
		}
		if (y < 0) {
			y *= -1;
			yFlg = true;
		}
		if (x > y) {
			int t = x;
			x = y;
			y = t;
			swap = true;
		}
		int z = x + y;
		if (k % 2 == 0 && z % 2 == 1) {
			System.out.println(-1);
			return;
		}

		int ans = 1;
		if (z != k) {
			ans = (z + k - 1) / k;
			if (ans == 1) {
				ans = 2;
			}
			if (ans % 2 == 0 && z % 2 == 1) {
				ans++;
			}
		}
		pw.println(ans);

		if (ans == 3) {
			int x1 = k - y;
			print(x1, y);
			int x2 = (x + x1) / 2;
			print(x2, y + k - (x1 - x2));
			print(x, y);
		} else {
			int total = k * ans;
			int over = (total - z) / 2;
			int sum = 0;
			int x2 = 0;
			int y2 = 0;
			while (sum < total) {
				sum += k;
				if (sum <= x + over) {
					x2 = sum;
					y2 = 0;
				} else if (sum <= x + over + y) {
					x2 = x + over;
					y2 = sum - x2;
				} else {
					x2 = x;
					y2 = y;
				}
				print(x2, y2);
			}
		}
		pw.flush();
	}

	static void print(int x, int y) {
		if (swap) {
			int t = x;
			x = y;
			y = t;
		}
		if (yFlg) {
			y *= -1;
		}
		if (xFlg) {
			x *= -1;
		}
		pw.println(x + " " + y);
	}
}


Compiler output:
Main.java:4: error: class ABC135E is public, should be declared in a file named ABC135E.java
public class ABC135E {
       ^
1 error
Language: C++

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
using namespace std;
namespace mine
{
	typedef long long ll;
	#define pr pair<int,int>
	#define FR first
	#define SE second
	#define MP make_pair
	#define PB push_back
	#define vc vector
	void chmax(int &x,const ll y) {x=(x>y?x:y);}
	void chmin(int &x,const ll y) {x=(x<y?x:y);}
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num)
	{
		if(num<0) putchar('-'),num=-num;
		if(num>=10) write(num/10);
		putchar('0'+num%10);
	}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	const int INF=0x3f3f3f3f;
	const int MOD=19930726;
	void add(ll &a,ll b){a+=b;if(a>=MOD)a-=MOD;if(a<=-MOD)a+=MOD;}
	ll qpower(ll x,int e)
	{
		ll ans=1;
		while(e)
		{
			if(e&1) ans=ans*x%MOD;
			x=x*x%MOD;e>>=1;
		}
		return ans;
	}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int N=1e7+10;



	void main()
	{
		int k=qerad(),x=qread(),y=qread();
		int a=(x+y)&1,b=k&1;
		if(a!=b) puts("-1");
	}
};
int main()
{
	srand(time(0));
	mine::main();
}


Compiler output:
a.cc: In function 'void mine::main()':
a.cc:60:23: error: 'qerad' was not declared in this scope; did you mean 'qread'?
   60 |                 int k=qerad(),x=qread(),y=qread();
      |                       ^~~~~
      |                       qread
a.cc:61:24: error: 'x' was not declared in this scope
   61 |                 int a=(x+y)&1,b=k&1;
      |                        ^
a.cc:61:26: error: 'y' was not declared in this scope
   61 |                 int a=(x+y)&1,b=k&1;
      |                          ^
a.cc:62:23: error: 'b' was not declared in this scope
   62 |                 if(a!=b) puts("-1");
      |                       ^
Language: C++

#include <iostream>
#include<vector>
#define ll long long

using namespace std;

ll mx=1, my = 1;
ll indX = 0;
ll indY = 0;
void mapper(int x, int y)
{
		indX += x * mx;
		indY += y * my;

		cout << indX << " " << indY <<endl;
}
int main () {
	ll x,y,k;
	cin >> k >> x >> y;
	if(k%2 == 0 && (x+y)%2==1){
		cout <<-1<<endl; return 0;
	}
	if(x < 0) {
		mx = -1;
		x *= -1;
	}
	if(y < 0) {
		my = -1;
		y *= -1;
	}
	// cout << mx << " - x " << my << " - y"<<endl;
	ll n;
	n = (x+y+k-1)/k;
	if(n==1 && x+y != k) n++;

	int iteratorcount = 0
	while ((n*k+x+y)%2 != 0) {
		n++;	
		if(iteratorcount > 200) break;
		iteratorcount++;
	}

	cout << n <<endl;
	// cout << "n - "<<n<<endl;
	ll a,b;
	b = (n*k-x-y)/2;
	a = (n*k+x+y)/2;
	// cout <<"b: "<<b<<endl;
	while(b != 0){
		// cout << x << " - x  "<< y << "  - y"<<endl; 
		if(x>y) {
			if(b > k){
				mapper(0,k*(-1));
				y -= k*(-1);
				b -= k;
			}
			else if(b != 0){
				mapper(k-b,b*(-1));
				x -= k-b;
				y -= b*(-1);	
				b = 0;
			}
		}
		else {
			if(b > k){
				mapper(k*(-1),0);
				x -= k*(-1);
				b -= k;					
			}
			else if(b != 0){
				mapper(b*(-1),k-b);
				y -= k-b;
				x -= b*(-1);	
				b = 0;
			}
		}	
	}

	// cout << x << " " << y << " last res"<<endl;	
	

	if(x >= k){
		for (ll i = 0; i < x/k; ++i)
			mapper(k,0);
		x = x%k;
	}
	if(x != 0){
		mapper(x,k-x);
		x =0;
	}

	if(y >= k){
		for (ll i = 0; i < y/k; ++i)
			mapper(0,k);
		y = y%k;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: expected ',' or ';' before 'while'
   37 |         while ((n*k+x+y)%2 != 0) {
      |         ^~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;

int main()
{
    ll k, x, y;
    cin>>k>>x>>y;
    ll d=abs(x)+abs(y);
    if(k%2==0 && d%2==1){
        cout<<-1<<endl;
        return 0;
    }
    if(d==k){
        cout<<1<<endl;
        cout<<x<<" "<<y<<endl;
        return 0;
    }
    ll p=1, q=1;
    if(x<0) p=-1;
    if(y<0) q=-1;
    x=abs(x), y=abs(y);
    vector<P> v;
    ll x0=0, y0=0;
    while(x0+y0<d-2*k){
        v.push_back({x0, y0});
        if(x>=x0+k) x0+=k;
        else if(y>=y0+k) y0+=k;
    }
    v.push_back({x0, y0});
    ll x1=x-x0, y1=y-y0;
    if(k%2==1 && (x1+y1)%2==1){
        if(x1>=k) x0+=k;
        else y0+=k;
        v.push_back({x0, y0});
        x1=x-x0, y1=y-y0;
    }
    ll r=1, s=1;
    if(x1<0) r=-1;
    if(y1<0) s=-1;
    x1=abs(x1), y1=abs(y1);
    ll t=(x1-y1)/2;
    if(x1>=y1) v.push_back({x0+r*t, y0+s*(k-t)});
    else v.push_back({x0+r*(k+t), y0-s*t});
    v.push_back({x, y});
    cout<<v.size()-1<<endl;
    for(int i=1; i<v.size(); i++) cout<<v[i].frist*p<<" "<<v[i].second*q<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:46: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'struct std::pair<long long int, long long int>'} has no member named 'frist'; did you mean 'first'?
   66 |     for(int i=1; i<v.size(); i++) cout<<v[i].frist*p<<" "<<v[i].second*q<<endl;
      |                                              ^~~~~
      |                                              first
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <complex>
using namespace std;

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    ll K, X, Y; cin >> K >> X >> Y;

    // Kが偶数だといける点が限られる(重要)
    if(K%2 == 0 && (abs(X)+abs(Y))&1) { cout << -1 << endl; }
    else {
        // 一回でいける
        if(abs(X) + abs(Y) == K) {
            cout << 1 << endl;
            cout << X << " " << Y << endl;
            return 0;
        }
        
        // 簡単のためX >= Y, X >= 0, Y >= 0にして後で復元
        bool xflg = false, yflg = false, swpflg = false;
        if(X < 0) X = -X, xflg = true;
        if(Y < 0) Y = -Y, yflg = true;
        if(X < Y) swap(X,Y), swpflg = true;

        int n = (X + Y + K - 1) / K;
        if(n <= 1) n = 2;
        if((X+Y) % 2 != n * K % 2) ++n;

        vector<pair<int,int>> ans;
        if(n==3 && X < K) {
            int over = (K + X - Y) / 2;

            ans.emplace_back(X, X - K);

            ans.emplace_back(X + over, Y - (K - over));

            ans.emplace_back(X , Y);
        } else {
            // X >= K,  y軸方向に余分な動きをして合わせる -> 余分な移動は (n*K - X - Y) / 2
            int over = (K * n - (X+Y)) / 2; // 余分な動き
            for(int i = 1; i <= n; ++i) {
                int dist = i * K;
                if(dist <= Y + over) {
                    ans.emplace_back(0, dist); // 縦方向のみ
                } else if(dist <= Y + over + X) {
                    ans.emplace_back(dist - Y - over, Y + over); // 角をまたいだ
                } else {
                    ans.emplace_back(X, Y + (n-i) * K); // gーる
                }
            }
        }

        // out
        cout << ans.size() << '\n';
        for(auto xy : ans) {
            int x = xy.first, y = xy.second;
            if(swpflg) swap(x, y);
            if(yflg) y = -y;
            if(xflg) x = -x;
            cout << x << " " << y << '\n';
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'll' was not declared in this scope
   13 |     ll K, X, Y; cin >> K >> X >> Y;
      |     ^~
a.cc:13:24: error: 'K' was not declared in this scope
   13 |     ll K, X, Y; cin >> K >> X >> Y;
      |                        ^
a.cc:13:29: error: 'X' was not declared in this scope
   13 |     ll K, X, Y; cin >> K >> X >> Y;
      |                             ^
a.cc:13:34: error: 'Y' was not declared in this scope
   13 |     ll K, X, Y; cin >> K >> X >> Y;
      |                                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  long K, X, Y;
  cin >> K >> X >> Y;
  if((K + abs(X) + abs(Y)) % 2 == 1)return -1;
  long count = 1;
  while((count * K - abs(X) - abs(Y)) % 2 != 0 || count * count < abs(X) + abs(Y))count++;
  vector<pair<long, long>> ans(count);
  if(abs )
  cout <<  << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: cannot resolve overloaded function 'abs' based on conversion to type 'bool'
   10 |   if(abs )
      |          ^
a.cc:11:12: error: expected primary-expression before '<<' token
   11 |   cout <<  << endl;
      |            ^~
Language: C++

#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}

#define INF 1e9+7
#define LLINF 1e18+7
#define N 250000
ll MOD=1e9+7;

ll dp[N][13];

main(){
    int k=in();
    int x=in(),y=in();
    if(abs(x)+abs(y)==k){
        cout<<1<<endl;
        cout<<x<<" "<<y<<endl;
        return 0;
    }
    if((k%2==0)&&(abs(x+y)%2)){
        cout<<-1;
        return 0;
    }
    int t=0;
    if((abs(x)+abs(y)+k)%2){
        t=1;
    }
    int n=(max(abs(x+y),abs(x-y))+k-1)/k;

    if(t&&n%2==0)n++;
    int X=x+y,Y=x-y;
    vec dx,dy;
    if(n==1)n=3;
    while(abs(X)>k){
        int s=abs(X)/X;
        dx.pb(k*s);
    }
    if(dx.size()<n-1){
        dx.pb(k*s);
        X-=k;
        dx.pb(X);
    }
    else dx.pb(X);
    rep(i,n-dx.size())dx.pb(0);
    while(abs(Y)>k){
        int s=abs(Y)/Y;
        dy.pb(s*k);
    }
    if(dy.size()<n-1){
        dy.pb(k*s);
        Y-=k;
        dy.pb(Y);
    }
    else dy.pb(Y);
    rep(i,n-dy.size())dy.pb(0);
    int nx=0,ny=0;
    cout<<n<<endl;
    rep(i,n){
        int xx=dx[i],yy=dy[n-1-i];
        int ddx=(xx+yy)/2,ddy=(yy-xx)/2;
        nx+=ddx;ny+=ddy;
        cout<<nx<<" "<<ny<<endl;
    }
}



Compiler output:
a.cc:51:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   51 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:78:17: error: 's' was not declared in this scope
   78 |         dx.pb(k*s);
      |                 ^
a.cc:89:17: error: 's' was not declared in this scope
   89 |         dy.pb(k*s);
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define REP(i,n) for(long long i=0;i<n;i++)
#define REPP(i,m,n) for(long long i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())
#define de cout << "debug" << endl;
#define pb push_back
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    cin.tie(0);    
	ios::sync_with_stdio(false);
    int K;
    cin >> K;
    int X,Y;
    cin >> X >> Y;
    if(abs(X)+abs(Y) < K){
        int diff = abs(K - abs(X));
        diff += abs(Y);
        if(diff % 2 != 0){
            cout << -1 << endl;
            return 0;
        }
    }
    else if(abs(X) + abs(Y) >= K){
        int diff = abs(X)% K;
        diff = abs(Y - (K - diff));
        if(diff % 2 != 0){
            cout << -1 << endl;
            return 0;
        }
    }
    vector<pair<int,int>> V;
    int x = 0,y = 0;
    ll cnt = 0;
    REP(i,INF){
        if(x != X){
            if(X >= 0) x += K;
            else x -= X;
        }
        if(abs(X) < abs(x)){
            if(Y >= 0) y += abs(X - x);
            else y -= abs(X - x);
            x = X;
        }
        cnt++;
        V.pb({x,y});
        if(x == X) break;
    }

    REP(i,INF){
        if(abs(Y) > abs(y)){
            if(Y >= 0){
                y += K;
            }
            else y -= K;
        }
        cnt++;
        V.pb({x,y});
        if(Y == y) break;
    }
    cout << cnt << endl;
    REP(i,V.size()){
        cout << V[i].first() << ' ' << V[i].second() << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:27: error: expression cannot be used as a function
   68 |         cout << V[i].first() << ' ' << V[i].second() << endl;
      |                 ~~~~~~~~~~^~
a.cc:68:51: error: expression cannot be used as a function
   68 |         cout << V[i].first() << ' ' << V[i].second() << endl;
      |                                        ~~~~~~~~~~~^~
Language: C++

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
//typedef long long int;
const ll M = 1000000007;
ll A, B, C, D, G, H, N, L, K, P, Q, R, W, X, Y, Z;
string S, T;

signed main(){
	std::cin >>K ;
    std::cin >> A>>B;
    ll x=0;
    ll y=0;
    std::vector<ll>a;
    std::vector<ll>b;
    ll count=0;
    X=abs(A);
    Y=abs(B);
    if(K%2==0&&(X+Y)%2==1){std::cout << -1 << std::endl;}
    else{
        while(K<X-x){
            x+=K;
            a.push_back(x);
            b.push_back(y);
            count++;
        }
        count++;
        x=X;
        a.push_back(x);
        if((Y-(K-(X-x)))%y==0){
            y+=K-(X-x);
            b.push_back(y);
            while(Y!=y){
                y+=K;
                
                a.push_back(x);
                b.push_back(y);
                count++;
            }
        }
        else if((K-(X-x)+Y)%y==0){
            y-=K-(X-x);
            b.push_back(y);
            while(Y!=y){
                y+=K;
                a.push_back(x);
                b.push_back(y);
                count++;
            }
        }
        else{y+=K-(X-x);
            while(Y-y>K){
                y+=K;
                a.push_back(x);
                b.push_back(y);
                count++;
            }
            a.push_back(X+(K-(Y-y)/2));
            b.push_back((Y-y)/2);
            a.push_back(X);
            b.push_back(Y);
            count+=2;
        }
        }
        std::cout << count << std::endl;
        REP(i,count)std::cout <<A/abs(A)*a[i] <<" "<<B/abs(B)*b[i] << std::endl;
    }
    
}

Compiler output:
a.cc:71:1: error: expected declaration before '}' token
   71 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <utility>
#include <functional>
#include <queue>
#include <cmath>
#include <numeric>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <boost/math/common_factor.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#define REP(i, N) for(int i=0; i<(N); i++)
using namespace std;
using namespace boost::math;
using namespace boost::numeric;

int main() {
	long long K, X, Y;

	cin >> K >> X >> Y;
  
  if ((K % 2LL) == 0LL && (X + Y) % 2) {
    cout << -1 << endl;
    return 0;
  }
  long long now = K / 2LL;
  
  for (;;) {
    cout << now << " " << now;
    
    now += K / 2LL;
  }

	cout << A + B << endl;

	return 0;
}


Compiler output:
a.cc:14:10: fatal error: boost/math/common_factor.hpp: No such file or directory
   14 | #include <boost/math/common_factor.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;

#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()

int main(){
    ll K;    
    cin >> K;
    ll X, Y;
    cin >> X >> Y;

    if((abs(X)+abs(Y))%2==1 && K%2==0){
        cout << -1 << endl;
    }
    else{
        ll cx = 0;
        ll cy = 0;
        ll sx = X>=0? 1 : -1;
        ll sy = Y>=0? 1 : -1;
        while(abs(cx+K*sx)<=abs(x)){
            cx += K*sx;
            cout << cx << " " << cy << endl;
        }
        while(abs(cx+K*sx)<=abs(x)){
            cy += K*sy;
            cout << cx << " " << cy << endl;
        }
        ll dx = X - cx;
        ll dy = Y - cy;
        if(abs(dx)+abs(dy)==K){
            cout << X << " " << Y << endl;
        }
        else{
            ll gy = (dx+dy) / 2;
            ll gx = gy - K;
            cx = X - gx;
            cy = Y - gy;
            cout << cx << " " << cy << endl;
            cout << X << " " << Y << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:33: error: 'x' was not declared in this scope
   28 |         while(abs(cx+K*sx)<=abs(x)){
      |                                 ^
a.cc:32:33: error: 'x' was not declared in this scope
   32 |         while(abs(cx+K*sx)<=abs(x)){
      |                                 ^
Language: C++

/*#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")*/
//#pragma GCC optimize("fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC optimize("unroll-loops")
//#define _CRT_SECURE_NO_WARNINGS
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <bitset>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <math.h>
#include <random>
using namespace std;
typedef long long  ll;
typedef pair<ll, ll> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
#define all(a) a.begin(), a.end()
#define lb(a, x) lower_bound(a.begin(), a.end(), x)
#define pb(x) push_back(x)
#define fr(i, n) for(int i = 0; i < n; ++i)
//typedef cc_hash_table<int, int, hash<int>> hst2;
//typedef cc_hash_table<int, hst2, hash<int>> hst;
typedef pii ord_set_t;
#ifdef ABCD
typedef map<ord_set_t, vi> ordered_set;
int __builtin_popcount(int x)
{
	int cnt = 0;
	for (; x > 0; x >>= 1) cnt += x & 1;
	return cnt;
}
#else
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
mt19937 rnd(239);
using namespace __gnu_pbds;
typedef tree<
	ord_set_t,
	vi,
	less_equal<ord_set_t>,
	rb_tree_tag,
	tree_order_statistics_node_update>
	ordered_set;
#endif
const int N = 300001;

vector<pii> vec;
int main()
{

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef ABCD
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else

#endif
	int k; 
	int X, Y;
	int x, y; 
	cin >> k >> X >> Y;
	int x = X, y = Y;
	int dd = 0;
	if ((x + y) % k != 0)
	{
		dd = (k - x + y % k);
		if (dd % 2 != 0)
		{
			cout << -1;
			return 0;
		}
		//x += dd;
	}
	if (dd != 0)
	{
		vec.push_back({ -dd, k - dd });
		y -= (k - dd);
	}
	while (x >= k)
	{
		vec.push_back({ k, 0 });
		x -= k;
	}
	while (y >= k)
	{
		vec.push_back({ 0, k });
		y -= k;
	}
	if (x != 0 && y != 0)
	{
		vec.push_back({ x, y });
	}
	cout << vec.size();
	int xx = 0, yy = 0;
	for (auto it : vec)
	{
		xx += it.first * (X >= 0 ? 1 : -1);
		yy += it.second * (Y >= 0 ? 1 : -1);
		cout << xx << " " << yy << "\n";
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:78:13: error: redeclaration of 'int x'
   78 |         int x = X, y = Y;
      |             ^
a.cc:76:13: note: 'int x' previously declared here
   76 |         int x, y;
      |             ^
a.cc:78:20: error: redeclaration of 'int y'
   78 |         int x = X, y = Y;
      |                    ^
a.cc:76:16: note: 'int y' previously declared here
   76 |         int x, y;
      |                ^
Language: C++

#!/usr/bin/env python
# coding: utf-8

from collections import namedtuple

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))



def dist(pf, pt):
    return abs(pf[0]-pt[0])+abs(pf[1]-pt[1])

def main():
    k = ri()
    x, y = rli()
    ans = []
    pf = [0, 0]
    pt = [x, y]

    if k % 2 == 0 and dist(pf, pt) % 2 == 1:
        print(-1)
        return

    while abs(pf[0]-pt[0]) >= k:
        if pf[0] > pt[0]:
            pf[0] -= k
        else:
            pf[0] += k
        ans.append(tuple(pf))
    if dist(pf, pt) > k:
        if pf[1] > pt[1]:
            pf[1] -= abs(pf[0]-pt[0])
        else:
            pf[1] += abs(pf[0]-pt[0])
        pf[0] = pt[0]
        ans.append(tuple(pf))
    while abs(pf[1]-pt[1]) >= k:
        if pf[1] > pt[1]:
            pf[1] -= k
        else:
            pf[1] += k
        ans.append(tuple(pf))

    if dist(pf, pt) == 0:
        # おわり
        print(len(ans))
        for p in ans:
            print(p[0], p[1])
        return
    # 最後の調整
    last = None
    if abs(pf[0] - pt[0]) > 0:
        if pf[0] > pt[0]:
            x = pt[0]+(k-abs(pt[1]-pf[1]))
        else:
            x = pt[0]-(k-abs(pt[1]-pf[1]))
        last = (x, pf[1])
        # pf[0] = x
        # ans.append(tuple(pf))
    # 3回で到達
    if last is None:
        pt2 = tuple(pt)
    else:
        pt2 = last
    if pt2[0] > pf[0]:
        d = abs(pt2[0]-pf[0])//2
        ans.append((pf[0]+d,pf[1]+k-d))
    if last is not None:
        ans.append(last)
    ans.append(tuple(pt))

    print(len(ans))
    for p in ans:
        print(p[0], p[1])


if __name__ == '__main__':
    main()


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
a.cc:2:3: error: invalid preprocessing directive #coding
    2 | # coding: utf-8
      |   ^~~~~~
a.cc:52:11: error: invalid preprocessing directive #\U0000304a\U0000308f\U0000308a
   52 |         # おわり
      |           ^~~~~~
a.cc:57:7: error: invalid preprocessing directive #\U00006700\U00005f8c\U0000306e\U00008abf\U00006574
   57 |     # 最後の調整
      |       ^~~~~~~~~~
a.cc:65:11: error: invalid preprocessing directive #pf; did you mean #if?
   65 |         # pf[0] = x
      |           ^~
      |           if
a.cc:66:11: error: invalid preprocessing directive #ans
   66 |         # ans.append(tuple(pf))
      |           ^~~
a.cc:67:7: error: "3回で到達" after # is not a positive integer
   67 |     # 3回で到達
      |       ^~~~~~~~~
a.cc:84:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   84 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:4:1: error: 'from' does not name a type
    4 | from collections import namedtuple
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int k,x,y;
  cin>>k>>x>>y;

  if(abs(x)+abs(y)==k){
    cout<<1<<endl;
    cout<<x<<" "<<y<<endl;
    return 0;
  }

  Int u=(x+y),v=(x-y);
  assert((abs(u)%2)==(abs(v)%2));

  if((k%2==0)&&(abs(u)%2==1)){
    cout<<-1<<endl;
    return 0;
  }

  Int p=(abs(u)+k-1)/k;
  Int q=(abs(v)+k-1)/k;

  Int n=max(p,q);
  if(n==1) n++;
  if((k*n%2)!=(abs(u)%2)) n++;
  assert((k*n%2)==(abs(u)%2));
  {
    Int diff=(n-i)*k-(abs(x)+abs(y));
    assert(diff>=0);
  }
  exit(0);

  cout<<n<<endl;
  Int px=0,py=0;
  for(Int i=0;i<n;i++){
    Int dx=x-px;
    Int dy=y-py;
    Int diff=(n-i)*k-(abs(dx)+abs(dy));
    assert(diff>=0);
    assert(diff%2==0);

    if(diff>0){
      Int a=(abs(dx)+k-1)/k;
      Int b=(abs(dy)+k-1)/k;
      assert((a<(n-i))||(b<(n-i)));

      Int loss=min(diff/2,k);
      if(a<(n-i)){
        dx=(dx>=0?-1:1)*loss;
        dy=(dy>=0?1:-1)*(k-abs(dx));
      }else{
        dy=(dy>=0?-1:1)*loss;
        dx=(dx>=0?1:-1)*(k-abs(dy));
      }
      //assert(abs(dx)+abs(dy)==k);
      //while(abs(dx)+abs(dy)!=k);
    }else{
      if(abs(dx)>=k) dx=(dx>=0?1:-1)*k;
      dy=(dy>=0?1:-1)*(k-abs(dx));
      //while(abs(dx)+abs(dy)!=k);
    }
    //assert(abs(dx)+abs(dy)==k);
    px+=dx;
    py+=dy;
    cout<<px<<" "<<py<<endl;
  }
  //while((px!=x)||(py!=y));
  //assert(px==x);
  //assert(py==y);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:17: error: 'i' was not declared in this scope
   34 |     Int diff=(n-i)*k-(abs(x)+abs(y));
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int k,x,y;
  cin>>k>>x>>y;

  if(abs(x)+abs(y)==k){
    cout<<1<<endl;
    cout<<x<<" "<<y<<endl;
    return 0;
  }

  Int u=(x+y),v=(x-y);
  assert((abs(u)%2)==(abs(v)%2));

  if((k%2==0)&&(abs(u)%2==1)){
    cout<<-1<<endl;
    return 0;
  }

  Int p=(abs(u)+k-1)/k;
  Int q=(abs(v)+k-1)/k;

  Int n=max(p,q);
  if(n==1) n++;
  if((k*n%2)!=(abs(u)%2)) n++;
  assert((k*n%2)==(abs(u)%2));
  {
    Int diff=(n-i)*k-(abs(dx)+abs(dy));
    assert(diff>=0);
  }
  exit(0);

  cout<<n<<endl;
  Int px=0,py=0;
  for(Int i=0;i<n;i++){
    Int dx=x-px;
    Int dy=y-py;
    Int diff=(n-i)*k-(abs(dx)+abs(dy));
    assert(diff>=0);
    assert(diff%2==0);

    if(diff>0){
      Int a=(abs(dx)+k-1)/k;
      Int b=(abs(dy)+k-1)/k;
      assert((a<(n-i))||(b<(n-i)));

      Int loss=min(diff/2,k);
      if(a<(n-i)){
        dx=(dx>=0?-1:1)*loss;
        dy=(dy>=0?1:-1)*(k-abs(dx));
      }else{
        dy=(dy>=0?-1:1)*loss;
        dx=(dx>=0?1:-1)*(k-abs(dy));
      }
      //assert(abs(dx)+abs(dy)==k);
      //while(abs(dx)+abs(dy)!=k);
    }else{
      if(abs(dx)>=k) dx=(dx>=0?1:-1)*k;
      dy=(dy>=0?1:-1)*(k-abs(dx));
      //while(abs(dx)+abs(dy)!=k);
    }
    //assert(abs(dx)+abs(dy)==k);
    px+=dx;
    py+=dy;
    cout<<px<<" "<<py<<endl;
  }
  //while((px!=x)||(py!=y));
  //assert(px==x);
  //assert(py==y);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:17: error: 'i' was not declared in this scope
   34 |     Int diff=(n-i)*k-(abs(dx)+abs(dy));
      |                 ^
a.cc:34:27: error: 'dx' was not declared in this scope; did you mean 'x'?
   34 |     Int diff=(n-i)*k-(abs(dx)+abs(dy));
      |                           ^~
      |                           x
a.cc:34:35: error: 'dy' was not declared in this scope; did you mean 'y'?
   34 |     Int diff=(n-i)*k-(abs(dx)+abs(dy));
      |                                   ^~
      |                                   y