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

#include i<ostream>
using namespace std;

int main(){
	int N, Y, x, y, z;
	
	cin >> N >> Y;  
	
	for (x=0; x<=Y/10000; x++)    //2000
	  for (y=0; y<=Y/5000; y++)   //4000
	  {
	  	    z = N - x - y;
	    	if (z>=0 && x*10000+y*5000+z*1000==Y)
	    	{
	    		cout << x << " " << y << " " << z;
	    		return 0;
	    	}
	  }
	
	cout << "-1 -1 -1";
	return 0;
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include i<ostream>
      |          ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> N >> Y;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include i<ostream>
a.cc:15:25: error: 'cout' was not declared in this scope
   15 |                         cout << x << " " << y << " " << z;
      |                         ^~~~
a.cc:15:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << "-1 -1 -1";
      |         ^~~~
a.cc:20:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include i<ostream>
using namespace std;

int main(){
	int N, Y, x, y, z;
	
	cin >> N >> Y;  
	
	for (x=0; x<=Y/10000; x++)    //2000
	  for (y=0; y<=Y/5000; y++)   //4000
	  {
	  	    z = N - x - y;
	    	if (z<=0 && x*10000+y*5000+z*1000==Y)
	    	{
	    		cout << x << " " << y << " " << z;
	    		return 0;
	    	}
	  }
	
	cout << "-1 -1 -1";
	return 0;
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include i<ostream>
      |          ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> N >> Y;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include i<ostream>
a.cc:15:25: error: 'cout' was not declared in this scope
   15 |                         cout << x << " " << y << " " << z;
      |                         ^~~~
a.cc:15:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << "-1 -1 -1";
      |         ^~~~
a.cc:20:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include i<ostream>
using namespace std;

int main(){
	int N, Y, x, y, z;
	
	cin >> N >> Y;  
	
	for (x=0; x<=Y/10000; x++)    //2000
	  for (y=0; y<=Y/5000; y++)   //4000
	  {
	  	    z = N - x - y;
	    	if (x*10000+y*5000+z*1000==Y)
	    	{
	    		cout << x << " " << y << " " << z;
	    		return 0;
	    	}
	  }
	
	cout << "-1 -1 -1";
	return 0;
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include i<ostream>
      |          ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> N >> Y;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include i<ostream>
a.cc:15:25: error: 'cout' was not declared in this scope
   15 |                         cout << x << " " << y << " " << z;
      |                         ^~~~
a.cc:15:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << "-1 -1 -1";
      |         ^~~~
a.cc:20:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main()
{
	int n,s,x,y,z;
	cin>>n>>s;
	
	for(x=0;x<=s/10000;x++)
		for(y=0;y<=s/5000;y++)
		{
			z=n-x-y;
			
			if(x*10000+y*5000+z*1000=s)
			{
				cout<<x<<" "<<y<<" "<<z<<endl;
				return 0;
			}
		}
		cout<<"-1 -1 -1"<<endl;
		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:42: error: lvalue required as left operand of assignment
   14 |                         if(x*10000+y*5000+z*1000=s)
      |                            ~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int a,q,x,y,z;
	cin>>a>>q;
	for(x=0;x<=q/10000;x++)
	   for(y=0;y<=q/5000;y++)
	   {
	   	z=a-x-y;
	   	if(y=x*10000+y*5000+z*1000)
	   	{
	   		cout<<x<<" "<<y<" "<<z<<endl;
	   		return 0;
	   	}
	   }
	cout<<"-1 -1 -1"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:44: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<'
   13 |                         cout<<x<<" "<<y<" "<<z<<endl;
      |                                         ~~~^~~
      |                                         |    |
      |                                         |    int
      |                                         const char [2]
Language: C++

//085 C
#include<iostream>
#include<cassert>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	int N,Y,x,y,z;
	cin>>N>>Y;
	for(x=0;x<=Y/10000;x++)
	for(y=0;y<=Y/5000;y++)
	{
		z=N-x-y;
		if(x*10000+y*5000+z*1000==Y)
		{
			cout<<x<<' '<<y<<' '<<z;
            return 0;
	    }
	}
	cout<<"-1 -1 -1";
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: expected '}' at end of input
   21 |         return 0;
      |                  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

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

int main()
{
	int n, y;
	cin >> n >> y;
	for ( int i = 0; i < y / 10000; i++ )
		for ( int j = 0; j < y / 5000; j++ )
		{
			int z = n - j - i;
			if ( i * 10000 + j * 5000 + z * 1000 == y)
				cout << x << " " << y << " " << z << endl;
			return 0;
		} 
	cout << "-1 -1 -1" << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: 'x' was not declared in this scope
   13 |                                 cout << x << " " << y << " " << z << endl;
      |                                         ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
    int N, Y;
    int x, y, z;

    cin >> N >> Y;

    for (x=0; n<=Y/10000; x++)
      for (y=0; x<=Y/5000; y++)
      {
          z = N - x - y;
          if (x*10000 + y*5000 + z*1000 == y)
          {
              cout << x << " " << y << " "<< z;
              return 0;
          }
      }

    cout << "-1 -1 -1";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'n' was not declared in this scope
   11 |     for (x=0; n<=Y/10000; x++)
      |               ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

int main()
{
    lld n,y;

    cin >> n >> y;

    y /= 1000;

   // lld dama = y - n;

    lld man = 0, go = 0, sen = 0;

    for(int i = 0; i <= dama / 4 ; i++)
    {
        cout << dama << endl;
        if (dama % 9 == 0)
        {
            man = dama / 9;
            go = i;
            sen = n - man - go;

            if (man + sen + go == n && sen >= 0)
            {
                cout << man << " " <<  go << " " <<  sen << endl;
                return 0;
            }
        }

        dama -= 4;
    }

    cout << -1 << " " <<  -1 << " " <<  -1 << endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:25: error: 'dama' was not declared in this scope
   31 |     for(int i = 0; i <= dama / 4 ; i++)
      |                         ^~~~
Language: C++

"""
9x+4y=Y-N=t
xを固定すると
y=(Y-N-9i)/4 （余りが０でなければ打ち切り）
(0<=i<=N)
z=N-i-y
i,y,zが非負なら出力（O(N)）
"""
ip=input().split()
N=int(ip[0])
Y=int(ip[1])
Y/=int(1000)
xans=-1
yans=-1
zans=-1
for i in range(N+1):
    temp = Y-N-9*i
    if((temp%4)!=0):
        continue
    y=temp/4
    z=N-i-y
    if(y>=0 and z>=0):
        xans=int(i)
        yans=int(y)
        zans=int(z)
        break
print('{0} {1} {2}'.format(xans,yans,zans))

Compiler output:
a.cc:1:3: warning: missing terminating " character
    1 | """
      |   ^
a.cc:1:3: error: missing terminating " character
a.cc:8:3: warning: missing terminating " character
    8 | """
      |   ^
a.cc:8:3: error: missing terminating " character
a.cc:27:7: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
   27 | print('{0} {1} {2}'.format(xans,yans,zans))
      |       ^~~~~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before string constant
    1 | """
      | ^~
Language: C++

#include <iostream>
using namespace std;

int main(){
    int N, Y;
    cin >> N >> Y;
    int a = 0;
    int b = 0;

    for(int i = 0; i <= Y/10000; i++){
        for(int l = 0; l <= N-i; l++){
            if(10000*i+5000*l+1000*(N-i-l) == Y){
                a = i;
                b = l;
            }
        }
    }

    if(a == 0 && b == 0 && 1000*(N-i-l) != Y){
        cout << -1 << " " << -1 << " " << -1 << endl;
    }
    else{
        cout << a << " " << b << " " << N-a-b << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:36: error: 'i' was not declared in this scope
   19 |     if(a == 0 && b == 0 && 1000*(N-i-l) != Y){
      |                                    ^
a.cc:19:38: error: 'l' was not declared in this scope
   19 |     if(a == 0 && b == 0 && 1000*(N-i-l) != Y){
      |                                      ^
Language: C++

#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;
int main()
{
 int n, y;
 cin >> n >> y;
 for(int a=0; a<=n; ++a)
 {
 for(int b=0; a+b<=n; ++b)
 {
 int c = n - a - b;
 int x = a * 10000 + b * 5000 + c * 1000;
 if(x == y){
 cout << a << ' ' << b << ' ' << c << endl;
 system("pause");
 return 0;
 }
 }
 }
 cout << "-1 -1 -1" << endl;
 system("pause");
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: 'cin' was not declared in this scope
   18 |  cin >> n >> y;
      |  ^~~
a.cc:14:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   13 | #include <iterator>
  +++ |+#include <iostream>
   14 | using namespace std;
a.cc:26:2: error: 'cout' was not declared in this scope
   26 |  cout << a << ' ' << b << ' ' << c << endl;
      |  ^~~~
a.cc:26:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:39: error: 'endl' was not declared in this scope
   26 |  cout << a << ' ' << b << ' ' << c << endl;
      |                                       ^~~~
a.cc:14:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
   13 | #include <iterator>
  +++ |+#include <ostream>
   14 | using namespace std;
a.cc:32:2: error: 'cout' was not declared in this scope
   32 |  cout << "-1 -1 -1" << endl;
      |  ^~~~
a.cc:32:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:24: error: 'endl' was not declared in this scope
   32 |  cout << "-1 -1 -1" << endl;
      |                        ^~~~
a.cc:32:24: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<iostream>
using namespace std;
int main(){
	int N,Y;
	cin>>N>>Y;
	for(int a=1;a<=Y/10000;a++)
		for(int b=1;b<=Y/10000;b++)
		{
			int c=N-a-b;
			if(a+b+c=N && a*10000+b*5000+c*1000=Y){
				cout<<a<<" "<<b<<" "<<c;
				return 0;
			}
		}
	cout<<"-1 -1 -1";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: lvalue required as left operand of assignment
   10 |                         if(a+b+c=N && a*10000+b*5000+c*1000=Y){
      |                                  ~~^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int N,Y;
	cin>>N>>Y;
	for(int a=1;a<=y/10000;a++)
		for(int b=1;b<=y/10000;b++)
		{
			int c=N-a-b;
			if(a+b+c=N && a*10000+b*5000+c*1000=Y){
				cout<<a<<" "<<b<<" "<<c;
				return 0;
			}
		}
	cout<<"-1 -1 -1";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: 'y' was not declared in this scope
    6 |         for(int a=1;a<=y/10000;a++)
      |                        ^
a.cc:10:36: error: lvalue required as left operand of assignment
   10 |                         if(a+b+c=N && a*10000+b*5000+c*1000=Y){
      |                                  ~~^~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>

int main()
{
    //O(1)できるのか
    int N,Y;
    scanf("%d %d",&N,&Y);

    //連立方程式ごちゃごちゃすると9000x+4000y=Y-1000N
    //t=(Y-1000N)/1000と置くと9x+4y=t(Ymod1000=0よりtは整数)
    int t=(Y-1000*N)/1000;

    //x,yの解の一つとして(t,-2t)が考えられるので
    //9(x-t)+4(y+2t)=0
    //9(x-t)=4(y+2t)
    //9と4は互いに素なのでkを整数とするとx-t=4k
    //x=4k+t
    //代入すると36k=-4(y+2t)
    //y=-9k-2t
    //x,y,z>=0なので
    //4k+t>=0
    //-t/4<=k
    //-9k-2t>=0
    //k<=-2t/9
    //(4k+t)+(-9k-2t)<=N
    //-5k-t<=N
    //(-t-N)/5<=k
    //まとめ
    //max(-t/4,(-t-N)/5)<=k<=-2t/9
    int k = Max(-t/4,(-t-N)/5);
    int x=4*k+t;
    int y=-9*k-2*t;
    int z=N-x-y;
    if(x>=0&&y>=0&&z>=0){
        printf("%d %d %d\n",x,y,z);
    }else{
        printf("-1 -1 -1\n");
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:13: error: implicit declaration of function 'Max' [-Wimplicit-function-declaration]
   31 |     int k = Max(-t/4,(-t-N)/5);
      |             ^~~
Language: C++

#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

using namespace std;

int main() {
    int n, y;
    cin >> n >> y;
    y /= 1000;

    int rhs = y - n;
    if (rhs < 0) {
        printf("%d %d %d\n", a, b, c);
        return 0;
    }

    int a = -1, b = -1, c = -1;
    int ord[] = { 0, 4, 8, 3, 7, 2, 6, 1, 5 };
    int i = 0;
    while (ord[i] != rhs % 9)
        i++;
    if (rhs - 4 * i < 0 || n - i - (rhs - 4 * i) / 9 < 0) {
        printf("%d %d %d\n", a, b, c);
    }
    else {
        b = i;
        a = (rhs - 4 * b) / 9;
        c = n - i - a;
        printf("%d %d %d\n", a, b, c);
    }



    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:30: error: 'a' was not declared in this scope
   34 |         printf("%d %d %d\n", a, b, c);
      |                              ^
a.cc:34:33: error: 'b' was not declared in this scope
   34 |         printf("%d %d %d\n", a, b, c);
      |                                 ^
a.cc:34:36: error: 'c' was not declared in this scope
   34 |         printf("%d %d %d\n", a, b, c);
      |                                    ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n,y;
  cin>>n>>y;
  y=y/1000-n;
  int x=y%4;
  int r=x+(y-9*x)/36*4;
  int q=(y-9*r)/4;
  if(r>=0&&q>=0&&q+r<=n)
    {cout<<r<<q<<n-q-r<<endl;
     }
  else
    {cout <<"-1 -1 -1"<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>
#include <set>
#include <utility>
#include <tuple>

using namespace std;

typedef pair<int, pair<int, int> > P;

int table[2001][20001][3];

/*
void maketable(){
	for (int i = 1; i < 2001; i++){
		for (int j = 1; j < 20001; j++){
			table[i][j][0] = table[i][j][1] = table[i][j][2] = 0;
		}
	}

	table[1][1][0] = 1; table[1][1][1] = table[1][1][2] = 0;
	table[1][10][0] = 0; table[1][10][1] = 0; table[1][10][2] = 1;
	table[1][5][0] = 0; table[1][5][1] = 1; table[1][5][2] = 0;


	for (int i = 2; i < 2001; i++){
		for (int j = 2; j < 20001; j++){
			if (table[i-1][j-1][0] != 0 || table[i-1][j-1][1] != 0 || table[i-1][j-1][2] != 0){
				table[i][j][0] = table[i-1][j-1][0] + 1;
				table[i][j][1] = table[i-1][j-1][1];
				table[i][j][2] = table[i-1][j-1][2];
			}
			else if (j >= 5){
				if (table[i-1][j-5][0] != 0 || table[i-1][j-5][1] != 0 || table[i-1][j-5][2] != 0){
					table[i][j][0] = table[i-1][j-5][0];
					table[i][j][1] = table[i-1][j-5][1] + 1;
					table[i][j][2] = table[i-1][j-5][2];
				}
			}
			else {
				if (j >= 10){
					if (table[i-1][j-10][0] != 0 || table[i-1][j-10][1] != 0 || table[i-1][j-10][2] != 0){
						table[i][j][0] = table[i-1][j-10][0] + 1;
						table[i][j][1] = table[i-1][j-10][1];
						table[i][j][2] = table[i-1][j-10][2];
					}
				}
			}
		}
	}
}
*/


int 

int main(void){

	int n, y;

	cin >> n >> y;

	int a = -1, b = -1, c = -1;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			if (i + j > n)
				break;
			if (i + j*5 + (n - i - j) * 10 == y){
				a = i;
				b = j;
				c = n - j - i;
			}
		}
	}

	cout << a << " " << b << " " << c << endl;

}

Compiler output:
a.cc:55:1: error: two or more data types in declaration of 'main'
   55 | int
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 32);
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll>> vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl

/*--------------------template--------------------*/


int main() {
    cin >> n >> m;
    for (int i = 0; i <= m / 10000;i++)
    {
        for (int j = 0; j <= (m - i * 10000) / 5000;j++)
        {
            ll a = (m - i * 10000 - j * 5000);
            if(a%1000==0&&a/1000+j+i==n){
                cput << i << " " << j << " " << a / 1000 << endl;
                return 0;
            }
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'cput' was not declared in this scope
   37 |                 cput << i << " " << j << " " << a / 1000 << endl;
      |                 ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<iomanip>
#include<utility>
#include<cmath>
#include<set>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<map>
#include<set>
#include<cstring>
#include<iterator>
#include<bitset>
#include<assert.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, pair<int, int> > PP;
typedef vector<int> VI;
typedef vector<long long int> VL;
static const int MOD = 1000000007;
static const int INF = 2147483647;
//static const long long INF = 9223372000000000000;
//static const long long INF = 9223372000000000000/2;
//static const int INF = 1000010000;
//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define NP next_permutation
#define PQ priority_queue
#define UB upper_bound
#define LB lower_bound
#define ALL(x) (x).begin(),(x).end()
#define SZ(a) int((a).size())
#define LEN(a) int((a).length())
#define MAX(a,b,c) max((a),max((b),(c)))
#define MIN(a,b,c) min((a),min((b),(c)))
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REP1(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREP1(i,x) for(int i=((int)(x));i>0;i--)
//#define int ll
//struct edge {int to,cost;};

bool rullonz = false;
int n;
void dfs(int a, int b, int c) {
	if (rullonz) return;
	if (a + b + c == n) {
		printf("%d %d %d\n", c, b, a);
		rullonz = true;
		return;
	}
	if (a + b + c < n) return;
	if (a >= 5) dfs(a - 5, b + 1, c);
	if (a >= 10) dfs(a - 10, b, c + 1);
}

signed main() {
	int y;
	scanf_s("%d %d",&n, &y);
	dfs(y / 1000, 0, 0);
	if (!rullonz) puts("-1 -1 -1");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   76 |         scanf_s("%d %d",&n, &y);
      |         ^~~~~~~
      |         scanf
Language: C++

def isNatural(f)
	return f - f.to_i == 0 && f >= 0
end

def main(input)
	n = input[0]  # 枚数
	y = input[1]  # 金額
	
	if y > 10000 * n || y % 1000 != 0 then
		puts "-1 -1 -1"
		return
	end
	
	if 1000 * n == y then
		puts "0 0 " + n.to_s
		return
	elsif 5000 * n == y then
		puts "0 " + n.to_s + " 0"
		return
	elsif 10000 * n == y then
		puts n.to_s + " 0 0"
		return
	end
	
	c = n * 10 - y / 1000
	x = c / 9
	if !isNatural(x.to_f) then
		puts "-1 -1 -1"
	end
	
	yy = (c - 9 * x) / 5.0
	
	if !isNatural(yy) then
		puts "-1 -1 -1"
		return
	end
	
	z = n - x - yy
	if z < 0 then
		puts "-1 -1 -1"
	end
	
	puts x.to_s + " " + yy.to_i.to_s + " " + z.to_i.to_s
end

main gets.chomp.split(" ").map(&:to_i)


Compiler output:
a.cc:6:23: error: stray '#' in program
    6 |         n = input[0]  # 枚数
      |                       ^
a.cc:7:23: error: stray '#' in program
    7 |         y = input[1]  # 金額
      |                       ^
a.cc:1:1: error: 'def' does not name a type
    1 | def isNatural(f)
      | ^~~
Language: C++

#include<cstdio>

using namespace std;

int N, Y;

int main() {
    cin >> N >> Y;
    Y /= 1000;
    int a = Y - N;
    int am = a % 4;
    int b = 5 * N - Y;
    int x = (max((-b + 4) / 5, 0) + 3 - am) / 4 * 4 + am;

    if (am == (4 - b % 4) % 4 and x <= a / 9) printf("%d %d %d\n", x, (a-9*x)/4, (b+5*x)/4);
    else printf("%d %d %d\n")
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> N >> Y;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstdio>
  +++ |+#include <iostream>
    2 | 
a.cc:13:14: error: 'max' was not declared in this scope
   13 |     int x = (max((-b + 4) / 5, 0) + 3 - am) / 4 * 4 + am;
      |              ^~~
a.cc:16:30: error: expected ';' before '}' token
   16 |     else printf("%d %d %d\n")
      |                              ^
      |                              ;
   17 | }
      | ~
Language: C++

#include<cstdio>

int main(void){
  int x=-1,y=-1,z=-1;
  int n,m;

  scanf("%d %d",&n,&m);

  for(int i=0;i<=n;i++){
    for(int j=0;i+j<=n;j++){
      int k = n-i-j;
      if(i*10000+j*5000+k*1000==m){
        x=i; y=j; z=k;
        break;
      }
    }
  }
  printf("%d %d %d\n",x,y,z);


Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: expected '}' at end of input
   18 |   printf("%d %d %d\n",x,y,z);
      |                              ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <set>

using namespace std;

bool judge(int x, int y, int z, int yen)
{
	if (10000*x+5000*y+1000*z == yen)
	{
		cout << x << " " << y << " " << z << "\n";
		return true;
	}

	return false;
}

int main(int argc, char const *argv[])
{
	int n;

	int yen;

	cin >> n >> yen;

	for (int i = 0; i <= 2000; ++i)
	{
		for (int j = 0; j <= 2000; ++i)
		{
			int k = n-i-j
			if(k < 0) continue;
			if(judge(i,j,k,yen)) return 0;
		}
	}

	cout << -1 << " " << -1 << " " << -1 << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:36:25: error: expected ',' or ';' before 'if'
   36 |                         if(k < 0) continue;
      |                         ^~
Language: C++

#include <iostream>
using namespace std;
 
int main() {
	int n, yen;
	cin >> n >> yen;
	yen = yen / 1000;
 
	int money_x = -1, money_y = -1, money_z = -1;
 
	for (int x = 0; x <= n; ++x) {
		for (int y = 0; y <= n - x; ++y) {
			z = n - x - y;
			if ((10 * z) + (5 * y) + x == yen) {
				money_x = z;
				money_y = y;
				money_z = x;
				break;
			}
		}
	}
 
	cout << money_x << ' ' << money_y << ' ' << money_z << endl;
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'z' was not declared in this scope
   13 |                         z = n - x - y;
      |                         ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <set>

using namespace std;

bool judge(long long int x, long long int y, long long int z, long long int yen)
{
	if (10000*x+5000*y+1000*z == yen)
	{
		cout << x << " " << y << " " << z << "\n";
		return true;
	}

	return false;
}

int main(int argc, char const *argv[])
{
	int n;

	long long int yen;

	cin >> n >> yen;

	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++i)
		{
			if(n-i-j < 0) continue;
			if(judge(n, i, j ,n-i-j ,yen)) return 0;
		}
	}

	cout << -1 << " " << -1 << " " << -1 << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:36:33: error: too many arguments to function 'bool judge(long long int, long long int, long long int, long long int)'
   36 |                         if(judge(n, i, j ,n-i-j ,yen)) return 0;
      |                            ~~~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:12:6: note: declared here
   12 | bool judge(long long int x, long long int y, long long int z, long long int yen)
      |      ^~~~~
Language: C++

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

int main(){
    ios_base::sync_with_stdio(0);
    int n,y;
    cin>>n>>y;
    int ans = 0;
    for(int i=0;i<=2000;i++){
        if(i*10000>y||i>n) break;
        for(int j=0;j<=2000;j++){
            if(i*10000+j*5000>y||i+j>n) break;
            int z = y-i*10000-j*5000
            if(z%1000==0){
                cout<<i<<' 'j<<' 'z/1000;
                return 0;
            }
        }
    }
    cout<<"-1 -1 -1";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected ',' or ';' before 'if'
   14 |             if(z%1000==0){
      |             ^~
Language: C++

# include <iostream>
# include <bool>
using namespace std;
int d,l,m,f,n;
bool ifok(int l,int m,int f)
{
	if(l*10000+m*5000+f*1000==d)
	return true;
	else
	return false;
}
int main ()
{
	cin>>n>>d;
	for(int i=0;i<n;i++)
	{
		for(int j=0;i+j<=n;j++)
		{
			if(ifok(i,j,n-i-j))
			{
				cout<<i<<' '<<j<<' '<<n-i-j;
				return 0;
			}
		}
	}
	cout<<"-1 -1 -1";
	return 0;

Compiler output:
a.cc:2:11: fatal error: bool: No such file or directory
    2 | # include <bool>
      |           ^~~~~~
compilation terminated.
Language: C++

# include <iostream>
# include <bits/stdc++.h>
using namespace std;
int d,l,m,f,n;
bool ifok(int l,int m,int f)
{
	if(l*10000+m*5000+f*1000==d)
	return true;
	else
	return false;
}
int main ()
{
	cin>>n>>d;
	for(int i=0;i<n;i++)
	{
		for(int j=0;i+j<=n;j++)
		{
			if(ifok(i,j,n-i-j))
			{
				cout<<i<<' '<<j<<' '<<n-i-j;
				return 0;
			}
		}
	}
	cout<<"-1 -1 -1";
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: expected '}' at end of input
   27 |         return 0;
      |                  ^
a.cc:13:1: note: to match this '{'
   13 | {
      | ^
Language: C++

#include <cstdio>
#include <iostream>

struct xyz{int x; int y; int z;};
int N, Y;

xyz solve(struct xyz ans){
    int deff = N - (ans.x + ans.y + ans.z);
    if(Y%1000 || deff<0){
        ans.x = ans.y = ans.z = -1;
        return ans;
    }

    if(deff/9){
        for(int i=0; i<deff/9; i++){
            if(ans.x==0)break;
            ans.x--;
            ans.z += 10;
        }
    }

    deff = N - (ans.x + ans.y + ans.z);
    if(deff/5){
        for(int i=0; i<deff/5; i++){
            if(ans.x==0)break;
            ans.x--;
            ans.y++;
            ans.z += 5;
        }
    }

    deff = N - (ans.x + ans.y + ans.z);
    if(deff/4){
        for(int i=0; i<deff/4; i++){
            if(ans.y==0)break;
            ans.y--;
            ans.z += 5;
        }
    }

    deff = N - (ans.x + ans.y + ans.z);
    if(deff){
        for(int i=0; i<deff; i++){
            if(ans.x==0)break;
            ans.x--;
            ans.y += 2;
        }
    }

    deff = N - (ans.x + ans.y + ans.z);
    if(deff>0) ans.x = ans.y = ans.z = -1;

    return ans;
}

int main(void){
    cin >> N >> Y;

    xyz ans;
    ans.x = Y/10000;
    ans.y = (Y%10000)/5000;
    ans.z = Y%5000;

    ans = solve(ans);

    printf("%d %d %d\n", ans.x, ans.y, ans.z);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   57 |     cin >> N >> Y;
      |     ^~~
      |     std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n;
long long y;
int f(int i)
{
	int j;
	for(j=0;j<=n;j++)
	{
		if(((n-i-j)*1000+j*5000+i*10000)==y&&(i+j+(n-i-j))==n)
		{
			printf("%d %d %d",i,j,k);
			return 1;
		}
	}
	return 0;
}
int main()
{
	int i,j,k,tmp=1;
	scanf("%d\n%ld",&n,&y);
	for(i=0;i<=n;i++)
	{
		if(f(i)==1)
		{
			tmp=0;
			break;
		}
	}
	if(tmp==1)
		printf("-1 -1 -1");
	return 0;
}

Compiler output:
a.cc: In function 'int f(int)':
a.cc:12:47: error: 'k' was not declared in this scope
   12 |                         printf("%d %d %d",i,j,k);
      |                                               ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 10000000007; //10^9+7

int dp[2002][2002][2002];
ll n,y;

int main(){
  cin>>n>>y;
  int sum=y/1000;
  REP(ten,2002)REP(five,2002){
    int one=n-ten-five;
    if(sum==one+five*5+ten*10){
      print(ten<<" "<<five<<" "<<one);
      return 0;
    }
  }
}

Compiler output:
/tmp/cceCHmcp.o: in function `main':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cceCHmcp.o
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/cceCHmcp.o
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/cceCHmcp.o
a.cc:(.text+0x7c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cceCHmcp.o
collect2: error: ld returned 1 exit status
Language: C++

#include <cstdio>
#include <iostream>

struct xyz{int x; int y; int z;};
int N, Y;

xyz solve(struct xyz ans){
    int deff = N - (ans.x + ans.y + ans.z);
    if(Y%1000 || deff<0){
        ans.x = ans.y = ans.z = -1;
        return ans;
    }

    if(deff/9){
        for(int i=0; i<deff/9; i++){
            if(ans.x==0)break;
            ans.x--;
            ans.z += 10;
        }
    }

    deff = N - (ans.x + ans.y + ans.z);
    if(deff/5){
        for(int i=0; i<deff/5; i++){
            if(ans.x==0)break;
            ans.x--;
            ans.y++;
            ans.z += 5;
        }
    }

    deff = N - (ans.x + ans.y + ans.z);
    if(deff/4){
        for(int i=0; i<deff/4; i++){
            if(ans.y==0)break;
            ans.y--;
            ans.z += 5;
        }
    }

    deff = N - (ans.x + ans.y + ans.z);
    if(deff){
        for(int i=0; i<deff; i++){
            if(ans.x==0)break;
            ans.x--;
            ans.y += 2;
        }
    }

    deff = N - (ans.x + ans.y + ans.z);
    if(deff>0) ans.x = ans.y = ans.z = -1;

    return ans;
}

int main(void){
    scanf("%d %d", &N, &Y);

    xyz ans;
    ans.x = Y/10000;
    ans.y = (Y%10000)/5000;
    ans.z = y%5000;

    ans = solve(ans);

    printf("%d %d %d\n", ans.x, ans.y, ans.z);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:13: error: 'y' was not declared in this scope
   62 |     ans.z = y%5000;
      |             ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 10000000007; //10^9+7

int dp[2002][2002][2002];
ll n,y;

int main(){
  cin>>n>>y;
  int one=0,five=0,ten=0;
  one=y/1000;
  if(one+five+ten==n){
    print(ten<<" "<<five<<" "<<one);
    return 0;
  }
  if(one<n){
    print("-1 -1 -1");
    return 0;
  }
  int cp=0;
  while(one>4){
    ten=0;
    one-=5;
    five++;
    cp=five;
    if(one+five+ten==n){
      print(ten<<" "<<five<<" "<<one);
      return 0;
    }
    while(cp>1){
      cp-=2;
      ten++;
      if(one+cp+ten==n){
        print(ten<<" "<<cp<<" "<<one);
        return 0;
      }
    }
  }
  print("-1 -1 -1");
  return 0;
}

Compiler output:
/tmp/ccCsSvLy.o: in function `main':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccCsSvLy.o
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccCsSvLy.o
a.cc:(.text+0x4e): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccCsSvLy.o
a.cc:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccCsSvLy.o
a.cc:(.text+0x115): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccCsSvLy.o
a.cc:(.text+0x187): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccCsSvLy.o
a.cc:(.text+0x229): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccCsSvLy.o
collect2: error: ld returned 1 exit status
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 10000000007; //10^9+7

int dp[2002][2002][2002];
ll n,y;

int main(){
  cin>>n>>y;
  int one=0,five=0,ten=0;
  one=y/1000;
  if(one+five+ten==n){
    print(ten<<" "<<five<<" "<<one);
    return 0;
  }
  if(one<n){
    print("-1 -1 -1");
    return 0;
  }
  int cp=0;
  while(one>4){
    ten=0;
    one-=5;
    five++;
    cp=five;
    if(one+five+ten==n){
      print(ten<<" "<<five<<" "<<one);
      return 0;
    }
    print("a"<<" "<<ten<<" "<<five<<" "<<one);///
    while(cp>1){
      cp-=2;
      ten++;
      if(one+cp+ten==n){
        print(ten<<" "<<cp<<" "<<one);
        return 0;
      }
      print("b"<<" "<<ten<<" "<<cp<<" "<<one);///
    }
  }
  print("-1 -1 -1");
  return 0;
}

Compiler output:
/tmp/ccC6O0S2.o: in function `main':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccC6O0S2.o
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccC6O0S2.o
a.cc:(.text+0x4e): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccC6O0S2.o
a.cc:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccC6O0S2.o
a.cc:(.text+0x115): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccC6O0S2.o
a.cc:(.text+0x187): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccC6O0S2.o
a.cc:(.text+0x2c4): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccC6O0S2.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<string.h>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
using namespace std;
int main() 
{
int N;
int Y;
cin>>N>>Y;
int a=10000,b=5000,c=1000;
for(int d=0;d<=N;d++)
{for(int e=0;e<=N;e++)
{for(int f=0;f<=N;f++)
if(d*a+e*b+f*c==Y)
{cout<<d' 'e' 'f' ';
system("pause");
return 0;}
}
}
cout<<"-1"' '"-1"' '"-1";
system("pause");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: expected ';' before user-defined character literal
   22 | {cout<<d' 'e' 'f' ';
      |         ^~~~
      |         ;
a.cc:27:11: error: expected ';' before '\x20'
   27 | cout<<"-1"' '"-1"' '"-1";
      |           ^~~
      |           ;
Language: C++

#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    long long n,y,flag=0,c;
    cin>>n>>y;
    for(int a=0;a<=y/10000;a++){
        for(int b=0;b<=y/5000;b++){
                c=n-a-b
                if(a+b+c==n&&a*10000+b*5000+c*1000==y){flag=1;cout<<a<<' '<<b<<' '<<c;}
        if(flag==1) break;
        }
    if(flag==1) break;
    }
    if(flag==0) cout<<"-1 -1 -1";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before 'if'
   11 |                 c=n-a-b
      |                        ^
      |                        ;
   12 |                 if(a+b+c==n&&a*10000+b*5000+c*1000==y){flag=1;cout<<a<<' '<<b<<' '<<c;}
      |                 ~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

long long main(long long argc, char const *argv[]) {
	long long n;
	unsigned long long y;
	std::cin >> n >> y;

	long long man = 10000;
	long long gsen = 5000;
	long long sen = 1000;
	// 上限値より高い金額
	if (y / man > n) {
		std::cout << "-1 -1 -1" << '\n';
	}
	// 下限値より低い金額
	if (y / sen < n) {
		std::cout << "-1 -1 -1" << '\n';
	}

	// 3段鶴亀
	y = y - sen * n;
	// y円を4000円と9000円で作成できるかを探索すればよい
	// つまり、
	// y = 4000 * p + 9000 * q を探索
	long long p,q;
	p = q = 0;

	p = y / 9000;
	if (y % 9000 != 0) {
		p++;
	}
	long long r = p * 9000 - y;
	p = p - (r / 1000);
	q = 2 * r / 1000;
	// これでとりあえず解が出た

	if (p >= 0 && q >= 0 && p + q <= n) {
		std::cout << p << ' ' << q << ' ' << n-p-q << '\n';
	}
	else {
		std::cout << "-1 -1 -1" << '\n';
	}

	return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc:5:11: warning: first argument of 'int main(long long int, const char**)' should be 'int' [-Wmain]
    5 | long long main(long long argc, char const *argv[]) {
      |           ^~~~
Language: C++

#include<stdio.h>
#include<ctype.h>
struct money{
	int ans,m;
}a[3]=
{{0,10000},{0,5000},{0,1000}};

inline int read(){
	int x=0;bool f=1;char ch=getchar();
	while(!isdigit(ch))
		if(ch=='-')
			f=0;
	while(isdigit(ch)){
		x=x*10+ch-'0';
		ch=getchar();
	}
	return(f)?x:-x;
}

inline void write(int x){
	if(x<0)putchar('-'),x=-x;
	if(x>9)write(x/10);
	putchar(x%10+48);
}

int main(){
	int n=read(),x=read();
	if(n*a[0].m<x){printf("-1 -1 -1\n");return 0;}
	if(x%a[0].m==0&&x/a[0].m==n){
		printf("%d 0 0\n",x/a[0].m);return 0;
	}
	if(x%a[1].m==0&&x/a[1].m==n){
		printf("0 %d 0\n",x/a[1].m);return 0;
	}
	if(x%a[2].m==0&&x/a[2].m==n){
		printf("0 0 %d\n",x/a[2].m);return 0;
	}
	for(int i=0;i<=x/10000;++i){
		for(int j=0;j<=x/5000;++j){
				int k=n-i-j;
				if(i*10000+j*5000+k*1000==x&&
				k>=0){
					printf("%d %d %d\n",i,j,k);
					return 0;
				}
			}
		}
	}
	printf("-1 -1 -1\n");
	return 0;
}

Compiler output:
a.cc:49:15: error: expected constructor, destructor, or type conversion before '(' token
   49 |         printf("-1 -1 -1\n");
      |               ^
a.cc:50:9: error: expected unqualified-id before 'return'
   50 |         return 0;
      |         ^~~~~~
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <set>
#include <string>
#include <cstring>
#include <cmath>
#include <map>
#include <stack>
#define N 1005
using namespace std;
typedef long long ll;
int main()
{
    int n,y;
    scanf("%d%d",&n,&y);
    int a=1000,b=5000,c=10000;
    int s1=-1,s2=-1,s3=-1,n1,n2,n3;
    if(n*1000>y||n*10000<y)
        s1=-1,s2=-1,s3=-1;
    else
    {
        n3=y/c;
        for(int i=n3; i>=0; i--)
        {
            int flag=0;
            n2=(y-i*10000)/5000;
            for(int j=n2; j>=0; j--)
            {

                n1=(y-i*10000-j*5000)/1000;
                if(i+j+k==n&&i*c+j*b+k*a==y)
                {
                    s1=k,s2=j,s3=i;
                    flag=1;
                    break;
                }


            }
            if(flag)
                break;
        }
    }
    printf("%d %d %d\n",s3,s2,s1);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:24: error: 'k' was not declared in this scope
   32 |                 if(i+j+k==n&&i*c+j*b+k*a==y)
      |                        ^
Language: C++

#include <iostream>

int main()
{
    int n = 0;
    int money = 0;

    std::cin >> n;
    std::cin >> money;

    bool suc_f = false;

    int i,j,k;

    if(y%1000 != 0)
    {
        std::cout<<"-1 -1 -1"<<std::endl;
        return 0;
    }

    for(i = 0;i <= n;i++)
    {
        for(j = 0;j <= n - i;j++)
        {
            for(k = 0;k <= n - i - j;k++)
            {
                if(i*10000+j*5000+k*1000 == money)
                {
                    suc_f = true;

                    goto l;
                }
            }
        }
    }

    l:

    if(suc_f)std::cout<<i<<" "<<j<<" "<<k<<std::endl;
    else std::cout<<"-1 -1 -1"<<std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'y' was not declared in this scope
   15 |     if(y%1000 != 0)
      |        ^
Language: C++

#include<iostream>
using namespace std;
int main() {
    int A[3];
  	A[0] = -1;
  	A[1] = -1;
    A[2] = -1;
	int N, Y;
  	cin >> N >> Y;
  	Y /= 10;
  	for(int i = 0; 10 * i <= Y; i++) {
      	for(int j = 0; (10 * i + 5 * j) <= Y; j++) {
          	if(N + 9 * i + 4 * j) == Y) {
              	A[0] = i;
              	A[1] = j;
              	A[2] = N - i - j;
            }
        }
    }
  	
    cout << A[0] << A[1] << A[2] << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:39: error: expected primary-expression before '==' token
   13 |                 if(N + 9 * i + 4 * j) == Y) {
      |                                       ^~
Language: C++

#include<iostream>
using namespace std;
int main() {
    int A[3];
  	A[0] = A[1] = A[2] = -1;
	int N, Y;
  	cin >> N >> Y;
  	Y /= 10;
  	for(int i = 0; 10 * i <= Y; i++) {
      	for(int j = 0; (10 * i + 5 * j) <= Y; j++) {
          	if(N + 9 * i + 4 * j) == Y) {
              	A[0] = i;
              	A[1] = j;
              	A[2] = N - i - j;
            }
        }
    }
  	
    cout << A[0] << A[1] << A[2] << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:39: error: expected primary-expression before '==' token
   11 |                 if(N + 9 * i + 4 * j) == Y) {
      |                                       ^~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int Y;
  cin>>Y;
  int m=Y/10000;
  int d[m+1];
  for(int i=0;i<=m;i++)d[i]=Y-i*10000;
  for(int i=0;i<=m;i++){
    int k=d[i]/5000;
    for(int j=0;j<=k;j++){
      int t=d[i]-j*5000;
      if(t==(Y-i-j)*1000){
        cout<<i<<''<<j<<''<<(Y-i-j);
        return 0;
      }
    }
  }
  cout<<-1<<''<<-1<<''<<-1;
  return 0;
}

Compiler output:
a.cc:16:18: error: empty character constant
   16 |         cout<<i<<''<<j<<''<<(Y-i-j);
      |                  ^~
a.cc:16:25: error: empty character constant
   16 |         cout<<i<<''<<j<<''<<(Y-i-j);
      |                         ^~
a.cc:21:13: error: empty character constant
   21 |   cout<<-1<<''<<-1<<''<<-1;
      |             ^~
a.cc:21:21: error: empty character constant
   21 |   cout<<-1<<''<<-1<<''<<-1;
      |                     ^~
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b)	for(int i=a;i<=b;i++)
#define rrep(i,a,b)	for(int i=a;i>=b;i--)
using namespace std;
typedef long long ll;
const int N=1e6+5,inf=0x3f3f3f3f;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,y,x,y,z;
	x=y=z=-1;
	cin>>n>>y;
	rep(i,0,n)
	{
		rep(j,0,n-i)
		{
			int k=n-i-j;
			if(k>=0&&i*10000+j*5000+k*1000==y)
			{
				x=i,y=j,z=k;
				break;
			}
		}
	}
	cout<<x<<' '<<y<<' '<<z<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: redeclaration of 'int y'
   11 |         int n,y,x,y,z;
      |                   ^
a.cc:11:15: note: 'int y' previously declared here
   11 |         int n,y,x,y,z;
      |               ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
 
int n;
int y;
int flag = 0;
int hoge;
int huga;
int piyo;
 
int main(void) {
	scanf("%d %d", &n, &y);
	for(int i = 0; i <= n; i++) {
		for(int j = 0; j <= n - i; j++) {
				if(10000 * i + 5000 * j + 1000 * (n - i - j) == y) {
					flag = 1;
					hoge = i;
					huga = j;
					piyo = k;
					goto FINISH;
			}
		}
	}
	FINISH:
	if(flag == 0) {
		hoge = -1;
		huga = -1;
		piyo = -1;
	}
	printf("%d %d %d\n", hoge, huga, piyo);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:48: error: 'k' undeclared (first use in this function)
   20 |                                         piyo = k;
      |                                                ^
main.c:20:48: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

/*

Coded by peyha X

*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int NMAX=2000,VALMAX=2*1e4;
int n,y,billets[3]={1,5,10},prec[2][VALMAX];
bool possible[2][VALMAX];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin >> n >> y;
	y/=1000;
	
	for(int i=0;i<=n;i++){
		for(int j=0;j<=n-i;j++){
			int k=n-i-j;
			if(10*i+5*j+k==y){
				cout << i << ' ' <<j << ' ' << k << '\n';
				return 0;
			}
		}
	}
	
	cout << "-1 -1 -1\n";20 196000
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:32: error: expected ';' before numeric constant
   34 |         cout << "-1 -1 -1\n";20 196000
      |                                ^~~~~~~
      |                                ;
Language: C

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,y;
    cin >> n >> y;
    y=y/1000;
    int flag=0,X,Y;
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=n-i;j++)
        {
            if(9*i+4*j+n==y)
            {
                flag=1;
                X=i,Y=j;
                break;
            }
        }
    }
    if(flag)
    {
        cout << X << ' ' << Y << ' ' << (n-X-Y) << endl;
    }
    else
        printf("1 1 1\n");
    return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.