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

#include<bits/stdc++.h>
using namespace std;
#define maxn 1000000000000000000;
 
int main()
{
 
    long long a,b;
    long long x=0,k1=0;
    cin>>a>>b;
    if(a==1||b==1||a==b||b%a==0||a%b==0){
        cout<<-1<<endl;
        return 0;
    }
 
    if(a<100000000){
         for(int i=1;i<=200000000;i++)
        {
            if(i%a==0&&i>a&&i%b!=0){
                cout<<i;
                return 0;
            }
 
        if(i==200000000){cout<<-1<<endl;return 0;
        }
    }
    }
    long long t=0;
    bool flag=false;
    for(int i=a+a;t<=100000000;i+=a)
    {
        t++;
        if(i%a==0&&i%b!=0){
            cout<<i<<endl;
            return 0;
        }
        //if(t==100000000||i>=maxn)flag=true;
 
        }
    for(int k=a*2; k<=maxn;k*=2)
    {
        if(k%b==0&&k<maxn){
                cout<<k;
        return 0;
    }
    }
 
    cout<<-1<<endl;
}
    /*if(a>=100000000){
 
    }*/
 
 


Compiler output:
a.cc: In function 'int main()':
a.cc:40:27: error: expected primary-expression before ';' token
   40 |     for(int k=a*2; k<=maxn;k*=2)
      |                           ^
a.cc:40:27: error: expected ')' before ';' token
   40 |     for(int k=a*2; k<=maxn;k*=2)
      |        ~                  ^
a.cc:40:28: error: 'k' was not declared in this scope
   40 |     for(int k=a*2; k<=maxn;k*=2)
      |                            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define maxn 1000000000000000000;
 
int main()
{
 
    long long a,b;
    long long x=0,k1=0;
    cin>>a>>b;
    if(a==1||b==1||a==b||b%a==0||a%b==0){
        cout<<-1<<endl;
        return 0;
    }
 
    if(a<100000000){
         for(int i=1;i<=200000000;i++)
        {
            if(i%a==0&&i>a&&i%b!=0){
                cout<<i;
                return 0;
            }
 
        if(i==200000000){cout<<-1<<endl;return 0;
        }
    }
    }
    long long t=0;
    bool flag=false;
    for(int i=a+a;t<=100000000;i+=a)
    {
        t++;
        if(i%a==0&&i%b!=0){
            cout<<i<<endl;
            return 0;
        }
        //if(t==100000000||i>=maxn)flag=true;
 
        }
    for(int k=a*2; k<=MAXN;k*=2)
    {
        if(k%b==0&&k<MAXN){
                cout<<k;
        return 0;
    }
    }
 
    cout<<-1<<endl;
}
    /*if(a>=100000000){
 
    }*/
 
 


Compiler output:
a.cc: In function 'int main()':
a.cc:40:23: error: 'MAXN' was not declared in this scope
   40 |     for(int k=a*2; k<=MAXN;k*=2)
      |                       ^~~~
Language: C++

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

int main()
{

    long long a,b;
    long long x=0,k1=0;
    cin>>a>>b;
    if(a==1||b==1||a==b||b%a==0){
        cout<<-1<<endl;
        return 0;
    }

    if(a<=100000000){
         for(int i=1;i<=200000000;i++)
        {
            if(i%a==0&&i>a&&i%b!=0){
                cout<<i;
                return 0;
            }

        if(i==200000000){cout<<-1<<endl;return 0;
        }
    }
    }
    long long t=0;
    bool flag=false;
    for(int i=a+a;t<=100000000;i+=a)
    {
        t++;
        if(i%a==0&&i%b!=0){
            cout<<i<<endl;
            return 0;
        }
        //if(t==100000000||i>=maxn)flag=true;

        }
if(a==1000000000)cout<<"1000000000000000000";
if(a>100000000&&a<=999999999)
{
    long long t=0;
    for(int i=a+a;t<=100000000;i+=a)
    {
        t++;
        if(i%a==0&&i%b!=0){
            cout<<i;
            return 0;
        }
    }
    if(a>b){
            int tt=0;
            for(int i=2; tt<100000000;i++)
            {
                tt++;
                if((i*a)%b!=0){
                        cout<<i*a<<endl;
                break;
            }
            }
            }
}

    cout<<-1<<endl;
}
    /*if(a>=100000000){


Compiler output:
a.cc:67:5: error: unterminated comment
   67 |     /*if(a>=100000000){
      |     ^
Language: C++

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

int main()
{

    long long a,b;
    long long x=0,k1=0;
    cin>>a>>b;
    if(a==1||b==1||a==b||b%a==0){
        cout<<-1<<endl;
        return 0;
    }

    if(a<100000000){
         for(int i=1;i<=200000000;i++)
        {
            if(i%a==0&&i>a&&i%b!=0){
                cout<<i;
                return 0;
            }
        }
        if(i==200000000)cout<<-1<<endl;
    }
    /*if(a>=100000000){
        
    }*/
    
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: 'i' was not declared in this scope
   24 |         if(i==200000000)cout<<-1<<endl;
      |            ^
Language: C++

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

int a,b;

