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

#include <iostream>
#include <queue>
#include <vector>
#include <utility>

using namespace std;

const int MAXT = 100000;
const int MAXC = 31;
int rec[MAXC];

class Compare
{
public:
    bool operator() (pair<int,int> a, pair<int,int> b) {
        if(a.first > b.first) return true;
        else if(b.first > a.first) return false;
        else if(a.second < b.second) return true;
        return false;
    }
};


priority_queue<pair<int,int>, vector<pair<int,int> >, Compare > Q;
queue<pair<int,int> > A;


int main() {
    memset(rec, -1, sizeof(rec));
    Q = priority_queue<pair<int,int> , vector<pair<int,int> >, Compare >();
    A = queue<pair<int,int> >();
    int N, C, s, t, c;
    cin >> N >> C;

    for(int i = 0; i < N; i++) {
        cin >> s >> t >> c;
        Q.push(make_pair(s-1,t-1));
    }
    
    int maxR = 0; int next = 0;
    for(int t = 0; t <= MAXT && !Q.empty(); t++) {
        for(int i = C-1; i >= 0; i--) {
            if(rec[i] < t && rec[i] >= 0) {
                //cout << "remove " << i << " in " << t << " cz " << rec[i] << endl;
                next--;
                rec[i] = -1;
            }
        }
        pair<int,int> aux2 = Q.top();
        while(aux2.first  == t && !Q.empty()) {
            //cout << aux2.first << " " << aux2.second << endl;
            A.push(aux2);
            Q.pop();
            if(!Q.empty())aux2 = Q.top();
        }
        while(!A.empty()) {
            pair<int,int> curr = A.front();
           // cout << curr.first << " " << curr.second << " t: " << t << endl; 
            A.pop();
            rec[next] = curr.second;
            next++;
            maxR = max(maxR, next);
        }
    }
    cout << maxR << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'memset' was not declared in this scope
   29 |     memset(rec, -1, sizeof(rec));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <utility>
  +++ |+#include <cstring>
    5 |
Language: C++

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

int main()
{
	int n, c;
	scanf("%d %d", &n, &c);
	vector<vector<int>> events;
	for (int i = 0; i < n; i++)
	{
		vector<int> t(3);
		for (int j = 0; j < 3; j++)
			scanf("%d", &t[j]);
		events.push_back(t);
	}
	sort(events.begin(), events.end());

	size_t ans = 0;
	priority_queue<pair<int, int>, vector<pair<int, int>> , greater<pair<int, int>>> pq;
	for (int i = 0; i < n; i++)
	{
		while (!pq.empty() && pq.top().first < events[i][0])
			pq.pop();
		vector<pair<int, int>> t;
		while (!pq.empty() && pq.top().first == events[i][0])
		{
			t.push_back(pq.top());
			pq.pop();
			if (t.back().second == events[i][2])
				t.pop_back();
		}
		pq.push({events[i][1], events[i][2]});
		ans = max(ans, pq.size() + t.size());
	}
	printf("%ld\n", ans);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |         sort(events.begin(), events.end());
      |         ^~~~
      |         short
Language: C

#include <iostream>
#include <vector>

using namespace std;

int f[100][10] = {};
long long p[100][11] = {};
int n;
long long total = -1000000000000;

vector<int> v;
vector<int> ans;

long long calc_score(){
  long long tmp_total = 0;
  for (int i=0;i<n;i++) {
    int simul_open = 0;
    for (int j=0;j<10;j++) {
      if (v[j] == 1 && f[i][j] == 1) {
	simul_open++;
      }
    }
    tmp_total += p[i][simul_open];
  }
  return(tmp_total);
}

void dfs(int k){
  if (k==10) {
    int open_sum = 0;
    for (int i=0;i<10;i++) {
      open_sum += v[i];
    }
    if (open_sum > 0) {
      long long tmp_total = calc_score();
      if (tmp_total > total) {
	total = tmp_total;
      }
    }
    return;
  }
  v.push_back(1);
  dfs(k+1);
  v.pop_back();
  v.push_back(0);
  dfs(k+1);
  v.pop_back();
  return;
}

int main(){
  cin >> n;
  for (int i=0;i<n;i++) {
    for (int j=0;j<10;j++) {
      int tmp;
      cin >> tmp;
      f[i][j] = tmp;
    }
  }
  for (int i=0;i<n;i++) {
    for (int j=0;j<=10;j++) {
      long long tmp;
      cin >> tmp;
      p[i][j] = tmp;
    }
  }
  dfs(0);
  cout << total << endl;
  return(0);
}


Compiler output:
main.c:1:10: 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 n,c;
	cin>>n>>c;
	//cout<<n<<c;
	int arr1[n],arr2[n],arr3[n];
	for(int k=0;i<n;i++){
		cin>>arr1[k];
		cin>>arr2[k];
		cin>>arr3[k];
		//cout<<"done"<<endl;
	}
	//cout<<"done";
	
	sort(arr2,arr2+n);
	sort(arr1,arr1+n);
	//cout<<arr2[0];
	//cout<<result<<endl;
	  int plat_needed = 1, result = 1;
   int i = 1, j = 0;
 
   // Similar to merge in merge sort to process all events in sorted order
   while (i < n && j < n)
   {
      // If next event in sorted order is arrival, increment count of
      // platforms needed
      if (arr1[i] < arr2[j])
      {
          plat_needed++;
          i++;
          if (plat_needed > result)  // Update result if needed
              result = plat_needed;
      }
      else // Else decrement count of platforms needed
      {
          plat_needed--;
          j++;
      }
   }
	cout<<result<<endl;
}	

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
	ll n, c; cin >> n >> c;
	ll po[(ll)1e5 * 2 + 100][c];
	for(ll i = 0; i < 1e5 * 2 + 100; ++i)for(ll j = 0; j < c; ++j) po[i][j] = 0;
	for(ll i = 0; i < n; ++i){
		ll s, t, c; cin >> s >> t >> c;
		po[s * 2 - 1][--c] = 1;
		if(po[t * 2 + 1] + po[t * 2 - 1] + po[t * 2][c] <= 0) po[t * 2][c] = -1;
	}
	for(ll i = 1; i < 1e5 * 2 + 100; ++i)for(ll j = 0; j < c; ++j){
		po[i][j] += po[i - 1][j];
		po[i][j] = min<ll>(po[i][j], 1);
		po[i][j] = max<ll>(po[i][j], 0);
	}
	ll yo[(ll)1e5 * 2 + 100] = {};
	for(ll i = 0; i < 1e5 * 2 + 100; ++i)for(ll j = 0; j < c; ++j) yo[i] += po[i][j];
	ll ans = 0;
	for(ll i = 0; i < 1e5 * 2 + 100; ++i){
		ans = max<ll>(ans, yo[i]);
	}
	cout << max<ll>(ans, 0) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: invalid operands of types 'll [c]' {aka 'long long int [c]'} and 'll [c]' {aka 'long long int [c]'} to binary 'operator+'
   11 |                 if(po[t * 2 + 1] + po[t * 2 - 1] + po[t * 2][c] <= 0) po[t * 2][c] = -1;
      |                    ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
      |                                |               |
      |                                |               ll [c] {aka long long int [c]}
      |                                ll [c] {aka long long int [c]}
Language: C++

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

int main(){
    int n,C;
    cin>>n>>C;
    vector<int> s(n),t(n),c(n);
    for(int i=0;i<n;i++){
        cin>>s[i]>>t[i]>>c[i];
        c[i]--;
    }
    priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> sque;
    priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> tque;
    for(int i=0;i<n;i++){
        sque.push({s[i],c[i]});
        tque.push({t[i],c[i]});
    }
    int res=0;
    
    vector<int> tv(C+1);
    for(int i=0;i<=1e5+1;i++){
        vector<int> swi;
        while(!sque.empty()){
            auto buf=sque.top();
            if(buf.first==i){
                sque.pop();
                swi.push(buf.second);
                tv[buf.second]=true;
            }
            else{
                break;
            }
         }   
         res=max(res,accumulate(tv.begin(),tv.end(),0));
         while(!tque.empty()){
            auto buf=tque.top();
            if(buf.first==i){
                tque.pop();
                tv[buf.second]=false;
            }
            else{
                break;
            }
         }   
         for(int j=0;j<swi.size();j++){
             tv[swi[j]]=true;
         }
    }
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: 'class std::vector<int>' has no member named 'push'
   27 |                 swi.push(buf.second);
      |                     ^~~~
Language: C++

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,CC;
int S[101010],T[101010],C[101010],did[101010];
vector<int> st[201010];

int pre[101010];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>CC;
	FOR(i,N) {
		cin>>S[i]>>T[i]>>C[i];
		C[i]--;
		st[S[i]].push_back(i);
	}
	
	int num=0;
	FOR(i,C) pre[i]=202020;
	FOR(i,101000) {
		
		FORR(e,st[i]) {
			if(pre[C[e]]!=-1) {
				pre[C[e]]=T[e];
				did[e]++;
			}
		}
		FORR(e,st[i]) if(did[e]==0) {
			FOR(j,CC) {
				if(pre[j]<S[e]) {
					pre[j]=202020;
					pre[C[e]]=T[e];
					break;
				}
			}
			if(j==CC) {
				pre[C[e]]=T[e];
				num++;
			}
		}
	}
	
	
	
	cout<<num<<endl;
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:7:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                            ^
a.cc:32:9: note: in expansion of macro 'FOR'
   32 |         FOR(i,C) pre[i]=202020;
      |         ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int K, A, B;
    cin >> K >> A >> B;

    if(A>B && K/((A+B)/2) ==0) {
        cout << K-K/((A+B)/2)/((2000-1500)/2) << endl;
    }
    else if(A>B && K/((A+B)/2)!=0){
        cout << K-K/((A+B)/2)/((2000-1500)/2)+1 << endl;
    }
    else {
        cout << "-1" endl;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected ';' before 'endl'
   14 |         cout << "-1" endl;
      |                     ^~~~~
      |                     ;
Language: C++

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

int main() {
  int K,A,B,S; 
  cin >> K >> A >> B;
  if (B>A){
    cout << -1 << endl;
  }
  else{
    for (int i=0; K<a-b; i++){
      K -= A-B;
        S++;
    }
   cout << S*2-1 << endl;     
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'a' was not declared in this scope
   11 |     for (int i=0; K<a-b; i++){
      |                     ^
a.cc:11:23: error: 'b' was not declared in this scope
   11 |     for (int i=0; K<a-b; i++){
      |                       ^
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<cstdio>
long long a, b, c, flag;
int main()
{
	scanf("%lld%lld%lld",&a, &b, &c);
	if(b>=a) printf("1\n");
	else if(c >= b) printf("-1\n")
	else if((a-b)%(b-c) >= 1) flag = 1;
	printf("%lld\n",((a-b)/(b-c)+flag)*2+1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: error: expected ';' before 'else'
    7 |         else if(c >= b) printf("-1\n")
      |                                       ^
      |                                       ;
    8 |         else if((a-b)%(b-c) >= 1) flag = 1;
      |         ~~~~
Language: C++

#include<cstdio>
long long a, b, c;
bool flag = false;
int main()
{
	scanf("%lld%lld%lld",&a, &b, &c);
	if(b>=a) printf("1\n");
	else if(c >= b) printf("-1\n")
	else if((a-b)%(b-c) >= 1) flag = true;
	printf("%lld\n",((a-b)/(b-c)+flag)*2+1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:39: error: expected ';' before 'else'
    8 |         else if(c >= b) printf("-1\n")
      |                                       ^
      |                                       ;
    9 |         else if((a-b)%(b-c) >= 1) flag = true;
      |         ~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<cstdlib>
using namespace std;
unsigned long long k,k,a;
int ans;
int main(){
	cin>>k>>a>>b;
	if(a>=k){
		cout<<"1\n";
		return 0;
	}
	if(b>=a){
		cout<<"-1\n";
		return 0;
	}
	if((k-a)%(a-b)>=1) ans=1;
	cout<<((k-a)/(a-b)+ans)*2+1<<endl;
 	return 0;
}

Compiler output:
a.cc:9:22: error: redefinition of 'long long unsigned int k'
    9 | unsigned long long k,k,a;
      |                      ^
a.cc:9:20: note: 'long long unsigned int k' previously declared here
    9 | unsigned long long k,k,a;
      |                    ^
a.cc: In function 'int main()':
a.cc:12:20: error: 'b' was not declared in this scope
   12 |         cin>>k>>a>>b;
      |                    ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<cstdlib>
using namespace std;
unsigned long long k,a,b;
int ans;
int main(){
	cin>>k>>a>>b;
	if(b>=a){
		cout<<"1\n";
		return 0;
	}
	if(c>=b){
		cout<<"-1\n";
		return 0;
	}
	if((a-b)%(b-c)>=1) ans=1;
	cout<<((a-b)/(b-c)+ans)*2+1<<endl;
 	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'c' was not declared in this scope
   17 |         if(c>=b){
      |            ^
a.cc:21:21: error: 'c' was not declared in this scope
   21 |         if((a-b)%(b-c)>=1) ans=1;
      |                     ^
a.cc:22:25: error: 'c' was not declared in this scope
   22 |         cout<<((a-b)/(b-c)+ans)*2+1<<endl;
      |                         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: expected ';' before '}' token
   22 |     return 0
      |             ^
      |             ;
   23 | }
      | ~
Language: C

#include<bits/stdc++.h>
using namespace std;
long long a,b,c,s;
int main()
{
    cin>>a>>b>>c;
    if(b>=a)puts("1");
    else if(c>=b)puts("-1");
    else if((a-b)%(b-c)>=1)
	{
	    s=1;
        cout<<((a-b)/(b-c)+s)*2+1<<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 main()
{
    long long a,b,c,s;
    cin>>a>>b>>c;
    if(b>=a)
        puts("1"),exit(0);
    if(c>=b)
        puts("-1"),exit(0);
    if((a-b)%(b-c)>=1)s=1;
    cout<<((a-b)/(b-c)+s)*2+1<<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;
long long a,b,c,s;
int main()
{
    cin>>a>>b>>c;
    if(b>=a)
        puts("1"),exit(0);
    if(c>=b)
        puts("-1"),exit(0);
    if((a-b)%(b-c)>=1)s=1;
    cout<<((a-b)/(b-c)+s)*2+1<<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 main()
{
    long long a,b,c,s;
    cin>>a>>b>>c;
    if(b>=a)puts("1");
    if(c>=b)puts("-1");
    if((a-b)%(b-c)>=1)s=1;
    cout<<((a-b)/(b-c)+s)*2+1<<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;
long long a,b,c,n;
int main()
{
    cin>>a>>b>>c;
    if(b>=a)
    {
        cout<<1<<endl
        return 0;
    }
    if(c>=b)
    {
        cout<<-1<<endl;
        return 0;
        
    }
    if((a-b)%(b-c)>=1) 
        n=1;
    cout<<((a-b)/(b-c)+n)*2+1<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before 'return'
    9 |         cout<<1<<endl
      |                      ^
      |                      ;
   10 |         return 0;
      |         ~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace;
int main(){
long long a,b,c,d;
cin>>a>>b>>c;
for(long long  i=1;i<=1000000000000;i++){
d+=b+b-c;
if(d>a){
cout<<i;

return 0;
}
}

Compiler output:
a.cc:2:16: error: expected identifier before ';' token
    2 | using namespace;
      |                ^
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>a>>b>>c;
      | ^~~
      | 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:9:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 | cout<<i;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

#include<cstdio>
long long a,b,k;
main(){
    scanf("%lld%lld%lld",&k,&a,&b);
    if(k<=a)return puts("1"),0;
    else if(a<=b)return puts("-1"),0;
    else printf("%lld\n",((k-a)/(a-b)+bool((k-a)%(a-b)))<<1|1);
}

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

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

Compiler output:
a.cc:4:1: error: expected initializer before 'int'
    4 | int main()
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long k,n,m,ans,s,d;
int main()
{
	cin>>k>>n>>m;
	if(k<=n)
	{
		cout<<'1'<<endl;
		goto A:
	}
	if(n<=m)
	{
		cout<<"-1"<<endl;
		goto A:
	}
	s=n-m;
	d=k-n;
	if(d%s==0)
	{
		ans=d/s;
	}
	else
	{
		ans=d/s+1;
	}
	ans*=2;
	cout<<ans+1;
	A: return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected ';' before ':' token
   10 |                 goto A:
      |                       ^
      |                       ;
a.cc:10:23: error: expected primary-expression before ':' token
a.cc:15:23: error: expected ';' before ':' token
   15 |                 goto A:
      |                       ^
      |                       ;
a.cc:15:23: error: expected primary-expression before ':' token
Language: C++

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

Compiler output:
a.cc:4:1: error: expected initializer before 'int'
    4 | int main()
      | ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 't' was not declared in this scope; did you mean 'tm'?
   14 |     t=int(bool((k-a)%(a-b)));
      |     ^
      |     tm
Language: C++

#include <bits/stdc++.h>
int main(){
	long long a,b,k;
    cin>>k>>a>>b;
    if(k<=a){
    	return puts("1"),0;
	}
    else if(a<=b){
    	return puts("-1"),0;
	}
    else{
    	 printf("%lld\n",((k-a)/(a-b)+bool((k-a)%(a-b)))<<1|1);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin>>k>>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
      |                  ^~~
Language: C++

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main()
{
ll K, A, B;
	cin >> K >> A >> B;
	if (A=<B) {
		ce(-1)
	}
	else {
		ll left = 0, right = K/(A-B)+1;
		ll mid;
		while(right-left>1){
			mid = (left + right)/2;
			if (A*mid-B*(mid-1)>=K) {
				right = mid;
			}
			else {
				left = mid;
			}
		}
		ce(right+right-1)
	}

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:42:15: error: expected primary-expression before '<' token
   42 |         if (A=<B) {
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	long long x , y , z ;
	cin >> x >> y >> z ;
	int u = 0 ;
	if(x < y){
		cout << "-1" ;
		return 0;
	}
	for(long long a = 1 ; a < 999999999999999){
		u += y ;
		if(u >= x){
			cout << a*2-1 ;
			return 0;
		}
		u -= z ;
	}
	cout << "-1" ;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:50: error: expected ';' before ')' token
   11 |         for(long long a = 1 ; a < 999999999999999){
      |                                                  ^
      |                                                  ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: 'c' was not declared in this scope
   14 |         if((a-b)%(b-c)>=1)cout<<((a-b)/(b-c)+1)*2+1<<endl;
      |                     ^
Language: C++

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

int main()
{
    long long a,b,k;
    cin>>k>>a>>b;
    if(k<=a)
    {
        printf("1");
        return 0; 
    }
    else if(a<=b)
    {
        printf("-1");
        return 0;  
    }
    else 
    {
        printf("%lld\n",((k-a)/(a-b)+bool((k-a)%(a-b)))<<1|1);
    }
}

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

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

int main()
{
	long long k,a,b,c=0;
    cin>>k>>a>>b;
    if(a>=k)
    {
        cout<<1<<endl;
        return 0;
    }else if(b>=a){
    	cout<<-1<<endl;
        return 0;
	}else if((k-a)%(c-b)>=1){
    	c=1;
	}
    cout<<((k-a)/(a-b)+)*2+1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:24: error: expected primary-expression before ')' token
   18 |     cout<<((k-a)/(a-b)+)*2+1<<endl;
      |                        ^
Language: Java

k,a,b=map(int,input().split());print(1+2*((k-a-1)//(a-b)+1)if a-b>0 else(1 if k>=a else 0))

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
k,a,b=map(int,input().split());print(1+2*((k-a-1)//(a-b)+1)if a-b>0 else(1 if k>=a else 0))
^
Main.java:1: error: class, interface, enum, or record expected
k,a,b=map(int,input().split());print(1+2*((k-a-1)//(a-b)+1)if a-b>0 else(1 if k>=a else 0))
                               ^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,a,b,k;
    cin>>k>>a>>b;
    if(a<b and a<k)
    {
        cout<<"-1"<<endl;
        return 0;
    }
    int h;
    h=0;
    for(i=1;i==i;i++)
    {
        if(n%2==1)h+=a;
        if(n%2==0)h-=b;
        if(h>=k)break;
    }
    cout<<i<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 'n' was not declared in this scope
   16 |         if(n%2==1)h+=a;
      |            ^
a.cc:17:12: error: 'n' was not declared in this scope
   17 |         if(n%2==0)h-=b;
      |            ^
Language: C++

#include<bits/atdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll k,a,b;cin>>k>>a>>b;
  if(a<=b){
    cout<<-1<<endl;
    return 0;
  }
  if(k<a){
    cout<<1<<endl;
    return 0;
  }
  ll ans=(k-a)/(a-b);
  ll now=ans*(b-a);
  ans*=2;
  for(;;){
    if(now+a>=k){
      cout<<ans+1<<endl;
      return 0;
    }
    ans+=2;
    now+=a-b;
  }
}

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

k,a,b=map(int,input().split())
if k<=a:
    print(1)
elif a-b <= 0:
    print(-1)
else:
    print(1+(k-a+(a-b)-1)//(a-b)*2)

Compiler output:
a.cc:1:1: error: 'k' does not name a type
    1 | k,a,b=map(int,input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,c,ans=0;
	cin>>a>>b>>c;
	if(a>b&&b<c) cout<<-1<<endl;
	else if(a<=b) cout<<1<<endl; 
	else cout<<(((k-a)/(a-b)+bool((k-a)%(a-b)))<<1|1)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'k' was not declared in this scope
    9 |         else cout<<(((k-a)/(a-b)+bool((k-a)%(a-b)))<<1|1)<<endl;
      |                       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: 'kk' was not declared in this scope
   17 |     if((a-b)%(b-c)>=1)kk=1;
      |                       ^~
a.cc:18:24: error: 'kk' was not declared in this scope
   18 |     cout<<((a-b)/(b-c)+kk)*2+1<<endl;
      |                        ^~
Language: C++

#include <iostream>
using namespace std;
int main(){
    long long a,b,c,delta;
    cin>>a>>b>>c;
    if(b>=a){
        cout<<1<<endl;
        goto endapp;
    }
    if(c>=b){
        cout<<-1<<endl;
        goto endapp
    }
    if ((a-b)%(b-c)>=1)
        delta=1;
    cout<<((a-b)/(b-c)+delta)*2+1<<endl;
endapp:
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before '}' token
   12 |         goto endapp
      |                    ^
      |                    ;
   13 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int a,b,c,ta;
  float ans;
  cin>>a>>b>>c;
  
  if(a<=b) ta=-1;
  else ans=c/(a-b);
  
  if(ans%1.000!=0) ta=c/(a-b)+1;
  else ta=c/(a-b);
  
  cout<<ta<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: invalid operands of types 'float' and 'double' to binary 'operator%'
   11 |   if(ans%1.000!=0) ta=c/(a-b)+1;
      |      ~~~^~~~~~
      |      |   |
      |      |   double
      |      float
Language: C++

#include <iostream>
using namespace std;
int main(){
  int a,b,c,ta;
  float ans;
  cin>>a>>b>>c;
  
  if(a<=b) ta=-1;
  else ans=c/(a-b);
  
  if(ans%1.00!=0) ta=c/(a-b)+1;
  else ta=c/(a-b);
  
  cout<<ta<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: invalid operands of types 'float' and 'double' to binary 'operator%'
   11 |   if(ans%1.00!=0) ta=c/(a-b)+1;
      |      ~~~^~~~~
      |      |   |
      |      |   double
      |      float
Language: C++

#include <iostream>
using namespace std;
int main(){
  int a,b,c,ta;
  float ans;
  cin>>a>>b>>c;
  
  if(a<=b) ans=-1;
  else ans=k/(a-b);
  
  if(ans%1!=0) ta=k/(a-b)+1;
  else ta=k/(a-b);
  
  cout<<ta<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'k' was not declared in this scope
    9 |   else ans=k/(a-b);
      |            ^
a.cc:11:9: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   11 |   if(ans%1!=0) ta=k/(a-b)+1;
      |      ~~~^~
      |      |   |
      |      |   int
      |      float
a.cc:11:19: error: 'k' was not declared in this scope
   11 |   if(ans%1!=0) ta=k/(a-b)+1;
      |                   ^
a.cc:12:11: error: 'k' was not declared in this scope
   12 |   else ta=k/(a-b);
      |           ^
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
    long A =scan.nextLong();
    long B = scan.nextLong();
    long K = scan.nextLOng();
    if(A>=K){
      System.out.println(1);
      return;
    }
    if(A-B <= 0){
      System.out.println(-1);
      return;
    }
    long sub = A-B;
	long ans = 1 + ((K-A)/sub)*2;
    System.out.println(ans);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    long K = scan.nextLOng();
                 ^
  symbol:   method nextLOng()
  location: variable scan of type Scanner
1 error
Language: C++

#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main()
{
    scanf("%d",K);
     scanf("%d",A);
      scanf("%d",B);
    int N=0;
    if(A<K & A<B){
        printf(-1);
    }
    else if(A<B & A>K){
        printf(1);
    }
    else{
        N=(K-A)/(A-B)+1;
    printf(2*N+1);
    }
        }


Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'K' was not declared in this scope
    6 |     scanf("%d",K);
      |                ^
a.cc:7:17: error: 'A' was not declared in this scope
    7 |      scanf("%d",A);
      |                 ^
a.cc:8:18: error: 'B' was not declared in this scope
    8 |       scanf("%d",B);
      |                  ^
a.cc:11:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   11 |         printf(-1);
      |                ^~
      |                |
      |                int
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:14:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   14 |         printf(1);
      |                ^
      |                |
      |                int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:18:15: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   18 |     printf(2*N+1);
      |            ~~~^~
      |               |
      |               int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main()
{
    cin>>K>>A>>B;
    int N=0;
    if(A<K & A<B){
        printf(-1);
    }
    else if(A<B & A>K){
        printf(1);
    }
    else{
        N=(K-A)/(A-B)+1;
    printf(2*N+1);
    }
        }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'K' was not declared in this scope
    7 |     cin>>K>>A>>B;
      |          ^
a.cc:7:13: error: 'A' was not declared in this scope
    7 |     cin>>K>>A>>B;
      |             ^
a.cc:7:16: error: 'B' was not declared in this scope
    7 |     cin>>K>>A>>B;
      |                ^
a.cc:10:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   10 |         printf(-1);
      |                ^~
      |                |
      |                int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 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/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:13:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   13 |         printf(1);
      |                ^
      |                |
      |                int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:17:15: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   17 |     printf(2*N+1);
      |            ~~~^~
      |               |
      |               int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

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

int main(void){
    ll k,a,b;
    cin>>k>>a>>b;
    if(a>=k) res = 1;
    else if(a<=b) res = -1;
    else{
        ll x = (k-a)/(a-b);
        res = x*2;
        if(x*(a-b)>=k);
        else if(x*(a-b)+a>=k) res += 1;
        else res += 3;
    }
    cout<<res<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'res' was not declared in this scope
    8 |     if(a>=k) res = 1;
      |              ^~~
a.cc:9:19: error: 'res' was not declared in this scope
    9 |     else if(a<=b) res = -1;
      |                   ^~~
a.cc:12:9: error: 'res' was not declared in this scope
   12 |         res = x*2;
      |         ^~~
a.cc:17:11: error: 'res' was not declared in this scope
   17 |     cout<<res<<endl;
      |           ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include "math.h"
int main()
{
int K,A,B;
int i=0,sum=0;
if((K>=1&&k<=pow(10,18))&&(A>=1&&A<=pow(10,18))&&(B>=1&&B<=pow(10,18))
printf("%d",)
else scanf("%d%d%d",&K,&A,&B);
if(K>10000000000) printf("输入不合法\n");
else if(A-B<=0)  printf("%d",-1);
else {
    while(sum<K)
    {   sum=sum+A;
    i++;
        if(sum>=K)
    { break;
    }
            sum=sum-B;
            i++;
    }
printf("%d",i);
}

}


Compiler output:
main.c: In function 'main':
main.c:8:11: error: 'k' undeclared (first use in this function)
    8 | if((K>=1&&k<=pow(10,18))&&(A>=1&&A<=pow(10,18))&&(B>=1&&B<=pow(10,18))
      |           ^
main.c:8:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:71: error: expected ')' before 'printf'
    8 | if((K>=1&&k<=pow(10,18))&&(A>=1&&A<=pow(10,18))&&(B>=1&&B<=pow(10,18))
      |   ~                                                                   ^
      |                                                                       )
    9 | printf("%d",)
      | ~~~~~~                                                                 
main.c:26:1: error: expected expression before '}' token
   26 | }
      | ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
int main(){
	ll n,a,b;
	scanf("%lld%lld%lld",&n,&b,&a);
	if(a>=b){
		printf("-1");
		return 0;
	}
	n-=b;
	if(n<=0){
		printf("1");
		return 0;
	}
	ll bb=(b-a);ll nn=ceil(n/bb);
	printf("%lld",nn*2+1)
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:30: error: expected ';' before 'return'
   21 |         printf("%lld",nn*2+1)
      |                              ^
      |                              ;
   22 |         return 0;
      |         ~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
int main(){
	ll n,a,b;
	scanf("%lld%lld%lld",&n,&b,&a);
	if(a>=b){
		printf("-1");
		return 0;
	}
	n-=b;
	if(n<=0){
		printf("1");
		return 0;
	}
	ll bb=(b-a);long double nn=n/bb;
	printf("%lld",ceil(nn)*2+1)
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:36: error: expected ';' before 'return'
   21 |         printf("%lld",ceil(nn)*2+1)
      |                                    ^
      |                                    ;
   22 |         return 0;
      |         ~~~~~~
Language: C

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

int main()
{
    long a, b, c, d, e;
    scanf("%ld%ld%ld",&a,&b,&c);
    if(c>b)
    {
        d = -1;
    }
    else
    {
        e = b
       for(d = 2;e<a;d++)
       {
           if(d%2==0)
           e -= c;
           else
           e += b;
       }
    }
    printf("%ld",d);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:14: error: expected ';' before 'for'
   15 |         e = b
      |              ^
      |              ;
   16 |        for(d = 2;e<a;d++)
      |        ~~~
Language: C++

//Author: Lixiang
#include<stdio.h>
#include<iostream>
using namespace std;
struct A{
	long long K,A,B;
	void init(){
		cin>>K>>A>>B;
	}
	void work(){
		K-=A;
		if(K<=0)cout<<1<<endl;
		else
			if(A<=B)puts("-1");
			else{
				long long t=A-B;
				else
					if(K%t==0)cout<<(K/t-1ll)*2ll+3ll<<endl;
					else cout<<(K/t)*2ll+3ll<<endl;
			}
	}
}sol;
int main(){
	//freopen("","r",stdin);
	//freopen("","w",stdout);
	sol.init();
	sol.work();
	return 0;
}


Compiler output:
a.cc: In member function 'void A::work()':
a.cc:17:33: error: 'else' without a previous 'if'
   17 |                                 else
      |                                 ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<functional>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(int (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(int (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int i = 0;i < (n);i++)cerr << v[i] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

int main()
{
	ll k,a[2];cin >> k >> a[0] >> a[1];
	
	if(a[0] <= a[1])
	{
		if(a[0] < k)
		{
			cout << -1 << endl;
			return 0;
		}
		else
		{
			cout << 1 << endl;
			return 0;
		}
	}
	
	
	ll ans = 0ll;
	
	if(k > (a-b) * 5)
	{
		ans += 2ll * (k / (a[0] - a[1])) - 4ll;
		k -= (a[0] - a[1]) * (ans / 2);
	}
	
	a[1] = -a[1];
	
	for(int i = 0;;i++)
	{
		k -= a[i%2];
		ans++;
		if(k <= 0)
		{
			cout << ans << endl;
			return 0;
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:19: error: 'b' was not declared in this scope
   59 |         if(k > (a-b) * 5)
      |                   ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <array>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

int main() {
    int64_t k, a, b;
    cin >> k >> a >> b;

    k -= a;
    a -= b;
    if (a > 0) {
        cout << max((k + a - 1) / a * 2 + 1, 0LL) << endl;
    } else {
        cout << -1 << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: no matching function for call to 'max(int64_t, long long int)'
   18 |         cout << max((k + a - 1) / a * 2 + 1, 0LL) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 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/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:20: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   18 |         cout << max((k + a - 1) / a * 2 + 1, 0LL) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   18 |         cout << max((k + a - 1) / a * 2 + 1, 0LL) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using pll=pair<ll,ll>;
 
const ll MOD=1000000007;
 
ll abs1(ll a){
  if(a>=0)return a;
  else return -a;
}
 
ll pow1(ll a,ll b,ll p){
  ll ret=1;
  while(b!=0){
    if((b&1)==1){
      ret*=a;
    }
    a*=a;
    if(a>=p)a%=p;
    b=b>>1;
  }
  return ret;
}
 
int digit(ll a,ll b){
  int i=0;
  while(a!=0){
    a/=b;
    i++;
  }
  return i;
}
 
ll gcd1(ll a,ll b){
  if(a==0 && b==0)return 0;
  ll n;
  while(a%b!=0){
    n=a%b;
    a=b;
    b=n;
  }
  return b;
}
 
ll solveLinear(ll n,ll m,ll c){
  if(n==0 && m==0)return 0;
  ll a[100],b[100];
  a[0]=n;b[0]=m;
  int i=1;
  while(b[i-1]!=0){
    a[i]=b[i-1];
    b[i]=a[i-1]%b[i-1];
    i++;
  }
  n=i;
  if(c%a[n-1]!=0){
    return 0;
  }
  ll x=c/a[n-1],y=0;
  for(i=1;i<n;i++){
    ll cnt=x;
    x=y;
    y=cnt-(a[n-i-1]/b[n-i-1])*y;
  }
  return x;
}
 
ll modRev(ll a,ll p=MOD){
  a%=p;
  ll n=solveLinear(a,p,1);
  n%=p;
  if(n<0)return n+p;
  return n;
}
 
ll binom1(ll n,ll k,ll p=MOD){
  if(n<0 || k<0 || n<k)return 0;
  int i;
  ll ret=1,fact=1;
  for(i=0;i<k;i++){
    ret=ret*(n-i);
    fact*=i+1;
    if(ret>=p)ret%=p;
    if(fact>=p)fact%=p;
  }
  return (ret*modRev(fact))%p;
}
 
ll damage(string s){
  ll i,ret=0,cnt=0;
  for(i=0;i<s.size();i++){
    if(s[i]=='A'){
      cnt++;
      ret+=cnt;
    }else{
      cnt=0;
    }
  }
  return ret;
}
 
int f(int v,int w,int n){
  if(v>w)return f((v+n-2)/n,w);
  if(v<w)return f(v,(w+n-2)/n);
  return v;
}

int main(){
  int i,j,k,l,cnt=0;
  int n,q;
  cin>>n>>q;
  int v[q],w[q];
  for(i=0;i<q;i++)cin>>v[i]>>w[i];
  for(i=0;i<q;i++)cout<<f(v[i],w[i],n)<<endl;
}

Compiler output:
a.cc: In function 'int f(int, int, int)':
a.cc:105:18: error: too few arguments to function 'int f(int, int, int)'
  105 |   if(v>w)return f((v+n-2)/n,w);
      |                 ~^~~~~~~~~~~~~
a.cc:104:5: note: declared here
  104 | int f(int v,int w,int n){
      |     ^
a.cc:106:18: error: too few arguments to function 'int f(int, int, int)'
  106 |   if(v<w)return f(v,(w+n-2)/n);
      |                 ~^~~~~~~~~~~~~
a.cc:104:5: note: declared here
  104 | int f(int v,int w,int n){
      |     ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(long long x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl

#define all(x) x.begin(),x.end()
typedef pair<long long,long long> P;
typedef pair<long long,P> PP;

long long n,q;
long long v,u;
long long del;
int main()
{
	cin>>n>>q;
	del=n-2;
	rep(i,q)
	{
		cin>>v>>u;
if(n==1)
{
if(v>u)cout<<u<<endl;
else coutMMv<<endl;
continue;
}
		v+=del;
		u+=del;
		while(1)
		{
			if(u==v)
			{
				cout<<u-del<<endl;
				break;
			}
			if(u>v)
			{
				u/=n;u+=del;
			}
			else
			{
				v/=n;
				v+=del;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:6: error: 'coutMMv' was not declared in this scope
   35 | else coutMMv<<endl;
      |      ^~~~~~~
Language: C

#include <stdio.h>
int main() {
    int n, q; scanf("%d%d", &n, &q);
    while (q --) {
        int i, j; scanf("%d%d", &i, &j); -- i; -- j;
        while (i != j) {
            ((i > j ? i : j) -= 1) /= n;
        }
        printf("%d\n", i + 1);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:30: error: lvalue required as left operand of assignment
    7 |             ((i > j ? i : j) -= 1) /= n;
      |                              ^~