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

#include<stack>
#include<cassert>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=2e3+1;
int n,p[maxn],a[maxn],deg[maxn],dep[maxn];
int pos[maxn],bot[maxn],top[maxn];
bool exist[maxn],red[maxn],sorted[maxn];
vector<int>opt;

void Rotate(int u){
	opt.push_back(u);
	int tmp=a[0];
	stack<int>sta;
	while(1){
		sta.push(u);
		if(!u)break;
		u=p[u];
	}
	while(1){
		u=sta.top();
		sta.pop();
		if(sta.empty()){
			a[u]=tmp;
			break;
		}
		a[u]=a[sta.top()];
	}
}

void Clear(){
	for(int i=n;~i;--i){
		if(exist[i]&&!deg[i]&&a[i]==i){
			exist[i]=0;
			--deg[p[i]];
		}
	}
}

bool cmp(const int &a, const int &b){
	if(red[a]!=red[b])return red[a];
	return dep[a]>dep[b];
}

bool Doit(){
	Clear();
	if(!exist[0])return 0;
	for(int i=0;i<n;++i)red[i]=sorted[i]=0;
	int tot=0;
	for(int i=n-1;~i;--i){
		if(!exist[i])continue;
		pos[tot++]=i;
		if(!deg[i]){
			red[i]=1;
			bot[i]=top[i]=i;
		}
		if(!red[i])continue;
		if(deg[p[i]]==1){
			red[p[i]]=!;
			bot[p[i]]=bot[i];
		}
	}
	sort(pos,pos+tot,cmp);
	for(int i=0;i<tot;){
		if(red[a[0]]){
			int u=bot[a[0]];
			while(sorted[u]&&a[u]>a[0])
			u=p[u];
			Rotate(u);
			u=bot[u];
			sorted[top[u]]=1;
			top[u]=p[top[u]];
		}else Rotate(pos[i++]);
		while(i<tot&&sorted[pos[i]])++i;
	}
	return 1;
}

int main(){
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=0;i<n;++i)exist[i]=true;
	for(int i=1;i<n;++i){
		cin>>p[i];
		++deg[p[i]];
		dep[i]=dep[p[i]]+1;
	}
	for(int i=0;i<n;++i)cin>>a[i];
	Doit();
	while(Doit());
	for(int i=0;i<n;++i)assert(a[i]==i);
	assert(opt.size()<=25000);
	cout<<opt.size()<<"\n";
	for(int i=0;i<opt.size();++i)
		cout<<opt[i]<<"\n";
	return 0;
}

Compiler output:
a.cc:10:1: error: 'vector' does not name a type
   10 | vector<int>opt;
      | ^~~~~~
a.cc: In function 'void Rotate(int)':
a.cc:13:9: error: 'opt' was not declared in this scope
   13 |         opt.push_back(u);
      |         ^~~
a.cc: In function 'bool Doit()':
a.cc:60:36: error: expected primary-expression before ';' token
   60 |                         red[p[i]]=!;
      |                                    ^
In file included from /usr/include/c++/14/cassert:44,
                 from a.cc:2:
a.cc: In function 'int main()':
a.cc:93:16: error: 'opt' was not declared in this scope
   93 |         assert(opt.size()<=25000);
      |                ^~~
Language: C++

// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>

using namespace std;

#define rep(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
template<typename T> inline bool smin(T &a, const T &b)   { return a > b ? a = b : a;    }
template<typename T> inline bool smax(T &a, const T &b)   { return a < b ? a = b : a;    }

typedef long long LL;

const int N = (int) 2005, mod = (int) 0;
vector<int> adj[N], res;
int p[N], a[N], valid[N], tot;
void dfs_init(int v) {
	st[v] = tot++;
	for (int u : adj[v])
		dfs_init(u);
	ed[v] = tot;
}
void dfs_valid(int v) {
	valid[v] = (st[a[v]] <= st[v] && st[v] < ed[a[v]]);
	for (int u : adj[v]) {
		dfs_valid(u);
		if (a[v] > a[u]) valid[v] = 0;
		valid[v] &= valid[u];
	}
}

int dfs_opt(int v, int orig) {
	int opt = -1;
	int valid_ch = 1;
	for (int u : adj[v]) {
		valid_ch &= valid[u];
		if (a[u] < orig) valid_ch = 0;
		opt = max(opt, dfs_opt(u, orig));	
	}
	if (valid_ch) {
		opt = v;	
	}
	return opt;
}

void operation(int v) {
	int tmp = a[v], tmpv = v;
	while (v != 0) {
		int t = a[p[v]];	
		a[p[v]] = tmp;
		tmp = t;
		v = p[v];
	}
	a[tmpv] = tmp;
	res.push_back(tmpv);
}
int main() {
	int n;
	cin >> n;
	for (int j = 1; j < n; ++j) cin >> p[j], adj[p[j]].pb(j);;
	for (int j = 0; j < n; ++j) cin >> a[j];
	int op = 0;
	while (++op <= 25000) {
		dfs_valid(0);
		if (valid[0]) break;
		int v = a[0];
		int u = dfs_opt(v, v);
		operation(u);
	}
	cout << res.size() << '\n';
	for (int x : res) cout << x << '\n';
}