int main()
{
    scanf("%d%d",&a,&b);
    if(a%b==0) printf("-1\n);
    else printf("%d\n",a);
    return 0;
}

Compiler output:
a.cc:9:23: warning: missing terminating " character
    9 |     if(a%b==0) printf("-1\n);
      |                       ^
a.cc:9:23: error: missing terminating " character
    9 |     if(a%b==0) printf("-1\n);
      |                       ^~~~~~~
a.cc: In function 'int main()':
a.cc:10:5: error: expected primary-expression before 'else'
   10 |     else printf("%d\n",a);
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    float a,b;
    float res;
    cin >> a >> b;
    if ((a%b) == 0) res = -1;
    //else if ((a*2) > 10^18) res = -1;
    else res = a*(b+1);
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: invalid operands of types 'float' and 'float' to binary 'operator%'
    7 |     if ((a%b) == 0) res = -1;
      |          ~^~
      |          | |
      |          | float
      |          float
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    int res;
    cin >> a >> b;
    if ((a%b) == 0) res = -1;
    else if (a*2) > 10^18) res = -1;
    else res = a*(b+1);
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected primary-expression before '>' token
    8 |     else if (a*2) > 10^18) res = -1;
      |                   ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
const long long MOD=1e9+7;
const double PI=3.14159265359;

string query(int num){
    cout<<num<<endl;
    fflush(stdout);
    string s;
    cin>>s;
    return s;
    
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin>>n;
    
    string vac="Vacant";
    
    if(n<=10){
        for(int i=0; i<n; i++){
            string s=query(i);
            if(s==vac) return 0;
        }
    }
    
    int l=2, r=n-5;
    string lval=query(l);
    if(lval==vac) return 0;
    string rval=query(r);
    if(rval==vac) return 0;
    if(lval ==rval){
        string s=query(0);
        if(s==vac) return 0;
        s=query(1);
        if(s==vac) return 0;
        for(int i=n-4; i<n; i++){
            s=query(i);
            if(s==val) return 0;
        }
    }
    
    while(1){
        int mid=l+r>>2;
        if(mid%2) mid++;
        if(mid==r){
            query(r-1);
            return 0;
        }
        
        string midVal=query(mid);
        if(midVal==vac) return 0;
        if(midVal==lval) l=mid;
        else r=mid;
    }
    
    
    
    
    
    
    
    
  
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:19: error: 'val' was not declared in this scope; did you mean 'rval'?
   45 |             if(s==val) return 0;
      |                   ^~~
      |                   rval
Language: C++

#include<iostream>
#include<vector>
#include<cstdint>
using namespace std;

const int MAX = 100000;

typedef struct tree {
	int cost;
	bool use;
	int treeNum;
	bool DFSread;
	vector<int> edge;
} Tree;

void setTreeNum(Tree t[], int n, int num) {
//	cout << "木" << n << ":" << num << "番" << endl;
	t[n].treeNum = num;
	t[n].DFSread = true;
	for (int i = 0;i < t[n].edge.size();i ++) {
		if (t[t[n].edge[i]].DFSread) continue;
		setTreeNum(t, t[n].edge[i], num);
	}
	t[n].DFSread = false;
}

int getMinimum(Tree t[], int n) {
	int ret = t[n].cost, tmp;
	t[n].use = true;
	t[n].DFSread = true;
	for (int i = 0;i < t[n].edge.size();i ++) {
		if (t[t[n].edge[i]].DFSread) continue;
		tmp = getMinimum(t, t[n].edge[i]);
		if (ret > tmp) {
			t[n].use = false;
			ret = tmp;
		}
	}
	t[n].DFSread = false;
	return ret;
}

int main() {
	int N, M;
	static pair<int, int> a[MAX]; // コスト記憶用
	cin >> N >> M;
	static Tree t[MAX];
	for (int i = 0;i < N;i ++) {
		cin >> t[i].cost;
		t[i].treeNum = -1;
		t[i].use = false;
		t[i].DFSread = false;
		a[i] = make_pair(t[i].cost, i);
	}
	int x, y;
	for (int i = 0;i < M;i ++) {
		cin >> x >> y;
		t[x].edge.push_back(y);
		t[y].edge.push_back(x);
	}
	
	int num = 0; // 木の数
	int64_t cost = 0; // 最終コスト
	for (int i = 0;i < N;i ++) {
		// 木ごとにナンバリングすることで所属を確定させていくよ！DFSとかで良いかな
		if (t[i].treeNum == -1) { // 未確定木を発見したら
			setTreeNum(t, i, num); // ナンバリングのお時間だ！
			cost += getMinimum(t, i); // そして最小値の頂点を接続用に使うのでコストとして計算
			num ++;
		}
	}
//	cout << "木の数:" << num << endl;
	
	if (num > (N + 2) / 2) {
		cout << "Impossible";
		return 0;
	}
	
	sort(a, a+N); // さっきのコストを記憶してた分がここで生きるよ
	for (int i = 0, c = num - 2;c > 0;i ++) {
		if (t[a[i].second].use == false) { // コスト最小順に見た奴が使われてないなら
			cost += a[i].first; // そのコストを足してしまおう
			c --;
		}
	}
	if (num == 1) cout << 0;
	else cout << cost;
	return 0;
}
/*
まず、impossibleかどうか先に判定してしまおう
これは、森に何本の木があるかで判定できる
木同士を1個つなぐ度に2本の頂点が使用されるので、
N本の木を繋ぐためには2(N-1)個の頂点が必要である
言い換えると、頂点がNならば木の個数は(N+2)/2個以下でないといけない
逆に頂点がNの時木の個数が(N+2)/2個以下ならば必ず1個の木にできる

次に、使用する頂点を選ぶ
選ぶ頂点の数は、木の個数をAとしたときに2(A-1)個であり、しかもそれは全ての木から最低でも1個は選ぶ必要がある
逆に、全ての木から1個ずつ選べば後は一番コストの小さい頂点から順に選べば良いことが分かる

全ての木からまず1個ずつの頂点を選び、次にA-2個の任意頂点を選べば良いわけだ
当然だが頂点はコスト最小順かつまだ使われていない奴
後は分かるな？

あ、注意点
木の数が1本の時のみ、全ての木から1個ずつの～の下りが不要になる
よってこの時は0返しておけばいい
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:79:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   79 |         sort(a, a+N); // さっきのコストを記憶してた分がここで生きるよ
      |         ^~~~
      |         short
Language: C++

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

int main()
{
	int X, Y;
	cin >> X >> Y;
	__int64 max = 1000000000000000000;
	int k = -1;
	for (int i = 1; i <= max; i++){
	     int j = ((i % X == 0) && (i % Y != 0)) ? i : -1;
		 k = j > k ? j : k;
		 }
	cout << k;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    8 |         __int64 max = 1000000000000000000;
      |         ^~~~~~~
      |         __ynf64
a.cc:10:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<='
   10 |         for (int i = 1; i <= max; i++){
      |                         ~~^~~~~~
Language: C++

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

int main()
{
	int X, Y;
	cin >> X >> Y;
	__int64 max = 1000000000000000000;
	int k = -1;
	for (int i = 1; i <= max; i++){
	     int j = ((i % X == 0) && (i % Y != 0)) ? i : -1;
		 k = j > k ? j : k;
		 }
	cout << k;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    8 |         __int64 max = 1000000000000000000;
      |         ^~~~~~~
      |         __ynf64
a.cc:10:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<='
   10 |         for (int i = 1; i <= max; i++){
      |                         ~~^~~~~~
Language: C++

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

int main() {
	long long int a,b;
	cin >> a >> b;
	if(a%b == 0){
	    cout << -1;
	    return;
	}
	long long ans = a;
	while(ans%b == 0){
	    ans += a;
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |             return;
      |             ^~~~~~
Language: C++


int main() {
	unsigned long long X;
	unsigned long long Y;
	cin >> X;
	cin >> Y;
	if (X%Y == 0) {
		cout << -1 << endl;
	}
	unsigned long long aa = 1;
	unsigned long long i = 1;
	while (aa>0) {
		aa = X*Y - X*i;
		if (aa%Y != 0) {
			cout << aa << endl;
			return 0;
		}
		i++;
	}
	cout << -1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> X;
      |         ^~~
a.cc:8:17: error: 'cout' was not declared in this scope
    8 |                 cout << -1 << endl;
      |                 ^~~~
a.cc:8:31: error: 'endl' was not declared in this scope
    8 |                 cout << -1 << endl;
      |                               ^~~~
a.cc:15:25: error: 'cout' was not declared in this scope
   15 |                         cout << aa << endl;
      |                         ^~~~
a.cc:15:39: error: 'endl' was not declared in this scope
   15 |                         cout << aa << endl;
      |                                       ^~~~
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << -1 << endl;
      |         ^~~~
a.cc:20:23: error: 'endl' was not declared in this scope
   20 |         cout << -1 << endl;
      |                       ^~~~
Language: C++

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

int main()
{
int n,n;
cin>>n>>m;
if(n==m){
cout<<"-1";return 0;}
else
{
int k=1;
while(k)
{
if((n*k)%m!=0)
cout<<n*k<<endl;
else
k++;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: redeclaration of 'int n'
    6 | int n,n;
      |       ^
a.cc:6:5: note: 'int n' previously declared here
    6 | int n,n;
      |     ^
a.cc:7:9: error: 'm' was not declared in this scope
    7 | cin>>n>>m;
      |         ^
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C

#include <stdio.h>


int main(void)
{
	int i, j;
	scanf_s("%d %d", &i,&j);
	if (i==j) printf("%d\n",-1);
	else {
		while (i%j == 0) i += i;
		printf("%d\n", i);
	}
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scanf_s("%d %d", &i,&j);
      |         ^~~~~~~
      |         scanf
Language: C

#include <iostream>
using namespace std;
int main ()
{
	int a,b,c,i;
	while (cin >>a>>b)
	{	
	if(a==b||b==1) 	cout<<"-1"<<endl;	
	else 
	{	for(i=a+1;;i++)
			{
				if(i%a==0&&i%b!=0)
				{
					cout <<i<<endl;
					break;
				}
					}		
			
			
			}	
	
		
		
	}
	
	
	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 ( ){
 int X,Y;
 cin >> X,Y;
 if (X%Y ==0 && X=>Y ) {
 cout << -1;
} else {
 cout << X*(Y+1);
}
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: expected primary-expression before '>' token
    6 |  if (X%Y ==0 && X=>Y ) {
      |                   ^
Language: C

             #include<stdio.h>
                int main(void){
                long long int X,Y,i=1,ans=-2;
                int nans=-1;
                scanf("%lld",&X);
                scanf("%lld",&Y);
                if(X<Y) ans =X;
                if(Y==1) {
                printf("%d",nans);
                return 0;
               }
                if(X>Y) {
                if(X%Y!=0) ans = X;
                if(X%Y==0) ans = X*(Y+1)
              }
                 if(ans!=-2) printf("%lld\n",ans);
                 else printf("%d",nans);
                return 0;
                }

Compiler output:
main.c: In function 'main':
main.c:14:41: error: expected ';' before '}' token
   14 |                 if(X%Y==0) ans = X*(Y+1)
      |                                         ^
      |                                         ;
   15 |               }
      |               ~
Language: C++

#include <bits/stdc++.h>
#define MAX 1000001
#define M 1000000007
#define ll long long
#define ld long double

// #define left (2*i+1)
// #define right (2*i+2)
// #define mid ((l+r)>>1)

using namespace std;

int val;
int cn;

int getVal(int x) {
	cn++;
	// cout << cn << endl;
	cout << x << endl;
	fflush(stdout);
	string s;
	cin >> s;
	if (s=="Male") val = 0;
	else if (s=="Female") val = 1;
	else val = 2;
	return 0;
}

int bs(int l, int r, int gl, int gr) {
	// cout << l << " " << r << endl;
	if (l==r) return l;
	if (r-l==2) return l+1;
	// int mid = (l+r)>>1;
	// if (mid&1) mid--;
	
	getVal(mid);
	if (val==2) return -1;

	if (val==gl) return bs(mid, r, val, gr);
	else return bs(l, mid, gl, val);
}

int main() {
	int n;
	cin >> n;
	int l = 0, r = n-1;
	getVal(l);
	int gl = val;
	if (gl==2) {
		return 0;
	}
	getVal(r);
	int gr = val;
	if (gr==2) {
		return 0;
	}

	int res = bs(0, n-1, gl, gr);
	if (res!=-1) {
		getVal(res);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int bs(int, int, int, int)':
a.cc:36:16: error: 'mid' was not declared in this scope
   36 |         getVal(mid);
      |                ^~~
Language: C

         #include<stdio.h>
            int main(void){
            long long int X,Y,i=1,ans=-2;
            int nans=-1;
            scanf("%lld",&X);
            scanf("%lld",&Y);
            if(X<Y) ans =X;
            if(Y==1) {
            printf("%d",nans);
            return 0;
           }
            if(X>Y) {
            if(X%Y!=0) ans = X;
            if(X%Y==0) ans = X*(Y+1)
          }
             if(ans!=-2) printf("%lld\n",ans);
             else printf("%d",nans);
            return 0;
            }

Compiler output:
main.c: In function 'main':
main.c:14:37: error: expected ';' before '}' token
   14 |             if(X%Y==0) ans = X*(Y+1)
      |                                     ^
      |                                     ;
   15 |           }
      |           ~
Language: C

 #include<stdio.h>
    int main(void){
    long long int X,Y,i=1,ans=-2;
    int nans=-1;
    scanf("%lld",&X);
    scanf("%lld",&Y);
    if(X<Y) ans =X;
    if(Y==1) {
    printf("%d",nans);
    return 0;
   }
    if(X>Y) {
    if(X%Y!=0) ans = X;
    if(X%Y==0) {
    if(X+1<=1000000000000000000)ans = X+1;
  }
     if(ans!=-2) printf("%lld\n",ans);
     else printf("%d",nans);
    return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:20:5: error: expected declaration or statement at end of input
   20 |     }
      |     ^
Language: C++

#include<iostream>
#include<map>
#include<algorithm>
using namespace std;
typedef long long ll;

int Gcd(int a, int b)
{
	if (b == 0)
		return a;
	return Gcd(b, a % b);
}
int main()
{
	long long a, b;
	cin >> a >> b;
	long long maxn =1000000000000000000;
	long long  flag1 = 0;
	long long  flag2 = 0;
	for (int i = a + a; i <= maxn; i *= 2)
	{
		if (i%b != 0)
		{
			cout << i << endl;
			flag1 = i;
			break;
		}
	}

	for (int j = b + b; j <= maxn; j *= 2)
	{
		if (j%a != 0)
		{
			//cout << j<< endl;
			flag2 = j;
			break;
		}
	}
	if (x == 1 ||y == 1)cout << -1;
	else if (flag1 > 0 && flag2 > 0)cout << min(flag1, flag2);
	else if (flag1>0)cout << flag1;
	else if (flag2>0)cout << flag2;
	else cout << -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: error: 'x' was not declared in this scope
   39 |         if (x == 1 ||y == 1)cout << -1;
      |             ^
a.cc:39:22: error: 'y' was not declared in this scope
   39 |         if (x == 1 ||y == 1)cout << -1;
      |                      ^
Language: Java

import java.util.Scanner;
public class Main

{
    public static void main(String arg[])
    {
        int a,b;
        Scanner scan=new Scanner(System.in);
        a=scan.nextInt();
        b=scan.nextInt();
        if(a%b==0)
        return -1;
        if(a==b)
        System.out.println("-1");
        int c=a;
        while(2>1)
        {
            if(c%a==0&&c%b!=0&&c!=a)
            {
            System.out.println(c);
            break;
            }
            c=c+a;
        }
    }
}

Compiler output:
Main.java:12: error: incompatible types: unexpected return value
        return -1;
               ^
1 error
Language: C++

#include <iostream>
using namespace std;

int main()
{
  cin >> x >> y;

  if (x == y){
    cout << -1 ;
  }else{
    for(int i = 0; i < 100000000 ; i++){
      a = x * i + 1;
      if ((a % y == 0) || (y % a == 0)){
        b = 1;}
      else{
        break;
      }
    a = -1;
    }
    cout << a;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'x' was not declared in this scope
    6 |   cin >> x >> y;
      |          ^
a.cc:6:15: error: 'y' was not declared in this scope
    6 |   cin >> x >> y;
      |               ^
a.cc:12:7: error: 'a' was not declared in this scope
   12 |       a = x * i + 1;
      |       ^
a.cc:14:9: error: 'b' was not declared in this scope
   14 |         b = 1;}
      |         ^
a.cc:20:13: error: 'a' was not declared in this scope
   20 |     cout << a;
      |             ^
Language: C++

#include <iostream>

int main()
{
  cin >> x >> y;

  if (x == y){
    cout << -1 ;
  }else{
    for(int i = 0; i < 100000000 ; i++){
      a = x * i + 1;
      if ((a % y == 0) || (y % a == 0)){
        b = 1;}
      else{
        break;
      }
    a = -1;
    }
    cout << a;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> x >> y;
      |   ^~~
      |   std::cin
In file included 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:5:10: error: 'x' was not declared in this scope
    5 |   cin >> x >> y;
      |          ^
a.cc:5:15: error: 'y' was not declared in this scope
    5 |   cin >> x >> y;
      |               ^
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |     cout << -1 ;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:7: error: 'a' was not declared in this scope
   11 |       a = x * i + 1;
      |       ^
a.cc:13:9: error: 'b' was not declared in this scope
   13 |         b = 1;}
      |         ^
a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout << a;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:13: error: 'a' was not declared in this scope
   19 |     cout << a;
      |             ^
Language: C++

#include<bits/stdc++.h>
#include<map>
#include<algorithm>
using namespace std;
typedef long long ll;


int main()
{
	long long a, b;
	cin >> a >> b;
	long long maxn =1000000000000000000;
	long long  flag1 = 0;
	long long  flag2 = 0;
	for (int i = a + a; i <= maxn; i += a)
	{
		if (i%b != 0)
		{
			cout << i << endl;
			flag1 = i;
			break;
		}
	}

	for (int j = b + b; j <= maxn; j += b)
	{
		if (j%a != 0)
		{
			//cout << j<< endl;
			flag2 = j;
			break;
		}
	}
	if (x == 1 ||y == 1)cout << -1;
	if (flag1 > 0 && flag2 > 0)cout << min(flag1, flag2);
	else if (flag1>0)cout << flag1;
	else if (flag2>0)cout << flag2;
	else cout << -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'x' was not declared in this scope
   34 |         if (x == 1 ||y == 1)cout << -1;
      |             ^
a.cc:34:22: error: 'y' was not declared in this scope
   34 |         if (x == 1 ||y == 1)cout << -1;
      |                      ^
Language: C++

#include <iostream>
using namespace std;
 
long int main(){
   int x,y;
 
   cin >> x;
   cin >> y;
 
    if(x%y == 0) cout << -1;
 
   else cout <<  (x*y)+x;

   return 0;
}


Compiler output:
a.cc:4:6: error: '::main' must return 'int'
    4 | long int main(){
      |      ^~~
Language: Java

import java.util,Scanner;
public class Main

{
    public static void main(String arg[])
    {
        int a,b;
        Scanner scan=new Scanner(System.in);
        a=scan.nextInt();
        b=scan.nextInt();
        if(a==b)
        System.out.println("-1");
        int c=a>b?a:b;
        c=c+1;
        while(2>1)
        {
            if(c%a==0&&c%b!=0)
            {
            System.out.println(c);
            break;
            }
            c=c+1;
        }
    }
}

Compiler output:
Main.java:1: error: ';' expected
import java.util,Scanner;
                ^
1 error
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int x, y;
	cin >> x >> y;
	if (x == y)
	{
		cout << -1 << endl;
	}
	else if (x % y == 0)
	{
		cout << -1 << endl;
	}
	else if (y % x == 0)
	{
		cout << -1 << endl;
	}
	else
	{
		int c = 1;
		for (int i = 1; i < 100000; i++)
		{
			
			if ((x * i) % y != 0)
			{
				c = i;
				break;
			}
		}
		cout << x * c << endl;
	}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:33:10: error: expected '}' at end of input
   33 |         }
      |          ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <set>
#include <iomanip>
#include <vector>

using namespace std;

int main() {
	long long x, y;
	cin >> x >> y;
	long long k = 1;
	if (y == x) {
		cout << -1;
		return 0;
	}
	while (k * x <= INT_MAX) {
		++k;
		if ((k * x) % y != 0)
			break;
		++k;
		if ((k * x) % y != 0)
			break;
		++k;
		if ((k * x) % y != 0)
			break;
	}
	if (k * x <= INT_MAX)
		cout << k * x;
	else
		cout << -1;

#ifdef DIMA_DEBUG
	system("pause");
#endif // DIMA_DEBUG

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'INT_MAX' was not declared in this scope
   20 |         while (k * x <= INT_MAX) {
      |                         ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <vector>
  +++ |+#include <climits>
    9 | 
a.cc:31:22: error: 'INT_MAX' was not declared in this scope
   31 |         if (k * x <= INT_MAX)
      |                      ^~~~~~~
a.cc:31:22: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: Java

public class Main

{
    public static void main(String arg[])
    {
        int a,b;
        Scanner scan=new Scanner(System.in);
        a=scan.nextInt();
        b=scan.nextInt();
        if(a==b)
        System.out.println("-1");
        int c=a>b?a:b;
        c=c+1;
        while(2>1)
        {
            if(c%a==0&&c%b!=0)
            {
            System.out.println(c);
            break;
            }
            c=c+1;
        }
    }
}

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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
const int MaxN = 1e4;

int main()
{
	int n,biu,pia;
	char a[10],x,lj;
	while(~scanf("%d",&n))
	{
		pia = 0;
		n--;
		biu = (n+pia)/2;
		printf("%d\n",n);
		scanf("%c",&lj);
		gets(a);
		if(a[0]=='V') break;
		x = a[0];
		for(;;)
		{
			if(n!=pia) biu = (n+pia)/2;
			else biu = n-1;
			printf("%d\n",biu);
			gets(a);
			if(a[0]=='V') break;
			if(x==a[0]) n = biu;
			else pia = biu;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   21 |                 gets(a);
      |                 ^~~~
      |                 getw
Language: C

#include<stdio.h>
 
int main(void){
 
double x,y;
double ans;
scanf("%lf",&x);
scanf("%lf",&y);
 
if(x == y){
printf("-1");
}
else{
for(i=0;i<10000000000;i++){
ans = x * i;
if(ans == y)
goto end;
}
}
end:
printf("%f",ans);
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:5: error: 'i' undeclared (first use in this function)
   14 | for(i=0;i<10000000000;i++){
      |     ^
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#Include<stdio.h>

int main(void){

double x,y;
double ans;
scanf("%lf",&x);
scanf("%lf",&y);

if(x == y){
printf("-1");
}
else{
for(i=0;i<100000000;i++){
ans = x * i;
if(ans == y)
goto end:
}
}
end;
printf("%f",ans);

return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include<stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 | scanf("%lf",&x);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #Include<stdio.h>
main.c:7:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 | scanf("%lf",&x);
      | ^~~~~
main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 | printf("-1");
      | ^~~~~~
main.c:11:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:5: error: 'i' undeclared (first use in this function)
   14 | for(i=0;i<100000000;i++){
      |     ^
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:9: error: expected ';' before ':' token
   17 | goto end:
      |         ^
      |         ;
main.c:20:1: error: 'end' undeclared (first use in this function)
   20 | end;
      | ^~~
main.c:21:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   21 | printf("%f",ans);
      | ^~~~~~
main.c:21:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:1: error: label 'end' used but not defined
   17 | goto end:
      | ^~~~
Language: C

#include <stdio.h>
 
int main(void){
 
double a,y,ans;
int n[2];
int i;
int check = 0;
double ans_2;
 
scanf("%d",n);
scanf("%d",n);
 
 
for(i=1;i<10000000;i++){
 
   a = n[0] * (i + 1);
    if (a % n[1] == 0 || n[1] % a == 0)
        y = 1;
    else
        break;
    a = -1;
 
printf("%f",a);
}
 
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:11: error: invalid operands to binary % (have 'double' and 'int')
   18 |     if (a % n[1] == 0 || n[1] % a == 0)
      |           ^ ~~~~
      |              |
      |              int
main.c:18:31: error: invalid operands to binary % (have 'int' and 'double')
   18 |     if (a % n[1] == 0 || n[1] % a == 0)
      |                          ~~~~ ^
      |                           |
      |                           int
Language: C++

#include <bits/stdc++.h>
#define che
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long LL;


int main(){
	LL x, y;
	scanf("%lld%lld", &x, &y);
	if ( x%y==0) printf("-1\n");
		else{
			if ( y==2) printf("%lld\n", x*3);
				else printf("%lld\n", x*(GCD(x,y)+1));
		}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:58: error: 'GCD' was not declared in this scope
   16 |                                 else printf("%lld\n", x*(GCD(x,y)+1));
      |                                                          ^~~
Language: C

#include <stdio.h>
 
int main(void){
 
double a,y,ans;
int n[2];
int i;
int check = 0;
double ans_2;
 
scanf("%d",n);
scanf("%d",n);
 
 
for(i=1;i<10000000;i++){
 
   a = n[0] * (i + 1);
    if (a % n[1] == 0 || n[1] % a == 0)
        y = 1;
    else:
        break;
    a = -1;
 
printf("%f",a);
}
 
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:11: error: invalid operands to binary % (have 'double' and 'int')
   18 |     if (a % n[1] == 0 || n[1] % a == 0)
      |           ^ ~~~~
      |              |
      |              int
main.c:18:31: error: invalid operands to binary % (have 'int' and 'double')
   18 |     if (a % n[1] == 0 || n[1] % a == 0)
      |                          ~~~~ ^
      |                           |
      |                           int
main.c:20:9: error: expected expression before ':' token
   20 |     else:
      |         ^
Language: C++

#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    int n,m;
    while(scanf("%d%d",&n,&m)==2){
        long long ans;
        if(m==n) printf("-1\n");
        else if(n==1) printf("%d\n",m+1);
        else if(m%n==0&&m/n=2) printf("-1\n");
        else{
            int i=2;
            ans=n*i;
            while(ans<2*m*n){
                if(ans%m!=0) break;
                i++;
                ans=n*i;
            }
            printf("%lld\n",ans);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: lvalue required as left operand of assignment
   13 |         else if(m%n==0&&m/n=2) printf("-1\n");
      |                 ~~~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int x, y;
	cin >> x >> y;

	if (x == y)
	{
		cout << -1 << endl;
	}
	else if (y % x == 0)
	{
		cout << -1 << endl;
	}
	else
	{
		cout << x * t << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:29: error: 't' was not declared in this scope
   19 |                 cout << x * t << endl;
      |                             ^
Language: C++

#include <iostream>

int a, b, c, d, e;

int kekka(int, int, int);
int main()
{
	std::cin >> a;
	std::cin >> b;

	d = 100000000000000000 / a;
	std::cout << kekka(a,b,d) << std::endl;
	return 0;
}

int kekka(int a, int b, int d)
{
	for(int i = 0 ; i <= d; i++)
	{
		e =  a * i; 
		if ( a == b)
		{
			c = -1;
			break;
		}else if(b == 1){
			c = -1;
			break;
		}else if( a < b)
		{
			c = a * 2;
			break;
		}
		}else if((e % a == 0) && (e % b != 0))
		{
			c = e;
			break;
		}
		else{
			c = -1;
		}
	}
	return c;
}

Compiler output:
a.cc: In function 'int kekka(int, int, int)':
a.cc:33:18: error: 'else' without a previous 'if'
   33 |                 }else if((e % a == 0) && (e % b != 0))
      |                  ^~~~
a.cc:36:25: error: break statement not within loop or switch
   36 |                         break;
      |                         ^~~~~
a.cc:41:9: warning: no return statement in function returning non-void [-Wreturn-type]
   41 |         }
      |         ^
a.cc: At global scope:
a.cc:42:9: error: expected unqualified-id before 'return'
   42 |         return c;
      |         ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C

#include <stdio.h>
 
int main(void){
 
double a,y,ans;
int n[2];
int i;
int check = 0;
double ans_2;
 
scanf("%lf",n);
scanf("%lf",n);
 
if(x == y)
printf("-1");
 
 
for(i=1;i<10000000;i++){
 
   a = n[0] * (i + 1);
    if (a % n[1] == 0 || n[1] % a == 0)
        y = 1;
    else:
        break;
    a = -1;
 
printf("%f",a);
}
 
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:4: error: 'x' undeclared (first use in this function)
   14 | if(x == y)
      |    ^
main.c:14:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:11: error: invalid operands to binary % (have 'double' and 'int')
   21 |     if (a % n[1] == 0 || n[1] % a == 0)
      |           ^ ~~~~
      |              |
      |              int
main.c:21:31: error: invalid operands to binary % (have 'int' and 'double')
   21 |     if (a % n[1] == 0 || n[1] % a == 0)
      |                          ~~~~ ^
      |                           |
      |                           int
main.c:23:9: error: expected expression before ':' token
   23 |     else:
      |         ^
Language: C++

#include <iostream>
using namespace std;
 
int main(){
   int x,y;
 
   cin >> x y;
 
    if(x%y == 0) return -1;
 
   return (x*y)+x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected ';' before 'y'
    7 |    cin >> x y;
      |            ^~
      |            ;
Language: C

#include <stdio.h>
 
int main(void){
 
double a,y,ans;
double n[2];
int i;
int check = 0;
double ans_2;
 
scanf("%lf",n);
scanf("%lf",n);
 
if(x == y)
printf("-1");
 
 
for(i=1;i<10000000;i++){
 
   a = n[0] * (i + 1);
    if (a % n[1] == 0 || n[1] % a == 0)
        y = 1;
    else:
        break;
    a = -1;
 
printf("%f",a);
}
 
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:4: error: 'x' undeclared (first use in this function)
   14 | if(x == y)
      |    ^
main.c:14:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:11: error: invalid operands to binary % (have 'double' and 'double')
   21 |     if (a % n[1] == 0 || n[1] % a == 0)
      |           ^ ~~~~
      |              |
      |              double
main.c:21:31: error: invalid operands to binary % (have 'double' and 'double')
   21 |     if (a % n[1] == 0 || n[1] % a == 0)
      |                          ~~~~ ^
      |                           |
      |                           double
main.c:23:9: error: expected expression before ':' token
   23 |     else:
      |         ^
Language: C

#include <stdio.h>
 
int main(void){
 
double a,y,ans;
double n[2];
int i;
int check = 0;
double ans_2;
 
scanf("%lf",n);
scanf("%lf",n);
 
if(x == y)
printf("-1");
 

for(i=1;i<10000000;i++){

   a = n[0] * (i + 1)
    if (a % n[1] == 0 || n[1] % a == 0)
        y = 1;
    else:
        break
    a = -1

print(a)


}

if(check == 0)
printf("-1");
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:4: error: 'x' undeclared (first use in this function)
   14 | if(x == y)
      |    ^
main.c:14:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:22: error: expected ';' before 'if'
   20 |    a = n[0] * (i + 1)
      |                      ^
      |                      ;
   21 |     if (a % n[1] == 0 || n[1] % a == 0)
      |     ~~                
main.c:23:5: error: 'else' without a previous 'if'
   23 |     else:
      |     ^~~~
main.c:23:9: error: expected expression before ':' token
   23 |     else:
      |         ^
Language: C++

#include <iostream>

int a, b, c, d, e;

int kekka(int, int, int);
int main()
{
	std::cin >> a;
	std::cin >> b;

	d = 100000000000000000 / a;
	std::cout << kekka(a,b,d) << std::endl;
	return 0;
}

int kekka(int a, int b, int d)
{
	for(int i = 0 ; i <= d; i++)
	{
		e =  a * i; 
		if ( a == b)
		{
			c = -1;
			break;
		}else if( a < b) && (b % a == 0)
		{
			e = b + a;
			break;
		}else if((e % a == 0) && (e % b != 0))
		{
			c = e;
			break;
		}
		else{
			c = -1;
		}
	}
	return c;
}

Compiler output:
a.cc: In function 'int kekka(int, int, int)':
a.cc:25:37: error: expected identifier before '(' token
   25 |                 }else if( a < b) && (b % a == 0)
      |                                     ^
Language: C++

#include <iostream>
#using namespace std;

int main(){
   int x,y;
 
   cin >> x;
   cin >> y;
 
    if(x%y == 0) return -1;
 
   return (x*y)+x;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #using
    2 | #using namespace std;
      |  ^~~~~
a.cc: In function 'int main()':
a.cc:7:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |    cin >> x;
      |    ^~~
      |    std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

int main(){
   int x,y;

   cin >> x;
   cin >> y;

    if(x%y == 0) return -1;

   return (x*y)+x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:4: error: 'cin' was not declared in this scope
    4 |    cin >> x;
      |    ^~~
Language: C

#include <stdio.h>
 
int main(void){
 
double x,y,ans;
int i;
int check = 0;
double ans_2;
 
scanf("%lf",&x);
scanf("%lf",&y);
 
if(x == y)
printf("-1");
 
if(x*y > 1000000000000000000)
for(i=1;i<10000000;i++){
ans = x * i;
ans_2 = (int)ans%y ;
if(ans_2  != 0){
printf("%lf",ans);
check = 1;
goto end;
}
}
end:
if(check == 0)
printf("-1");
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:17: error: invalid operands to binary % (have 'int' and 'double')
   19 | ans_2 = (int)ans%y ;
      |         ~~~~~~~~^
      |         |
      |         int
Language: C

#include <stdio.h>
 
int main(void){
 
double x,y,ans;
int i;
int check = 0;
double ans_2;
 
scanf("%lf",&x);
scanf("%lf",&y);
 
if(x == y)
printf("-1");
 
if(x*y > 1000000000000000000)
for(i=1;i<10000000;i++){
ans = x * i;
ans_2 = ans%(int)y ;
if(ans_2  != 0){
printf("%lf",ans);
check = 1;
goto end;
}
}
end:
if(check == 0)
printf("-1");
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary % (have 'double' and 'int')
   19 | ans_2 = ans%(int)y ;
      |            ^~~~~~~
      |             |
      |             int
Language: C

#include <stdio.h>
int main(){
    long int X,Y;
    scanf("%ld%ld",&X,&Y);
    int count=0;
if(X>500000000){
    printf("%d",-1);
    count=100
}else if(X%Y==0){
    printf("%d",-1);
    count=100;
}else{
    for(long int i=0;i<=500000000;i++){
        if((X*i)%Y!=0){
            printf("%ld",X*i);
            count+=1;
            break;
        }
    }
}
if(count==0){
    printf("%d",-1);
}

}


Compiler output:
main.c: In function 'main':
main.c:8:14: error: expected ';' before '}' token
    8 |     count=100
      |              ^
      |              ;
    9 | }else if(X%Y==0){
      | ~
Language: C

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
typedef long long LL;
using namespace std;
const int MaxN = 3e5 + 5;

int main() {
	int x, y;
	scanf("%d %d", &x, &y);
	if(x % y == 0) {
		printf("-1\n");
		return 0;
	}
	for(int i = 2; ; i++) {
		LL tem = i * x;
		if(tem % y != 0) {
			printf("%lld\n", tem);
			return 0;
		}
		if(tem > 1e18) break;
	}
	printf("-1\n");
	return 0;
}

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

#include <stdio.h>
 
int main(void){
 
double x,y,ans;
int i;
int check = 0;
double ans_2;
 
scanf("%d",&x);
scanf("%d",&y);
 
if(x == y)
printf("-1");
 
if(x*y > 1000000000000000000)
for(i=1;i<10000000;i++){
ans = x * i;
ans_2 = ans%y ;
if(ans_2  != 0){
printf("%d",ans);
check = 1;
goto end;
}
}
end:
if(check == 0)
printf("-1");
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary % (have 'double' and 'double')
   19 | ans_2 = ans%y ;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rc(s) return cout<<s,0
long long x,y;
int main(){
  cin >> x >> y;
  if(__gcd(x,y)==y) rc(-1);
  rc(x*__gcd(x,y);
  
}

Compiler output:
a.cc:10:2: error: unterminated argument list invoking macro "rc"
   10 | }
      |  ^
a.cc: In function 'int main()':
a.cc:8:3: error: 'rc' was not declared in this scope
    8 |   rc(x*__gcd(x,y);
      |   ^~
a.cc:8:5: error: expected '}' at end of input
    8 |   rc(x*__gcd(x,y);
      |     ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        List<Integer> xPrimes = primeFactors(x);
        List<Integer> yPrimes = primeFactors(y);
        if (x % y != 0) {
            System.out.println(x * p);
            return;
        }
        for(int p : xPrimes) {
            if (!yPrimes.contains(p)) {
                long temp = x * p;
                if (temp % y != 0) {
                    System.out.println(x * p);
                    return;
                }
            } else {
                yPrimes.remove(Integer.valueOf(p));
            }
        }
        System.out.println(-1);
    }

    public static List<Integer> primeFactors(int numbers) {
        int n = numbers;
        List<Integer> factors = new ArrayList<Integer>();
        for (int i = 2; i <= n / i; i++) {
            while (n % i == 0) {
                factors.add(i);
                n /= i;
            }
        }
        if (n > 1) {
            factors.add(n);
        }
        return factors;
    }
}


Compiler output:
Main.java:13: error: cannot find symbol
            System.out.println(x * p);
                                   ^
  symbol:   variable p
  location: class Main
1 error
Language: C++

#include <iostream>
using namespace std;
 
int main(void){
long long int x,y,t;
cin >> x >> y;
t=x;
bool flag = false;
while(t<=1e18){
if(t%y!=0){flag = true;break;}
t+=x;
}
if(flag){cout << t;}else{cout << "-1";
return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    int res;
    cin >> a >> b;
    if ((a%b) == 0) res = -1;
    else res = (a*((a*b)+1);
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: expected ')' before ';' token
    8 |     else res = (a*((a*b)+1);
      |                ~           ^
      |                            )
Language: C++

#include <Iostream>
using namespace std;

int main(void){
long long int x,y,t;
cin >> x >> y;
t=x;
bool flag = false;
while(t<=1e18){
if(t%y!=0){flag = true;break;}
t+=x;
}
if(flag){cout << t;}else{cout << "-1";
return 0;
}

Compiler output:
a.cc:1:10: fatal error: Iostream: No such file or directory
    1 | #include <Iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
 
int main(void){
 
double x,y,ans;
double i;
int check = 0;
 double ans_2;
 
 scanf("%lf",&x);
scanf("%lf",&y);
 
if(x == y)
printf("-1");
 
for(i=1;i<1000000000;i++){
ans = x * i;
ans_2 = ans%y ;
if(ans_2  != 0){
printf("%f",ans);
check = 1;
}
}
 
if(check == 0)
printf("-1");
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:12: error: invalid operands to binary % (have 'double' and 'double')
   18 | ans_2 = ans%y ;
      |            ^
Language: C

#include <stdio.h>
 
int main(void){
 
double x,y,ans;
double i;
int check = 0;
 double ans_2;
 
 scanf("%lf",&x);
scanf("%lf",&y);
 
if(x == y)
printf("-1");
 
for(i=1;i<1000000000;i++){
ans = x * i;
ans_2 = ans%y 
if(ans_2  != 0){
printf("%f",ans);
check = 1;
}
}
 
if(check == 0)
printf("-1");
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:12: error: invalid operands to binary % (have 'double' and 'double')
   18 | ans_2 = ans%y
      |            ^
main.c:18:14: error: expected ';' before 'if'
   18 | ans_2 = ans%y
      |              ^
      |              ;
   19 | if(ans_2  != 0){
      | ~~
Language: C++

int main() {
 
    long X, Y;
    scanf("%ld %ld", &X, &Y);
    if (X % Y == 0 || Y % X == 0) {
        printf("-1\n");
    } else {
        printf("%ld\n", X * (Y - 1));
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'scanf' was not declared in this scope
    4 |     scanf("%ld %ld", &X, &Y);
      |     ^~~~~
a.cc:6:9: error: 'printf' was not declared in this scope
    6 |         printf("-1\n");
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main() {
a.cc:8:9: error: 'printf' was not declared in this scope
    8 |         printf("%ld\n", X * (Y - 1));
      |         ^~~~~~
a.cc:8:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'