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

#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
 
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
        return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main() {
        ll a, b, n;
        cin >> a >> b >> n;

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

        return 0;
}


Compiler output:
a.cc:6:1: error: 'vector' does not name a type
    6 | vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
      | ^~~~~~
a.cc:9:13: error: 'size_t' was not declared in this scope
    9 | auto make_v(size_t a,Ts... ts){
      |             ^~~~~~
a.cc:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | #define bit(x) (1L << (x))
a.cc:9:24: error: expected primary-expression before '...' token
    9 | auto make_v(size_t a,Ts... ts){
      |                        ^~~
a.cc:9:30: error: expression list treated as compound expression in initializer [-fpermissive]
    9 | auto make_v(size_t a,Ts... ts){
      |                              ^
a.cc:9:31: error: expected ';' before '{' token
    9 | auto make_v(size_t a,Ts... ts){
      |                               ^
      |                               ;
a.cc: In function 'int main()':
a.cc:15:9: error: 'cin' was not declared in this scope
   15 |         cin >> a >> b >> n;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define bit(x) (1L << (x))
a.cc:18:17: error: 'cout' was not declared in this scope
   18 |                 cout << a * (b - 1) / b << endl;
      |                 ^~~~
a.cc:18:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:44: error: 'endl' was not declared in this scope
   18 |                 cout << a * (b - 1) / b << endl;
      |                                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define bit(x) (1L << (x))
a.cc:20:17: error: 'cout' was not declared in this scope
   20 |                 cout << a * (n - 1) / b << endl;
      |                 ^~~~
a.cc:20:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:44: error: 'endl' was not declared in this scope
   20 |                 cout << a * (n - 1) / b << endl;
      |                                            ^~~~
a.cc:20:44: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int64_t a,b,n;
  cin >> a >> b >> n;
  int64_t ans1=a*n/b-a*(n/b);
  int64_t ans2=0;
  int x=b-1;
  if(n>=b-1) ans2=a/(b-1);
  cout << max(ans1,ans2) << endl;
    
}
}

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

#include <iostream>
int main()
{
	int a,b,n,x,i,max=0,s=0;
	cin>>a>>b>>n;
	for(i=0;i<=n;i++)
    {
      x=i;
      s=floor(ax/b)−a×floor(x/b);
      if(s>max)
        max=s;
    }
	cout<<max;
	return 0;
}


Compiler output:
a.cc:9:20: error: extended character − is not valid in an identifier
    9 |       s=floor(ax/b)−a×floor(x/b);
      |                    ^
a.cc:9:20: error: extended character × is not valid in an identifier
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin>>a>>b>>n;
      |         ^~~
      |         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:9:15: error: 'ax' was not declared in this scope; did you mean 'max'?
    9 |       s=floor(ax/b)−a×floor(x/b);
      |               ^~
      |               max
a.cc:9:9: error: 'floor' was not declared in this scope
    9 |       s=floor(ax/b)−a×floor(x/b);
      |         ^~~~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout<<max;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cctype>
#include<vector>
#include<iomanip>
#include<cmath>
#include<algorithm>
#include<queue>
#include<set>
#include<unordered_map>
#include<stack>
#include<map>
#include<bitset>
#include <cstdlib>
#include<cstring>
#define ll long long;
#define pb push_back
const int MOD = 1e9 + 7;
const int qq = 1e5 + 10;
const int INF = 1e9 + 10;
using namespace std;
int main()
{
	ios::sync_with_stdio(0); cin.tie(0);


	int a, b, n;
	cin >> a >> b >> n;
	int ans = INT_MIN;
	for (int i = 0; i <= n; i++)
	{
		double temp = floor(double(a * i / double(b))) - floor(i / double(b)) * double(a);
		ans = max(int(temp), ans);
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: 'INT_MIN' was not declared in this scope
   30 |         int ans = INT_MIN;
      |                   ^~~~~~~
a.cc:17:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   16 | #include<cstring>
  +++ |+#include <climits>
   17 | #define ll long long;
Language: C++

#include<bits/stdc++.h>
using namespace std;
    
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
    
#define int long long
#define double long double
    
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
    
#define ff first
#define ss second
#define mp make_pair
         
#define pb push_back
#define endl "\n" 
         
#define f(i,l,r) for(int i=l;i<=r;i++)
#define rf(i,r,l) for(int i=r;i>=l;i--)    

#define bp __builtin_popcountll
#define inf 3e15
    
const int N=1e5+5;
const int M=1e9+7;
void solve()
{
	int a,b,n;
	cin>>a>>b>>n;
	int mi=min(b-1,n);
	if(mi==0)
	{
		ans=0;
		cout<<0;
		return;
	}
	int ans=(a*mi)/b;
	ans+=(a*(mi/b));
	cout<<ans;
	
}
signed main()  
{
	FAST
    int t=1;
    // cin>>t;
    for(int tc=1;tc<=t;tc++)
    {
    	// cout<<"Case #"<<tc<<": ";
    	solve();
    }
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:38:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |                 ans=0;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long lint;

lint a, b, n;

int main()
{
    cin >> a >> b >> n;
/*
    if(b == 1)
    {
        cout << "0\n";
        return 0;
    }*/

    lint mx = 0;
    if(n <= 100000000)
    {
        for(lint i = 1; i <= n; i ++)
        {
            lint x = floor(1.0D * a * i / b) - a * floor(1.0D * i / b);
            mx = max(mx, x);
        }
    }

    if(b != 1)
    {
        lint last = n / (b - 1) * (b - 1);
        if(last >= 0 && last <= n)
        {
            lint x = floor(1.0D * a * last / b) - a * floor(1.0D * last / b);
            mx = max(mx, x);
        }

        lint last = b - 1;
        if(last >= 0 && last <= n)
        {
            lint x = floor(1.0D * a * last / b) - a * floor(1.0D * last / b);
            mx = max(mx, x);
        }
    }

    cout << mx << "\n";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:14: error: redeclaration of 'lint last'
   38 |         lint last = b - 1;
      |              ^~~~
a.cc:31:14: note: 'lint last' previously declared here
   31 |         lint last = n / (b - 1) * (b - 1);
      |              ^~~~
Language: C++

#include<stdio.h>
#include<tgmath.h>
int main()
{
	int a,b,n,x,i,max=0,s=0;
	std::cin>>a;
  std::cin>>b;
std::cin>>n;
	for(i=0;i<=n;i++)
    {
      x=i;
      s=floor((a*x)/b)−(a*(floor(x/b)));
      if(s>max)
        max=s;
    }
	std::cout<<max;
	return 0;
}


Compiler output:
a.cc:12:23: error: extended character − is not valid in an identifier
   12 |       s=floor((a*x)/b)−(a*(floor(x/b)));
      |                       ^
a.cc: In function 'int main()':
a.cc:6:14: error: 'cin' is not a member of 'std'
    6 |         std::cin>>a;
      |              ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<tgmath.h>
  +++ |+#include <iostream>
    3 | int main()
a.cc:7:8: error: 'cin' is not a member of 'std'
    7 |   std::cin>>b;
      |        ^~~
a.cc:7:8: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:6: error: 'cin' is not a member of 'std'
    8 | std::cin>>n;
      |      ^~~
a.cc:8:6: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:23: error: expected ';' before '\U00002212'
   12 |       s=floor((a*x)/b)−(a*(floor(x/b)));
      |                       ^
      |                       ;
a.cc:16:14: error: 'cout' is not a member of 'std'
   16 |         std::cout<<max;
      |              ^~~~
a.cc:16:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 1LL << 60;


ll combination(ll n, ll r){
    if(n < r) return 0;
    if(r == 0||r == n) return 1;
    else if(r == 1) return n;
    return (combination(n - 1, r - 1) + combination(n - 1, r));
}

bool checkKaibun(string str){
    string checkStr = str;
    reverse(checkStr.begin(), checkStr.end());
    if(str == checkStr) return true;
    else return false;
}


int main(){
    ll A, B, N;
    cin >> A >> B >> N;
    if(N <= B){
        cout << floor(A * N / B) - A * floor(N / B) << endl;
    }else{
        cout << floor(A * (B - 1) / B) - A * floor((B - 1) / B) << endl;
    }
}

#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 1LL << 60;


ll combination(ll n, ll r){
    if(n < r) return 0;
    if(r == 0||r == n) return 1;
    else if(r == 1) return n;
    return (combination(n - 1, r - 1) + combination(n - 1, r));
}

bool checkKaibun(string str){
    string checkStr = str;
    reverse(checkStr.begin(), checkStr.end());
    if(str == checkStr) return true;
    else return false;
}


int main(){
    ll A, B, N;
    cin >> A >> B >> N;
    if(N <= B){
        cout << floor(A * N / B) - A * floor(N / B) << endl;
    }else{
        cout << floor(A * (B - 1) / B) - A * floor((B - 1) / B) << endl;
    }
}



Compiler output:
a.cc:41:10: error: redefinition of 'const long long int INF'
   41 | const ll INF = 1LL << 60;
      |          ^~~
a.cc:7:10: note: 'const long long int INF' previously defined here
    7 | const ll INF = 1LL << 60;
      |          ^~~
a.cc:44:4: error: redefinition of 'long long int combination(long long int, long long int)'
   44 | ll combination(ll n, ll r){
      |    ^~~~~~~~~~~
a.cc:10:4: note: 'long long int combination(long long int, long long int)' previously defined here
   10 | ll combination(ll n, ll r){
      |    ^~~~~~~~~~~
a.cc:51:6: error: redefinition of 'bool checkKaibun(std::string)'
   51 | bool checkKaibun(string str){
      |      ^~~~~~~~~~~
a.cc:17:6: note: 'bool checkKaibun(std::string)' previously defined here
   17 | bool checkKaibun(string str){
      |      ^~~~~~~~~~~
a.cc:59:5: error: redefinition of 'int main()'
   59 | int main(){
      |     ^~~~
a.cc:25:5: note: 'int main()' previously defined here
   25 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
int main()
{
	ll a,b,n;
	cin>>a>>b>>n;
	if(n)
	vector<ll> v;
	ll p=n;
	v.push_back(((a*p)/b)-(a*(p/b)));
	
	p=n-1;
	v.push_back(((a*p)/b)-(a*(p/b)));
	
	p=n/2;
	v.push_back(((a*p)/b)-(a*(p/b)));
	
	p=n/2+1;
	v.push_back(((a*p)/b)-(a*(p/b)));
	
	p=1;
	v.push_back(((a*p)/b)-(a*(p/b)));
	
	for(ll i=1;i<=1e7;i++){
		if(i<=n){
			p=i;
			v.push_back(((a*p)/b)-(a*(p/b)));
		}
	}
	
	sort(v.begin(),v.end());
	cout<<v[v.size()-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'v' was not declared in this scope
   12 |         v.push_back(((a*p)/b)-(a*(p/b)));
      |         ^
Language: C

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

typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    cout.tie(0);
    ll a,b,n;
    cin>>a>>b>>n;
    ll x=min(n,b-1);
    double ans=(1.0*(a/(1.0*b))*x);
    ll res=ans;
    ll t=(x/b);
    res-=(a*t);
    cout<<res<<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

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+5;
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll a,b,n;cin>>a>>b>>n;
    if(b-1<=n)return cout<< (a*(b-1))/b  - a*((b-1)/b) , 0;
    if(a%b)return cout<< (a*n)/b - a*(n/b) , 0;
    ll mx = 0;
    for(ll i=1;i<=a;i++){
        ll v1 = (a*i)/b;
        ll v2 = a*(i/b);
        mx=max(mx,v1-v2);
    }
    cout<<mx;
}
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+5;
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll a,b,n;cin>>a>>b>>n;
    if(b-1<=n)return cout<< (a*(b-1))/b  - a*((b-1)/b) , 0;
    if(a%b)return cout<< (a*n)/b - a*(n/b) , 0;
    ll mx = 0;
    for(ll i=1;i<=a;i++){
        ll v1 = (a*i)/b;
        ll v2 = a*(i/b);
        mx=max(mx,v1-v2);
    }
    cout<<mx;
}


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

#include<stdio.h>
#include<cmath>
int main()
{
	int a,b,n,x,i,max=0,s=0;
	cin>>a;
  cin>>b;
    cin>>n;
	for(i=0;i<=n;i++)
    {
      x=i;
      s=floor((a*x)/b)−(a*(floor(x/b)));
      if(s>max)
        max=s;
    }
	cout<<max;
	return 0;
}


Compiler output:
a.cc:12:23: error: extended character − is not valid in an identifier
   12 |       s=floor((a*x)/b)−(a*(floor(x/b)));
      |                       ^
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |         cin>>a;
      |         ^~~
      |         sin
a.cc:12:23: error: expected ';' before '\U00002212'
   12 |       s=floor((a*x)/b)−(a*(floor(x/b)));
      |                       ^
      |                       ;
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout<<max;
      |         ^~~~
Language: C++

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

int a,b,n;

signed main()
{
	int maxv=-1,pos;
		
	cin>>a>>b>>n;
	for (register int x=1;x<=min(n,50000000);x++)
	{
		int num=((a*x)/b)-a*(x/b);
		if (num>maxv)  maxv=num,pos=x;
	}
	cout<<maxv<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         for (register int x=1;x<=min(n,50000000);x++)
      |                           ^
a.cc:12:37: error: no matching function for call to 'min(long long int&, int)'
   12 |         for (register int x=1;x<=min(n,50000000);x++)
      |                                  ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:12:37: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   12 |         for (register int x=1;x<=min(n,50000000);x++)
      |                                  ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:12:37: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   12 |         for (register int x=1;x<=min(n,50000000);x++)
      |                                  ~~~^~~~~~~~~~~~
Language: C++

#include<stdio.h>
#include<cmath>
int main()
{
	int a,b,n,x,i,max=0,s=0;
	cin>>a;
  cin>>b;
    cin>>n;
	for(i=0;i<=n;i++)
    {
      x=i;
      s=floor((a*x)/b)−a*(floor(x/b));
      if(s>max)
        max=s;
    }
	cout<<max;
	return 0;
}


Compiler output:
a.cc:12:23: error: extended character − is not valid in an identifier
   12 |       s=floor((a*x)/b)−a*(floor(x/b));
      |                       ^
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |         cin>>a;
      |         ^~~
      |         sin
a.cc:12:23: error: expected ';' before '\U00002212a'
   12 |       s=floor((a*x)/b)−a*(floor(x/b));
      |                       ^~
      |                       ;
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout<<max;
      |         ^~~~
Language: C++

#include<iostream>
#include<cmath>
int main()
{
	int a,b,n,x,i,max=0,s=0;
	cin>>a>>b>>n;
	for(i=0;i<=n;i++)
    {
      x=i;
      s=floor((a*x)/b)−a*floor(x/b);
      if(s>max)
        max=s;
    }
	cout<<max;
	return 0;
}


Compiler output:
a.cc:10:23: error: extended character − is not valid in an identifier
   10 |       s=floor((a*x)/b)−a*floor(x/b);
      |                       ^
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>a>>b>>n;
      |         ^~~
      |         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:10:23: error: expected ';' before '\U00002212a'
   10 |       s=floor((a*x)/b)−a*floor(x/b);
      |                       ^~
      |                       ;
a.cc:14:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |         cout<<max;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int a,b,n;

signed main()
{
	int maxv=-1,pos;
		
	cin>>a>>b>>n;
	for (register int x=1;x<=min(n,5e7);x++)
	{
		int num=((a*x)/b)-a*(x/b);
		if (num>maxv)  maxv=num,pos=x;
	}
	cout<<maxv<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         for (register int x=1;x<=min(n,5e7);x++)
      |                           ^
a.cc:12:37: error: no matching function for call to 'min(long long int&, double)'
   12 |         for (register int x=1;x<=min(n,5e7);x++)
      |                                  ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:12:37: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'double')
   12 |         for (register int x=1;x<=min(n,5e7);x++)
      |                                  ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:12:37: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   12 |         for (register int x=1;x<=min(n,5e7);x++)
      |                                  ~~~^~~~~~~
Language: C

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <time.h>
#include <random>
#include <string>
#include <cassert>
#include <vector>
#include <ostream>
#include <istream>
#include <stack>
#include <deque>
#include <queue>
#include <functional>
#include <chrono>

using namespace std;

#define int long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define pii pair<int, int>
#define ld long double

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << " ";
    return a;
}

#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << (x) << "\n";
    const int INF = 1e18;
    // const int mod = 2600000069;
    // const int p = 10;
    // const ld PI = 3.1415926535;
#else
    #define dbg(x)
    const int INF = 1e18;
    // const int mod = 2600000069;
    // const int p = 179;
    // const ld PI = 3.1415926535;
#endif

// #pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,sse3,sse4")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("fast-math")
// #pragma GCC target("avx2")
//#pragma GCC optimize("section-anchors")
//#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
//#pragma GCC optimize("vpt")
//#pragma GCC optimize("rename-registers")
//#pragma GCC optimize("move-loop-invariants")
//#pragma GCC optimize("unswitch-loops")
//#pragma GCC optimize("function-sections")
//#pragma GCC optimize("data-sections")`  

int a, b, n;

int f(int x) {
    return a * x / b - a * (x / b);
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> a >> b >> n;
    cout << f(min(b - 1, n));
}
/*

*/  


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


#include<stdlib. h>
int main()
{
	int a,b,n,x,i,max=0,s=0;
	cin>>a>>b>>n;
	for(i=0;i<=n;i++)
    {
      x=i;
      s=floor((a*x)/b)−a*floor(x/b);
      if(s>max)
        max=s;
    }
	cout<<max;
	return 0;
}


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

#include <bits/stdc++.h>

using namespace std;

#define int long long

void solve()
{
	int a, b, n;
	cin >> a >> b >> n;
	
	if(n <= b - 1)
	{
		cout << (a * n) / b - a * (n / b) << '\n';
		return ;
	}
	
	int p = (b - 1);
	int k = n / p;
	p = k * p;
	
	cout << (a * p) / b - a * (p / b) << '\n';
}

main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int t = 1;

//	cin >> t;

	for(; t; --t)
	{
		solve();
	}
}

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


       {
         calc = (base*power(base, exp-1))%mod;
       }
       return calc%mod;
    }
}
    int32_t main()
    {
        std::ios::sync_with_stdio(false);
        int n,m,k;
        cin>>n>>m>>k;
        if(m>k)
            cout<<k<<endl;
        else
        cout<<m-1<<endl;
        return 0;
    }


Compiler output:
a.cc:2:8: error: expected unqualified-id before '{' token
    2 |        {
      |        ^
a.cc:5:8: error: expected unqualified-id before 'return'
    5 |        return calc%mod;
      |        ^~~~~~
a.cc:6:5: error: expected declaration before '}' token
    6 |     }
      |     ^
a.cc:7:1: error: expected declaration before '}' token
    7 | }
      | ^
a.cc:8:5: error: 'int32_t' does not name a type
    8 |     int32_t main()
      |     ^~~~~~~
a.cc:1:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 |
Language: C++

#include<stdio.h>
int main()
{
	int a,b,n,x,i,max=0,s=0;
	cin>>a>>b>>n;
	for(i=0;i<=n;i++)
    {
      x=i;
      s=floor((a*x)/b)−a*floor(x/b);
      if(s>max)
        max=s;
    }
	cout<<max;
	return 0;
}


Compiler output:
a.cc:9:23: error: extended character − is not valid in an identifier
    9 |       s=floor((a*x)/b)−a*floor(x/b);
      |                       ^
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin>>a>>b>>n;
      |         ^~~
a.cc:9:9: error: 'floor' was not declared in this scope
    9 |       s=floor((a*x)/b)−a*floor(x/b);
      |         ^~~~~
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout<<max;
      |         ^~~~
Language: C++

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

#define mp make_pair
#define pb push_back

#define int int64_t
#define ld long double

const int MOD = 1e9+7;
const int N = 1e6+5;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int a,b,n;
    cin>>a>>b>>n;
    int ans = 0;
    for(int i=max(0LL,n-1000000);i<=n;i++) {
        ans = max(ans, (a*i)/b - a*((int)(i/b)));
    }
    cout<<ans;

    return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:21:18: error: no matching function for call to 'max(long long int, int64_t)'
   21 |     for(int i=max(0LL,n-1000000);i<=n;i++) {
      |               ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:21:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int64_t' {aka 'long int'})
   21 |     for(int i=max(0LL,n-1000000);i<=n;i++) {
      |               ~~~^~~~~~~~~~~~~~~
/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:
/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:21:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |     for(int i=max(0LL,n-1000000);i<=n;i++) {
      |               ~~~^~~~~~~~~~~~~~~
Language: C++

#include "bits/stdc++.h"
#define int long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(obj) begin(obj), end(obj)
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))
#define Endl endl

using namespace std;
using ll      = long long;
const int MOD = (int)(1e9 + 7);
const int INF = (int)(1e13 + 7);

int ceil_(int a, int b) { return (a + (b - 1)) / b; }
int positive_surplus(int &a) { return (a + MOD) % MOD; }
int bpm(int x, unsigned int y) {
  if (x == 0) return 0;
  if (y == 0) return 1;
  int ans   = 1;
  int digit = (int)((log((double)y) / log((double)2) / 1 + 1));
  x %= MOD;
  for (unsigned int i = 0; i < digit; i++) {
    if (((y >> i) & 1u) == 1) ans = ans * x % MOD;
    x = x * x % MOD;
  }
  return ans;
}
template <class T>
void cumulative_sum(T &container) {
  for (int i = 0; i < container.size() - 1; i++) container[i + 1] += container[i];
}

class DFloorFunction {
public:
  static void solve(std::istream &cin, std::ostream &cout) {
    int A, B, N;
    cin >> A >> B >> N;
    int ans = -INF;
    for (int i = N; i >= N - A + 1; i--) {
      if (i >= 0){
        ans = max(ans, A * i / B - A * (i / B));
      }
    }
    cout << ans << endl;
  }
};


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java

import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;

import oauth.SampleJwt;

public class Main {

	public static void main(String[] args) {
		execute13_1();
	}
	
	private static void execute13_2() {
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			int m = sc.nextInt();
			int ans = 0;
		
		System.out.println(ans);
		}
		
	}
	
	
	private static void execute13_1() {
		try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			long b = sc.nextLong();
			long n = sc.nextLong();
			
			long x = Math.min(n, b-1);
			long ans = a*x/b-a*(n/b);
			
			
		System.out.println(ans);
		}
		
	}
}

Compiler output:
Main.java:12: error: package oauth does not exist
import oauth.SampleJwt;
            ^
1 error
Language: C++

#include<iostream>
int main()
{
	int a,b,n,x,i,max=0,s=0;
	cin>>a>>b>>n;
	for(i=0;i<=n;i++)
    {
      x=i;
      s=floor(ax/b)−a×floor(x/b);
      if(s>max)
        max=s;
    }
	cout<<max;
	return 0;
}

Compiler output:
a.cc:9:20: error: extended character − is not valid in an identifier
    9 |       s=floor(ax/b)−a×floor(x/b);
      |                    ^
a.cc:9:20: error: extended character × is not valid in an identifier
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin>>a>>b>>n;
      |         ^~~
      |         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:9:15: error: 'ax' was not declared in this scope; did you mean 'max'?
    9 |       s=floor(ax/b)−a×floor(x/b);
      |               ^~
      |               max
a.cc:9:9: error: 'floor' was not declared in this scope
    9 |       s=floor(ax/b)−a×floor(x/b);
      |         ^~~~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout<<max;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
 if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n,m;
  cin>>n>>m;
  vector<pll> ans(0);
  ll cu=1;
  ll nn=n;
  ll mm=m;
  if(n%2==1){
    nn--;
    while(mm){
      ans.pb(pll(cu,nn));
      nn--;cu++;mm--;
    }
    rep(i,sz(ans)){
      cout<<ans[i].F<<" "<<ans[i].S<<endl;
    }
  }
  else{
    nn=n/2;
    while(mm&&cu<nn){
      ans.b(pll(cu,nn));
      cu++;nn--;
      mm--;
    }
    if(mm){
      ll cu=n/2+1;
      nn=n-1;
      while(mm){
        ans.pb(pll(cu,nn));
        mm--;
      }
    }
    rep(i,sz(ans)){
      cout<<ans[i].F<<" "<<ans[i].S<<endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:11: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'b'
   66 |       ans.b(pll(cu,nn));
      |           ^
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
 if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n,m;
  cin>>n>>m;
  vector<pll> ans(0);
  ll cu=1;
  ll nn=n;
  ll mm=m;
  if(n%2==1){
    nn--;
    while(mm){
      ans.pb(pll(cu,nn));
      nn--;cu++;mm--;
    }
    rep(i,sz(ans)){
      cout<<ans.F<<" "<<ans.S<<endl;
    }
  }
  else{
    nn=n/2;
    while(mm&&cu<nn){
      ans.b(pll(cu,nn));
      cu++;nn--;
      mm--;
    }
    if(mm){
      ll cu=n/2+1;
      nn=n-1;
      while(mm){
        ans.pb(pll(cu,nn));
        mm--;
      }
    }
    rep(i,sz(ans)){
      cout<<ans.F<<" "<<ans.S<<endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'first'
   16 | #define F first
      |           ^~~~~
a.cc:60:17: note: in expansion of macro 'F'
   60 |       cout<<ans.F<<" "<<ans.S<<endl;
      |                 ^
a.cc:17:11: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'second'
   17 | #define S second
      |           ^~~~~~
a.cc:60:29: note: in expansion of macro 'S'
   60 |       cout<<ans.F<<" "<<ans.S<<endl;
      |                             ^
a.cc:66:11: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'b'
   66 |       ans.b(pll(cu,nn));
      |           ^
a.cc:16:11: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'first'
   16 | #define F first
      |           ^~~~~
a.cc:79:17: note: in expansion of macro 'F'
   79 |       cout<<ans.F<<" "<<ans.S<<endl;
      |                 ^
a.cc:17:11: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'second'
   17 | #define S second
      |           ^~~~~~
a.cc:79:29: note: in expansion of macro 'S'
   79 |       cout<<ans.F<<" "<<ans.S<<endl;
      |                             ^
Language: C++

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	vector<P> ans;
	if(n%2 == 0){
		bool ok = false;
		int l = 1, r = n-1;
		while(l < r){
			if(!ok && r-l <= n/2){
				--r;
				ok = true;
			}
			ans.emplace_back(l, r);
			++l;
			--r;
		}
	}
	else{
		int l = 1, r = n-1;
		while(l < r){
			ans.emplace_back(l, r);
			++l;
			--r;
		}
	}
	rep(i,m){
		cout << p.first << " " << p.second << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:25: error: 'p' was not declared in this scope
   37 |                 cout << p.first << " " << p.second << endl;
      |                         ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
const int mod = 1e9+7;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:39:16: error: expected ';' before '}' token
   39 |             l++
      |                ^
      |                ;
   40 |         }
      |         ~
Language: C++

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

int main(){
	int n,m;
	cin>>n>>m;
	if(n & 1); else n--;
	
	int l = 1, r = (n + 1) / 2 ;
	
	int tot = m;//一共有多少场 
	
	for(int i = 1; i <= m; i++) {
		if(i & 1){//前半场
			cout<<l<<" "<<l+tot<<endl;
			tot--;
			l++;
		}
		else {//后半场  
			cout<<r<<<" "<<r+tot<<endl;
			tot--;
			r++;
		}
	}
}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: error: expected primary-expression before '<' token
   20 |                         cout<<r<<<" "<<r+tot<<endl;
      |                                  ^
a.cc:20:38: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<'
   20 |                         cout<<r<<<" "<<r+tot<<endl;
      |                                   ~~~^~~~~~~
      |                                   |     |
      |                                   |     int
      |                                   const char [2]
a.cc: At global scope:
a.cc:27:9: error: expected unqualified-id before 'return'
   27 |         return 0;
      |         ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
import java.text.BreakIterator;
import java.util.Arrays;
import java.util.StringTokenizer;

public class MasonsMark {

	static int n, m;
	static char[][] a;
	static boolean[][] ok;
	static int[] dx = new int[] { -1, 0, 1, 0, -1, -1, 1, 1 };
	static int[] dy = new int[] { 0, 1, 0, -1, -1, 1, -1, 1 };
	static int A, B, C;

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		if (n % 2 == 1) {
			for (int i = 1; i <= m; i++) {
				pw.println(i + " " + (n - i + 1));
			}
		} else {
			int odd = (m + 1) / 2;
			for (int i = 1; i <= odd ; i++) {
				pw.println(i + " " + (n - i + 1));
			}
			for (int i = odd+1; i <= m; i++) {
				pw.println(i + " " + (n - i));
			}
		}

		pw.flush();
	}

}


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

#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree < pairs ,  null_type , greater<pairs>,  rb_tree_tag ,  tree_order_statistics_node_update > 
#define ll long long
#define lld long double
#define vc vector<ll>
const ll MOD=(1e9 +7);
typedef pair<ll,ll>pairs;
ll power(ll a, ll b){ll res=1;a=a%MOD;while(b>0){if(b&1){res=(res*a)%MOD;b--;}a=(a*a)%MOD;b>>=1;}
    return res;}

int main() {
	// your code goes here
	std::ios::sync_with_stdio(false);
	ll t,n,i,j,k,l,c,f;
	cin>>n>>m;
	for(i=1;i<=m;i++)
	{
	    cout<<i<<" "<<(n+1-i)<<"\n";
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'm' was not declared in this scope
   19 |         cin>>n>>m;
      |                 ^
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int maxn = 1e5 + 7;


int main() {
	cin >> n >> m;
	int l = 1, r = n - 1;
	for (int i = 0; i < m; i++) {
		cout << l << " " << r << endl;
		l++; r--;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   34 |         cin >> n >> m;
      |                ^
      |                yn
a.cc:34:21: error: 'm' was not declared in this scope; did you mean 'tm'?
   34 |         cin >> n >> m;
      |                     ^
      |                     tm
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define task "tst"
using namespace std;
const ll N = 5e3 + 9;
const ll inf = 1e9 + 7;
typedef pair<ll,ll> LL;

ll n,m,cur = 1,i;
set<ll> s;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    if (fopen(task".inp", "r")){
        freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    }
    cin>>n>>m;
    if (n%2 == 0&&m == n/2 - 1){
        for (i = 1;i <= m;i++){
            if (i != m) cout<<i<<" "<<n + 1 - i<<"\n";
            else cout<<i<<" "<<i + 2<<"\n";
        }
    }
    else (n%2 != 0) for (i = 1;i <= m;i++) cout<<i<<" "<<n + 1 - i<<"\n";

}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:20: error: expected ';' before 'for'
   28 |     else (n%2 != 0) for (i = 1;i <= m;i++) cout<<i<<" "<<n + 1 - i<<"\n";
      |                    ^~~~
      |                    ;
a.cc:28:42: error: expected ';' before ')' token
   28 |     else (n%2 != 0) for (i = 1;i <= m;i++) cout<<i<<" "<<n + 1 - i<<"\n";
      |                                          ^
      |                                          ;