Compiler output:
a.cc: In function 'void dfs_init(int)':
a.cc:43:9: error: 'st' was not declared in this scope; did you mean 'std'?
   43 |         st[v] = tot++;
      |         ^~
      |         std
a.cc:46:9: error: 'ed' was not declared in this scope
   46 |         ed[v] = tot;
      |         ^~
a.cc: In function 'void dfs_valid(int)':
a.cc:49:21: error: 'st' was not declared in this scope; did you mean 'std'?
   49 |         valid[v] = (st[a[v]] <= st[v] && st[v] < ed[a[v]]);
      |                     ^~
      |                     std
a.cc:49:50: error: 'ed' was not declared in this scope
   49 |         valid[v] = (st[a[v]] <= st[v] && st[v] < ed[a[v]]);
      |                                                  ^~
Language: C++

// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>

using namespace std;

#define rep(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
template<typename T> inline bool smin(T &a, const T &b)   { return a > b ? a = b : a;    }
template<typename T> inline bool smax(T &a, const T &b)   { return a < b ? a = b : a;    }

typedef long long LL;

const int N = (int) 2005, mod = (int) 0;
vector<int> adj[N], res;
int p[N], a[N], valid[N], tot;
void dfs_init(int v) {
	st[v] = tot++;
	for (int u : adj[v])
		dfs_init(u);
	ed[v] = tot;
}
void dfs_valid(int v) {
	valid[v] = (st[a[v]] <= st[v] && st[v] < ed[a[v]]);
	for (int u : adj[v]) {
		dfs_valid(u);
		if (a[v] > a[u]) valid[v] = 0;
		valid[v] &= valid[u];
	}
}

int dfs_opt(int v, int orig) {
	int opt = -1;
	int valid_ch = 1;
	for (int u : adj[v]) {
		valid_ch &= valid[u];
		if (a[u] < orig) valid_ch = 0;
		opt = max(opt, dfs_opt(u, orig));	
	}
	if (valid_ch) {
		opt = v;	
	}
	return opt;
}

void operation(int v) {
	int tmp = a[v], tmpv = v;
	while (v != 0) {
		int t = a[p[v]];	
		a[p[v]] = tmp;
		tmp = t;
		v = p[v];
	}
	a[tmpv] = tmp;
	res.push_back(tmpv);
}
int main() {
	int n;
	cin >> n;
	for (int j = 1; j < n; ++j) cin >> p[j], adj[p[j]].pb(j);;
	for (int j = 0; j < n; ++j) cin >> a[j];
	int op = 0;
	while (++op <= 25000) {
		dfs_valid(0);
		if (valid[0]) break;
		int v = a[0];
		int u = dfs_opt(v, v);
		operation(u);
	}
	cout << res.size() << '\n';
	for (int x : res) cout << x << '\n';
}





Compiler output:
a.cc: In function 'void dfs_init(int)':
a.cc:43:9: error: 'st' was not declared in this scope; did you mean 'std'?
   43 |         st[v] = tot++;
      |         ^~
      |         std
a.cc:46:9: error: 'ed' was not declared in this scope
   46 |         ed[v] = tot;
      |         ^~
a.cc: In function 'void dfs_valid(int)':
a.cc:49:21: error: 'st' was not declared in this scope; did you mean 'std'?
   49 |         valid[v] = (st[a[v]] <= st[v] && st[v] < ed[a[v]]);
      |                     ^~
      |                     std
a.cc:49:50: error: 'ed' was not declared in this scope
   49 |         valid[v] = (st[a[v]] <= st[v] && st[v] < ed[a[v]]);
      |                                                  ^~
Language: C++

#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
bool vh[1000005],vw[1000005],ban[65][65];
int bh[1000005],bw[1000005],nh[1000005];
int nw[1000005],h,w,n,x[31],y[31],c1=0,c2=0;
int kh[105],kw[105],wgt[65][65],dis[65][65];
int que[10005][2],l=1,r=0;
inline int mul(int a,int b){
	return 1ll*a*b%mod;
}

inline int sub(int a,int b){
	return(a-b<0?a-b+mod:a-b);
}

inline bool ok(int a,int b){
	if(a<=0||a>c1||b<=0||b>c2||ban[a][b])
	return 0;
	return 1;
}

int main(){
	int i,j,k,l,ans=0;
	scanf("%d%d%d",&h,&w,&n);
	for(i=1;i<=n;++i){
		scanf("%d%d",&x[i],&y[i]);
		++x[i];++y[i];
		++nh[x[i]];++nw[y[i]];
		vh[x[i]]=vw[y[i]]=1;
	}
	bh[1]=++c1;++kh[1];
	int lo=0,tot=mul(h,w)-n;
	if(tot<0) tot+=mod;
	for(i=2;i<=h;++i){
		lo+=(w-nh[i-1]);
		if(lo>=mod)lo-=mod;
		if((!vh[i-1])&&(!vh[i])){
			ans+=mul(lo,sub(tot,lo));
			if(ans>=mod)ans-=mod;
			bh[i]=bh[i-1];++kh[c1];
		}else{
			bh[i]=++c1;
			kh[c1]=1;
		}
	}
	bw[1]=++c2;++kw[1];
	lo=0;tot=mul(h,w)-n;
	if(tot<0)tot+=mod;
	for(i=2;i<=w;++i){
		lo+=(h-nw[i-1]);
		if(lo>=mod)lo-=mod;
		if((!vw[i-1])&&(!vw[i])){
			ans+=mul(lo,sub(tot,lo));
			if(ans>=mod)ans-=mod;
			bw[i]=bw[i-1];++kw[c2];
		}else{
			bw[i]=++c2;
			kw[c2]=1;
		}
	}
	for(i=1;i<=c1;++i){
		for(j=1;j<=c2;++j){
			wgt[i][j]=mul(kh[i],kw[j]);
		}
	}
	for(i=1;i<=n;++i){
		ban[bh[x[i]]][bw[y[i]]]=1;
	}
	ans<<=1;
	if(ans>=mod)ans-=mod;
	fo(i=1;i<=c1;++i){
		for(j=1;j<=c2;++j){
			if(ban[i][j])continue;
			l=1;r=0;que[++r][0]=i;
			que[r][1]=j;
			memset(dis,0x7f,sizeof(dis));
			dis[i][j]=0;
			while(l<=r){
				int a=que[l][0],b=que[l][1];
				++l;
				if(ok(a-1,b)&&
				dis[a-1][b]>dis[a][b]+1){
					dis[a-1][b]=dis[a][b]+1;
					que[++r][0]=a-1;
					que[r][1]=b;
				}
				if(ok(a+1,b)&&
				dis[a+1][b]>dis[a][b]+1){
					dis[a+1][b]=dis[a][b]+1;
					que[++r][0]=a+1;
					que[r][1]=b;
				}
				if(ok(a-1,b)&&
				dis[a-1][b]>dis[a][b]+1){
					dis[a-1][b]=dis[a][b]+1;
					que[++r][0]=a-1;
					que[r][1]=b;
				}
				if(ok(a,b-1)&&
				dis[a][b-1]>dis[a][b]+1){
					dis[a][b-1]=dis[a][b]+1;
					que[++r][0]=a;
					que[r][1]=b-1;
				}
				if(ok(a,b+1)&&
				dis[a][b+1]>dis[a][b]+1){
					dis[a][b+1]=dis[a][b]+1;
					que[++r][0]=a;
					que[r][1]=b+1;
				}
			}
			int tp=0;
			for(k=1;k<=c1;++k){
				for(l=1;l<=c2;++l){
					if(ban[k][l])continue;
					int x=dis[k][l];
					tp+=mul(x,wgt[k][l]);
					if(tp>=mod)tp-=mod;
				}
			}
			tp=mul(tp,wgt[i][j]);
			ans+=tp;
			if(ans>=mod)ans-=mod;
		}
	}
	if(ans&1)ans+=mod;
	printf("%d\n",ans>>1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:15: error: expected ')' before ';' token
   72 |         fo(i=1;i<=c1;++i){
      |           ~   ^
      |               )
a.cc:72:25: error: expected ';' before ')' token
   72 |         fo(i=1;i<=c1;++i){
      |                         ^
      |                         ;
Language: C

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  ll res = n - a;
  res = res - res / b * b;
  cout << res << endl;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();  
      int b = sc.nextInt();  
      int c = sc.nextInt();  
      int x = sc.nextInt();  
      
      int count=0;
      boolean fragJ = true;
      boolean fragK = true;
      
      for(int i = 1; i<=a ; i++){
       if(500*i == x){
      	count += 1;
       }
       
        for(int j = 1; j<=b ; j++){
         
         if(fragJ){
            if(100*j == x){
         	    count += 1;
         	    fragJ = false;

            }
         }
         
            if(500*i + 100*j == x){
                count += 1;
            }
        
        	for(int k = 1; k<=c ; k++){
                 if(fragK){
         		    if(50*k == x){
         			    count += 1;
         			    fragK = false;
        		    }
                 }

        	     if(j==1){
        		    if(500*i + 50*k == x){
            		    count += 1;
        	        }
        	     }
        	     
         	     if(500*i + 100*j + 50*k == x){
            		count += 1;

            		
        	     }
             }   
         }
      }
      
    System.out.println(count);
  }
}
}

Compiler output:
Main.java:60: error: class, interface, enum, or record expected
}
^
1 error
Language: C++

#include<stdio.h>
int main(){
  int a,b,c;
  scanf("%d %d %d", &a,&b,&c);
  int k=a-b;
  int h=k/c;
  cout<<k-c*h;
  
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout<<k-c*h;
      |   ^~~~
Language: C

#include<stdio.h>
int main(){
  int a,b,c;
  scanf("%d %d %d", &a,&b,&c);
  int k=a-b;
  int h=k/c;
  cout<<k-c*h;
  
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: 'cout' undeclared (first use in this function)
    7 |   cout<<k-c*h;
      |   ^~~~
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#iinclude<bits/stdc++.h>
using namespace std;
int main(){
  int x,a,b;
  cin>>x>>a>>b;
  int y=(x-a)/b;
  cout<<x-(a+y*b)<<endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iinclude; did you mean #include?
    1 | #iinclude<bits/stdc++.h>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>x>>a>>b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iinclude<bits/stdc++.h>
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout<<x-(a+y*b)<<endl;
      |   ^~~~
a.cc:7:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:20: error: 'endl' was not declared in this scope
    7 |   cout<<x-(a+y*b)<<endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #iinclude<bits/stdc++.h>
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int x,a,b,k;
  cin>>x>>a>>b;
  (x-a)/b=k
    cout<<k;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: lvalue required as left operand of assignment
    7 |   (x-a)/b=k
      |   ~~~~~^~
Language: C++

#include <iostream> 
using namespace std;
int main (){
  int X,A,B;
  cout << (x-A)%B;
  return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'x' was not declared in this scope
    5 |   cout << (x-A)%B;
      |            ^
Language: C++

#include <iostream> 
using namespace std;
int main (){
  int X,A,B;
  cout << (x-A)%b;
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'x' was not declared in this scope
    5 |   cout << (x-A)%b;
      |            ^
a.cc:5:17: error: 'b' was not declared in this scope
    5 |   cout << (x-A)%b;
      |                 ^
Language: C++

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

int main() {
  int x, a, b;
  cin >> x >> a >> b;

  ans = (x-a)%b;

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   ans = (x-a)%b;
      |   ^~~
      |   abs
Language: C++

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

int x, a, b, left;

int main () {
cin >> x >> a >> b;
left=(x-a)%b;
cout << left << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: reference to 'left' is ambiguous
    8 | left=(x-a)%b;
      | ^~~~
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1062:3: note: candidates are: 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |   ^~~~
a.cc:4:14: note:                 'int left'
    4 | int x, a, b, left;
      |              ^~~~
a.cc:9:9: error: reference to 'left' is ambiguous
    9 | cout << left << endl;
      |         ^~~~
/usr/include/c++/14/bits/ios_base.h:1062:3: note: candidates are: 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |   ^~~~
a.cc:4:14: note:                 'int left'
    4 | int x, a, b, left;
      |              ^~~~
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());

        int res = 0;
        for (int a = 0; a <= A; a++) {
            for (int b = 0; b <= B; b++) {
                int c = (X - a * 500 - b * 100) / 50;
                if (c >= 0 && c <= C)
                    res++;
            }
        }

        System.out.println(res);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a,b,c,x;
  int counter = 0;
  cin >> a >> b >> c >> x;
  for(int A = 0;A<a;i++){
    for(int B = 0;B<b;i++){
      for(int C = 0;C<c;i++){
        int total = 0;

        total = 500*a + 100*b + 50*c;
        if(total == x){
          counter++;
        }
      }
    }
  }
  cout << counter << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'i' was not declared in this scope
    8 |   for(int A = 0;A<a;i++){
      |                     ^
Language: C++

#include "bits/stdc++.h"

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define rrep(i, n) for(ll i=(n)-1; i >=0; i--)
#define ALL(v) v.begin(),v.end()
#define rALL(v) v.rbegin(),v.rend()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define debug_print(var) cerr << #var << "=" << var <<endl;
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cerr<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct edge{ll x, c;};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

ll gcd(ll a, ll b){
  ll r = a%b;
  if(r==0) return b;
  else return gcd(b, a%b);
}

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}

struct UnionFind{
  ll N;
  llvec p;
  llvec cnt;
  UnionFind(ll n){
    N = n;
    p=llvec(N);
    cnt=llvec(N, 0);
    rep(i, N){
      p[i] = i;
      cnt[i] = 1;
    }
  }

  void con(ll a, ll b){
    P at = root(a);
    P bt = root(b);
    if(at.second!=bt.second){
      if(at.first>bt.first){
        swap(at, bt);
        swap(a, b);
      }
      p[at.second] = bt.second;
      cnt[bt.second]+=cnt[at.second];
      p[a]=bt.second;
    }
  }

  P root(ll a){
    ll atmp = a;
    ll c=0;
    while(atmp!=p[atmp]){
      atmp = p[atmp];
      c++;
    }
    p[a] = atmp;
    return {c, atmp};
  }

  bool is_con(ll a, ll b){
    P at=root(a);
    P bt=root(b);
    return at.second == bt.second;
  }
  
};

struct dijkstra{
  ll N;
  llvec d;
  vector<vector<edge>> e;
  dijkstra(ll n){
    N = n;
    //d = llvec(N, 1e18);
    e = vector<vector<edge>>(N);
  }

  void add_edge(ll from, ll to, ll cost){
    e[from].push_back({to, cost});
  }

  void run(ll start){
    priority_queue<P, vector<P>, greater<P>> que;
    que.push({0, start});
    d = llvec(N, 1e18);
    d[start]=0;
    while(!que.empty()){
      P q = que.top();que.pop();
      ll dc = q.first;
      ll x = q.second;
      if(dc>d[x]){
        continue;
      }else{
        for(auto ip: e[x]){
          if(d[ip.x]<=d[x]+ip.c){
            continue;
          }else{
            d[ip.x]= d[x]+ip.c;
            que.push({d[ip.x], ip.x});
          }
        }
      }
    }
  }  
};


/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll x, a, b;
  cin >> x >> a >> b;
  cout << (x-a)%b
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:156:18: error: expected ';' before 'return'
  156 |   cout << (x-a)%b
      |                  ^
      |                  ;
  157 |   return 0;
      |   ~~~~~~
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
 		int b_num = (int)(x-a)/b
        int result = x - a - b * b_num;
        System.out.print(result);
    }
}

Compiler output:
Main.java:11: error: ';' expected
 		int b_num = (int)(x-a)/b
 		                        ^
1 error
Language: C++

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

int main() {
  int x,a,b;cin >> x>> a>>b;
  cout << (x - a) % b <<< endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: expected primary-expression before '<' token
    6 |   cout << (x - a) % b <<< endl;
      |                         ^
Language: C++

/**
 * auther: moririn_cocoa
 */
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define fi first
#define se second
#define ll long long
#define pll pair<ll,ll>
#define pq priority_queue
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

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(int argc, const char * argv[]) {
  
  int X;
  int A;
  int B;
  
  cin >> X;
  cin >> A;
  cin >> B;
  
  int n = ( X - A ) / B
  
  cout << X - A - ( B * n ) << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:58:3: error: expected ',' or ';' before 'cout'
   58 |   cout << X - A - ( B * n ) << endl;
      |   ^~~~
Language: C++

#include<iostream>
int main(){
  int X, A, B;
  stc::cin >> X >> A >> B;
  std::cout<< (X-A)%B;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'stc' has not been declared
    4 |   stc::cin >> X >> A >> B;
      |   ^~~
Language: C++

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

int main () {
  int X, A, B
  cin >> X >> A >> B;

  cout << X - (A + B) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >> X >> A >> B;
      |   ^~~
a.cc:8:20: error: 'B' was not declared in this scope
    8 |   cout << X - (A + B) << endl;
      |                    ^
Language: C++

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

int main() {
  int X , A , B ;
  cin >> X >> A >> B ;
  
  int a = (X-A)/B ;
  
  cout << X - A - a*B << endl;
}


Compiler output:
a.cc:2:17: error: expected identifier before ';' token
    2 | using namespace ;
      |                 ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> X >> A >> B ;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   cout << X - A - a*B << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |   cout << X - A - a*B << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int X , A , B ;
  cin >> X >> A >> B ;
  
  int a = (X-A)/B ;
  
  cout << X - A - a*B << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incluse; did you mean #include?
    1 | #incluse <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc:2:17: error: expected identifier before ';' token
    2 | using namespace ;
      |                 ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> X >> A >> B ;
      |   ^~~
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << X - A - a*B << endl;
      |   ^~~~
a.cc:10:26: error: 'endl' was not declared in this scope
   10 |   cout << X - A - a*B << endl;
      |                          ^~~~
Language: Java

import java.util.*;

public class Main{
      public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            int a = sc.next();
            int b = sc.next();
            int c = sc.next();
            System.out.println((a - b) % c);
          }
}

Compiler output:
Main.java:6: error: incompatible types: String cannot be converted to int
            int a = sc.next();
                           ^
Main.java:7: error: incompatible types: String cannot be converted to int
            int b = sc.next();
                           ^
Main.java:8: error: incompatible types: String cannot be converted to int
            int c = sc.next();
                           ^
3 errors
Language: C++

#include <iostream>
using namespace std;
int main()
{int a,b,c;//定义money和单价
cin>>a>>b>>c;//输入
cout<<(a-b)%c<<endl;//计算，输出

    return 0;
}/

Compiler output:
a.cc:9:2: error: expected unqualified-id before '/' token
    9 | }/
      |  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int a, b, n;
    cin >> a >> b >> c;
    cout << (a - b) % c << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: 'c' was not declared in this scope
    5 |     cin >> a >> b >> c;
      |                      ^
Language: C

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

int main()
{
    int x, a, b;
    cin >> x >> a >> b;
    cout << (x - a) % b << endl;
}

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

#include<iostream>
using namespace std;
int a,b,m,left;
int main() {
	cin>>m>>a>>b;
	m-=a;
	left=m/b;
	cout<<left;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: reference to 'left' is ambiguous
    7 |         left=m/b;
      |         ^~~~
In file included from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1062:3: note: candidates are: 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |   ^~~~
a.cc:3:11: note:                 'int left'
    3 | int a,b,m,left;
      |           ^~~~
a.cc:8:15: error: reference to 'left' is ambiguous
    8 |         cout<<left;
      |               ^~~~
/usr/include/c++/14/bits/ios_base.h:1062:3: note: candidates are: 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |   ^~~~
a.cc:3:11: note:                 'int left'
    3 | int a,b,m,left;
      |           ^~~~
Language: C

#include<cstdio>
using namespace std;
int main(){
int X, A, B;
scanf("%d%d%d", &X, &A, &B);
printf("%d\n", (X - A) % B);
return 0;
}


Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include<stdio>
using namespace std;
int A, B, C;
int X;
1
int solve(){
int ans = 0;
for(int i = 0; i <= A; ++i){
for(int j = 0; j <= B; ++j){
for(int k = 0; k <= C; ++k){
int tmp = i * 500 + j * 100 + k * 50;
if(tmp == X) ans++;
}
}
}
return ans;
}
int main(){
scanf("%d%d%d%d", &A, &B, &C, &X);
int ans = solve();
printf("%d\n", ans);
return 0;
}

Compiler output:
main.c:1:9: fatal error: stdio: No such file or directory
    1 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C

#include<cstdio>
using namespace std;
int A, B, C;
int X;
1
int solve(){
int ans = 0;
for(int i = 0; i <= A; ++i){
for(int j = 0; j <= B; ++j){
for(int k = 0; k <= C; ++k){
int tmp = i * 500 + j * 100 + k * 50;
if(tmp == X) ans++;
}
}
}
return ans;
}
int main(){
scanf("%d%d%d%d", &A, &B, &C, &X);
int ans = solve();
printf("%d\n", ans);
return 0;
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include<cstdio>
using namespace std;
int main(){
     int X,A,B;
     scanf("%d%%d%d",&X,&A,&B);
     printf("%d\n",(X-A)%B);
     return 0;
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
    public class Main {// Main
        public static void main(String[] args){
            Scanner scanner = new Scanner(System.in);
            int x = scanner.nextInt();
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            int y = (x-a);
            int n = int(y/b);
            int f = y-(n*b);
            System.out.println(f);
}
}

Compiler output:
Main.java:9: error: '.class' expected
            int n = int(y/b);
                       ^
Main.java:9: error: not a statement
            int n = int(y/b);
                         ^
Main.java:9: error: ';' expected
            int n = int(y/b);
                           ^
3 errors
Language: C++

//parshant
#include<iostream>
     using namespace std;
      
     int main()
     {
         int x,a,b,c;
         while(cin>>a>>b>>c>>x){
             x/=50;
             int sum=0;
             for(int i=0;i<=a;i++){
                 for(int j=0;j<=b;j++){
                     for(int k=0;k<=c;k++){
                         if(i*10+j*2+k==x) sum++;
                     }
                 }
             }
             cout<<sum<<endl;
         }
         return 0;
    }
}

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

#include<bits/stdc++.h>
#include<iostream>
     using namespace std;
      
     int main()
     {
         int x,a,b,c;
         while(cin>>a>>b>>c>>x){
             x/=50;
             int sum=0;
             for(int i=0;i<=a;i++){
                 for(int j=0;j<=b;j++){
                     for(int k=0;k<=c;k++){
                         if(i*10+j*2+k==x) sum++;
                     }
                 }
             }
             cout<<sum<<endl;
         }
         return 0;
    }
}
//parshant

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

#include<iostream>
 
using namespace std;
int main(){
	int t,n,p;
 
	cin>>t;
	
	while(t>0){
		
		cin>>n;
		int arr[n],i=0;
		
		cin>>p;
		int sum=0;
		int min = 65535;
		while(n>0){
			cin>>arr[i];
			sum+=arr[i];
            if(arr[i]<min){
                min = arr[i];
            }
			i++;
			n--;
		}
		
	    
		int qty = 0,qty1=0,fg=0;
		qty = sum/p;
		sum-=min;
		qty1=sum/p;
        if(qty1>=qty){
                     	cout<<-1<<"\n";
        }else{
                            
			cout<<qty<<"\n";
		}
 
 
 
		
 
		t--;
	}
 
 
	
	return 0;
	
//parshant

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

#include<iostream>
 
using namespace std;
int main(){
	int t,n,p;
 
	cin>>t;
	
	while(t>0){
		
		cin>>n;
		int arr[n],i=0;
		
		cin>>p;
		int sum=0;
		int min = 65535;
		while(n>0){
			cin>>arr[i];
			sum+=arr[i];
            if(arr[i]<min){
                min = arr[i];
            }
			i++;
			n--;
		}
		
	    
		int qty = 0,qty1=0,fg=0;
		qty = sum/p;
		sum-=min;
		qty1=sum/p;
        if(qty1>=qty){
                     	cout<<-1<<"\n";
        }else{
                            
			cout<<qty<<"\n";
		}
 
 
 
		
 
		t--;
	}
 
 
	
	return 0;
	


Compiler output:
a.cc: In function 'int main()':
a.cc:48:18: error: expected '}' at end of input
   48 |         return 0;
      |                  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

import java.util.*;
    public class Main {// Main
        public static void main(String[] args){
            Scanner scanner = new Scanner(System.in)
            int x = scanner.nextInt();
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            x = x-a;
            while(x>0) {
                     x = x-b;
            }
            System.out.println(x)
}
}

Compiler output:
Main.java:4: error: ';' expected
            Scanner scanner = new Scanner(System.in)
                                                    ^
Main.java:12: error: ';' expected
            System.out.println(x)
                                 ^
2 errors
Language: C

#include<bits/stdc++.h>
using namespace std;
//saurabh
bool cmp(int x,int y)
{
    return x>y;
}
int main()
{
    int n,sum=0;
    scanf("%d",&n);
    int a[2][101],b[101]={0},i,j;
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[0][i]);
    }
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[1][i]);
    }
    sum=sum+a[0][0]+a[1][n-1];//saurabh
    for(i=0;i<n-1;i++)//saurabh
    {
        for(j=i;j<n-1;j++)
        {
            b[i]=b[i]+a[1][j];//saurabh
        }
        for(j=0;j<i;j++)
        {
            b[i]=b[i]+a[0][j+1];//saurabh
        }
    }
    sort(b,b+(n-1),cmp);
    sum=sum+b[0];//saurabh
    printf("%d\n",sum);
    return 0;
}

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

import java.util.*;
 class Ideone {
    public static long answer=0;
    public static int longvalue=1000000007;
    public static void main(String args[])
    {
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i]=s.nextInt();
        long start=System.currentTimeMillis();
        int output=possibleways(a);
        System.out.println(output);
        long stop=System.currentTimeMillis();
        System.out.println(stop-start);
    }
    private static int possibleways(int[] input1) {
        long[] arr=new long[input1.length];
        arr[0]=input1[0];
        answer=0;
        for(int i=1;i<input1.length;i++)
        {
            int temp=((i+1)*input1[i]);
            arr[i]=arr[i-1]+temp;
 
        }
        for(int i=0;i<arr.length;i++)
        {
            long temp=(input1[i]*arr[i]);
            answer=(answer+temp)%longvalue;
        }
 
        return (int)answer%longvalue;
    }
 


Compiler output:
Main.java:35: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
/Saurabh
bool cmp(int x,int y)
{
    return x>y;
}
int main()
{
    int n,sum=0;
    scanf("%d",&n);
    int a[2][101],b[101]={0},i,j;
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[0][i]);
    }
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[1][i]);
    }
    sum=sum+a[0][0]+a[1][n-1];//purvikaurraina
    for(i=0;i<n-1;i++)//purvikaurraina
    {
        for(j=i;j<n-1;j++)
        {
            b[i]=b[i]+a[1][j];//purvikaurraina
        }
        for(j=0;j<i;j++)
        {
            b[i]=b[i]+a[0][j+1];//purvikaurraina
        }
    }
    sort(b,b+(n-1),cmp);
    sum=sum+b[0];//purvikaurraina
    printf("%d\n",sum);
    return 0;
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '/' token
    3 | /Saurabh
      | ^
a.cc: In function 'int main()':
a.cc:33:20: error: 'cmp' was not declared in this scope; did you mean 'bcmp'?
   33 |     sort(b,b+(n-1),cmp);
      |                    ^~~
      |                    bcmp
Language: C

#include <iostream>
#include <cstdio>
using namespace std;

int main() {
// Initialize number
 int t, n, x, b, s, min;
 scanf("%d", &t);
 while(t--) {
  scanf("%d %d", &n, &x);
  s=0; min=101;
  while(n--) { scanf("%d", &b); s=s+b; if(b<min) min=b; }
  if(min<=s%x) printf("-1\n");
  else printf("%d\n", s/x);
 }
 return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
int main()
{
	long long y,A,B;
	cin>>n>>A>>B; //input members
	n =  n - A ;
	n =  n%B;
	cout<<n;       //output
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'n' was not declared in this scope
    6 |         cin>>n>>A>>B; //input members
      |              ^
Language: C

#include<cstdio>

int main(){
int X, A, B;
scanf("%d%d%d", &X, &A, &B);
printf("%d\n", (X - A) % B);
return 0;
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
 
using namespace std;
int main(){
	int t,n,p;
 
	cin>>t;
	
	while(t>0){
		
		cin>>n;
		int arr[n],i=0;
		
		cin>>p;
		int sum=0;
		int min = 65535;
		while(n>0){
			cin>>arr[i];
			sum+=arr[i];
            if(arr[i]<min){
                min = arr[i];
            }
			i++;
			n--;
		}
		
	    
		int q = 0,qty1=0,fg=0;
		q = sum/p;
		sum-=min;
		q1=sum/p;
        if(q1>=q){
                     	cout<<-1<<"\n";
        }else{
                            
			cout<<q<<"\n";
		}
 
 
 
		
 
		t--;
	}
 
 
	
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'q1' was not declared in this scope; did you mean 'q'?
   31 |                 q1=sum/p;
      |                 ^~
      |                 q
Language: C

#include<iostream>
using namespace std;
 //main body
int main()
{
	long long n,A,B;
	cin>>n>>A>>B;
	n =  n - A ;
	n =  n%B;
	cout<<n;  //output
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
    using namespace std;
     
    int main()
    {
        int x,a,b,c;
        while(cin>>a>>b>>c>>x){
            x/=50;
            int sum=0;
            for(int i=0;i<=a;i++){
                for(int j=0;j<=b;j++){
                    for(int k=0;k<=c;k++){
                        if(i*10+j*2+k==x) sum++;
                    }
                }
            }
            cout<<sum<<endl;
        }
        return 0;
    }

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


#include <bits/stdc++.h>
 
using namespace std;
 
int w[2000 + 5] = { };
int a[2000 + 5] = { };
int b[2000 + 5] = { };
int f[2000 + 5] = { };
 
int main()
{
	int m, n;
	scanf("%d %d", &m, &n);
	for(int i = 1; i <= n; i++){
		scanf("%d %d %d", &w[i], &a[i], &b[i]);
	}
	
	for(int i = 1; i <= n; i++){
		for(int j = m; j >= w[i]; j--){
			f[j] = max(f[j], f[j - w[i]] + a[i] + b[i]);
		}
		for(int j = w[i]; j <= m; j++){
			f[j] = max(f[j], f[j - w[i]] + a[i]);
		}
	}
	
	printf("%d", f[m]);
		
	return 0;
}
 

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

nclude <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
    int A, B, C, X;
    cin >> A >> B >> C >> X;
 
    int counter = 0;
    rep(i, A + 1) {
        rep(j, B + 1) {
            rep(k, C + 1) {
                if (X == 500 * i + 100 * j + 50 * k) {
                    ++counter;
                }
            }
        }
    }
 
    cout << counter << endl;
}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude <bits/stdc++.h>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> A >> B >> C >> X;
      |     ^~~
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << counter << endl;
      |     ^~~~
a.cc:20:24: error: 'endl' was not declared in this scope
   20 |     cout << counter << endl;
      |                        ^~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int x,a,b;
    cin>>x>>a>>b;
    x-=a;
    cout<<x%b
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before 'return'
    8 |     cout<<x%b
      |              ^
      |              ;
    9 |     return 0;
      |     ~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;

int main() {
	int a, b, c, x;
	cin >> a >> b >> c >> x;
	int ans = 0;
	for (int i = 0; i <= a; i++) {
		for (int j = 0; j <= b; j++) {
			for (int k = 0; k < =c; k++) {
				if (500 * i + 100 * j + 50 * k == x) ans++;
			}
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:45: error: expected primary-expression before '=' token
   19 |                         for (int k = 0; k < =c; k++) {
      |                                             ^
Language: C++

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

int main() {
  int X,A,B;
  cin>>X>>A>>B;
  cout<<(X-A)%B<<endl;
  retuen 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'retuen' was not declared in this scope
    8 |   retuen 0;
      |   ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int x,a,b;
int main()
{
    cin>>x>>a>>b
    cout<<(x-a)%b<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: expected ';' before 'cout'
    6 |     cin>>x>>a>>b
      |                 ^
      |                 ;
    7 |     cout<<(x-a)%b<<endl;
      |     ~~~~
Language: Java

import static org.hamcrest.CoreMatchers.is;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import org.junit.Assert;
import org.junit.Test;

public class MainTest {

	@Test
	public void 入力例_1() throws Exception {
		String input = 
			"1234" + System.lineSeparator() +
			"150" + System.lineSeparator() +
			"100";
		String output = 
			"84";

		assertIO(input, output);
	}

	@Test
	public void 入力例_2() throws Exception {
		String input = 
			"1000" + System.lineSeparator() +
			"108" + System.lineSeparator() +
			"108";
		String output = 
			"28";

		assertIO(input, output);
	}

	@Test
	public void 入力例_3() throws Exception {
		String input = 
			"579" + System.lineSeparator() +
			"123" + System.lineSeparator() +
			"456";
		String output = 
			"0";

		assertIO(input, output);
	}

	@Test
	public void 入力例_4() throws Exception {
		String input = 
			"7477" + System.lineSeparator() +
			"549" + System.lineSeparator() +
			"593";
		String output = 
			"405";

		assertIO(input, output);
	}

	private void assertIO(String input, String output) throws Exception {
		ByteArrayInputStream in = new ByteArrayInputStream(input.getBytes());
		System.setIn(in);

		ByteArrayOutputStream out = new ByteArrayOutputStream();
		System.setOut(new PrintStream(out));

		Main.main(new String[0]);

		Assert.assertThat(out.toString(), is(output + System.lineSeparator()));
	}
}


Compiler output:
Main.java:10: error: class MainTest is public, should be declared in a file named MainTest.java
public class MainTest {
       ^
Main.java:1: error: package org.hamcrest does not exist
import static org.hamcrest.CoreMatchers.is;
                          ^
Main.java:1: error: static import only from classes and interfaces
import static org.hamcrest.CoreMatchers.is;
^
Main.java:7: error: package org.junit does not exist
import org.junit.Assert;
                ^
Main.java:8: error: package org.junit does not exist
import org.junit.Test;
                ^
Main.java:12: error: cannot find symbol
	@Test
	 ^
  symbol:   class Test
  location: class MainTest
Main.java:24: error: cannot find symbol
	@Test
	 ^
  symbol:   class Test
  location: class MainTest
Main.java:36: error: cannot find symbol
	@Test
	 ^
  symbol:   class Test
  location: class MainTest
Main.java:48: error: cannot find symbol
	@Test
	 ^
  symbol:   class Test
  location: class MainTest
Main.java:67: error: cannot access Main
		Main.main(new String[0]);
		^
  bad source file: ./Main.java
    file does not contain class Main
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
Main.java:69: error: cannot find symbol
		Assert.assertThat(out.toString(), is(output + System.lineSeparator()));
		^
  symbol:   variable Assert
  location: class MainTest
Main.java:69: error: cannot find symbol
		Assert.assertThat(out.toString(), is(output + System.lineSeparator()));
		                                  ^
  symbol:   method is(String)
  location: class MainTest
12 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a,b,c,ans;
int main(){
    cin>>a>>b>>c;
    ans=a-b;
        while(ans>=c)
        ans-=c;
    }
    cout<<ans;
    return 0;
}

Compiler output:
a.cc:10:5: error: 'cout' does not name a type
   10 |     cout<<ans;
      |     ^~~~
a.cc:11:5: error: expected unqualified-id before 'return'
   11 |     return 0;
      |     ^~~~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a,b,c,ans;
int main(){
    cin>>a>>b>>c;
    ans=a-b;
    for(int i=1;;1++){
        if(ans<c) break;
        ans-=c;
    }
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: lvalue required as increment operand
    7 |     for(int i=1;;1++){
      |                  ^