criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*; 
import java.io.*;
 
public class Main {
	public static void solve(InputReader in) {
		long a = in.readLong();
	    long b = in.readLong();
		long n = in.readLong();
		long min = Math.min(b-1,n)); 
		System.out.println( (min*a)/b - (a * (min/b)) ); 
	}
    public static void main(String ...strings) {
    	InputReader in = new InputReader(System.in); 
    	int t = 1;
    	while(t-- > 0) {
    		solve(in); 
    	}
    }
}

class InputReader{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

    public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

    public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

    public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

    public long readLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9') {
				throw new InputMismatchException();
			}
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	
    public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

    public String next() {
		return readString();
	}

    public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}


Compiler output:
Main.java:9: error: ';' expected
		long min = Math.min(b-1,n)); 
		                          ^
1 error
Language: Java

import java.util.*; 
import java.io.*;
 
public class Main {
	public static void solve(InputReader in) {
		long a = in.readLong();
	    long b = in.readLong();
		long n = in.readLong();
		long min = Math.min(b-1,n)); 
		System.out.println( (min*a)/b - (a * min/b) ); 
	}
    public static void main(String ...strings) {
    	InputReader in = new InputReader(System.in); 
    	int t = 1;
    	while(t-- > 0) {
    		solve(in); 
    	}
    }
}

class InputReader{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

    public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

    public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

    public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

    public long readLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9') {
				throw new InputMismatchException();
			}
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	
    public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

    public String next() {
		return readString();
	}

    public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}


Compiler output:
Main.java:9: error: ';' expected
		long min = Math.min(b-1,n)); 
		                          ^
1 error
Language: C

#include<stdio.h>
#include<math.h>
int main()
{
  int a,b,n;
  scanf("%d %d %d",&a,&b,&n);
  int i,t,max=0;
  for(i=1;i<=n;i++)
  {
    if(b>n)
    {
    t=floor((a*i)/b)-(a*floor(i/b));
    if(max<t)
      max=t;
    }
    else
    {
      t=floor((a*(b-1))/b)-(a*floor((b-1)/b));
      if(max<t)
      max=t;
  }
  printf("%d",max);
}

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

#include<stdio.h>
#include<math.h>
int main()
{
  int a,b,n;
  scanf("%d %d %d",&a,&b,&n);
  int i,t,max=0;
  for(i=1;i<=n;i++)
  {
    t=floor((a*i)/b)-(a*floor(i/b));
    if(max<t)
      t=max;
  }
  printf("%d",max);

Compiler output:
main.c: In function 'main':
main.c:14:3: error: expected declaration or statement at end of input
   14 |   printf("%d",max);
      |   ^~~~~~
Language: C++

#include <iostream>
#include <numeric>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

template<class T> inline bool chmax(T &a, T b) {
    if (a < b) a = b; return true;
    return false;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll a, b, n;
    cin >> a >> b >> n;

    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        ll tmp = floor(a * i / b) - a * floor(i / b);
        chmax(ans, tmp);
    }

    cout << ans << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: 'floor' was not declared in this scope
   21 |         ll tmp = floor(a * i / b) - a * floor(i / b);
      |                  ^~~~~
Language: C++

/*
Author : Xinyuan
*/
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define INF 1000000007
#define mod 1005
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef long long int  ll;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int nxt() {int x;scanf("%d", &x);return x;}


int main(){
    double a,b,n;
    cin >> a >> b >> n;
    double x = 0;
    if(n > b) x = b-1;
    else x = n;
    cout << (a * x ) / b <, endl;
    return 0;
}

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

#include<iostream>
#include<math.h>

using namespace std;

int main(){
    int a,b,n;
    
    cin>>a>>b>>n;
    long long max;
    long long tmp1,tmp2,tmp3;
    /*
    if(b<=n){
        for(int i=0;i<=n;i++){
            tmp1=(int)(a*i/b);
            tmp2=(int)(i/b);
            tmp3=tmp1-tmp2;
            
            if(i==0){
                max=tmp3;
            }
            if(max<tmp3){
                max=tmp3;
            }
        }
    }else{
        for(int i=0;i<=b-1;i++){
            tmp1=(int)(a*i/b);
            tmp2=(int)(i/b);
            tmp3=tmp1-tmp2;
            
            if(i==0){
                max=tmp3;
            }
            if(max<tmp3){
                max=tmp3;
            }
        }
    }
    */
    if(b<=n){
        i=n;
    }else{
        i=b-1;
    }
    tmp1=(int)(a*i/b);
    tmp2=(int)(i/b);
    tmp3=tmp1-tmp2;
    cout<<tmp3<<"\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'i' was not declared in this scope
   42 |         i=n;
      |         ^
a.cc:44:9: error: 'i' was not declared in this scope
   44 |         i=b-1;
      |         ^
a.cc:46:18: error: 'i' was not declared in this scope
   46 |     tmp1=(int)(a*i/b);
      |                  ^
Language: C++

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

    class FT{
        private:
            ll n;
            vector<ll> v;
        public:
            FT(ll n){
                this->n = n;
                v.assign(n+1, 0);
            }

        inline ll operator[](ll i){
            ll ans = 0;
            for(; i > 0; i-=(i&(-i))) ans += v[i];
            return ans;
        }

        inline void add(ll i, ll x){
            for(; i <= n; i+=(i&(-i))) v[i] += x;
            }

        inline findKth(ll k, FT f){
            ll l=0;
            ll r=n;
            ll mid;
            while(l<r){
                mid=(l+r)/2;
                if(k<=f[mid])
                    r=mid;
                else
                    l=mid+1;
            }
            return l;
        }
    };

    main()
    {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        ll a,b,n;
        cin>>a>>b>>n;
        ll ans=(a)*min(b-1,n)/b;
        cout<<ans<<endl;
    }


Compiler output:
a.cc:27:16: error: ISO C++ forbids declaration of 'findKth' with no type [-fpermissive]
   27 |         inline findKth(ll k, FT f){
      |                ^~~~~~~
a.cc:42:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   42 |     main()
      |     ^~~~
Language: C++

#include <bits/stc++.h>
using namespace std;
#define ll long long
int main(){
  ll a,b,n;
  scanf("%lld%lld%lld",&a,&b,&n);
  ll x=min(b-1,n);
  printf("%lld\n",a*x/b);
  return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

int main(){
	long long int a, b, c;
  	cin >> a >> b >>c;
  long long int x = min(b-1, c);
  cout<<((a * x) / b) - a * (x / b)
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: expected ';' before 'return'
    9 |   cout<<((a * x) / b) - a * (x / b)
      |                                    ^
      |                                    ;
   10 |         return 0;
      |         ~~~~~~
Language: C++

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

int main() {
    long long a, b, n;
    cin >> a >> b >> n;
    long long ans = -1;
    if(n < B - 1) {
        ans = a*n/b;
    } else {
        ans = a*(b-1)/b;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'B' was not declared in this scope
    9 |     if(n < B - 1) {
      |            ^
Language: C++

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

int main() {
    long long a, b, n;
    cin >> a >> b >> n;
    long long ans = -1;
    if(n < B - 1) {
        ans = a*n/b;
    } else {
        ans = a*(B-1)/b;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'B' was not declared in this scope
    9 |     if(n < B - 1) {
      |            ^
Language: C++

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

int main() {
    long long a, b, n;
    cin >> a >> b >> n;
    long long ans = -1;
        ans =a*n/b - (n/b)*a
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: expected ';' before 'cout'
    9 |         ans =a*n/b - (n/b)*a
      |                             ^
      |                             ;
   10 |     cout << ans << endl;
      |     ~~~~
Language: C++

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

int main() {
    long long a, b, n;
    cin >> a >> b >> n;
    int ans = -1;
    rep(i,n+1) {
        ans = max(ans, a*(n - i)/b - ((n - i)/b)*a);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: no matching function for call to 'max(int&, long long int)'
   10 |         ans = max(ans, a*(n - i)/b - ((n - i)/b)*a);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:10:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   10 |         ans = max(ans, a*(n - i)/b - ((n - i)/b)*a);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:10:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   10 |         ans = max(ans, a*(n - i)/b - ((n - i)/b)*a);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  int64_t A,B,N;
  cin>>A>>B>>N;
  int64_t m=(N+1)/B;
  cout<<max((A-1)*m-(A/B),A*N/B);

Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected '}' at end of input
    8 |   cout<<max((A-1)*m-(A/B),A*N/B);
      |                                  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  int64_t A,B,N;
  cin>>A>>B>>N;
  int64_t m=(N+1)/B;
  cout<<max(A*N/,(A-1)*m-(A/B));
 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected primary-expression before ',' token
    8 |   cout<<max(A*N/,(A-1)*m-(A/B));
      |                 ^
a.cc:8:33: error: expected '}' at end of input
    8 |   cout<<max(A*N/,(A-1)*m-(A/B));
      |                                 ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

LL A, B, N, ans;

LL calc(LL A, LL B, LL x) {
    return floor(A*x/B) -A*floor(x/B);
}
int main() {
    cin >> A >> B >> N;
    if(B>=N) {
        cout << calc(A, B, N) << endl;
    }else {
        LL ans = calc(A, B, B-1);
        for(LL x=B; x<=N; x++) {
            LL t = calc(A, B, x);
            if(t>ans) {
                ans = t; 
            }
        }
        cout << ans << endl
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: expected ';' before '}' token
   22 |         cout << ans << endl
      |                            ^
      |                            ;
   23 |     }
      |     ~
Language: C++

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

LL A, B, N;

LL calc(LL A, LL B, LL x) {
    return floor(A*x/B) -A*floor(x/B);
}
int main() {
    cin >> A >> B >> N;
    if(B>=N) {
        cout << calc(A, B, N) << endl;
    }else {
        LL ans = calc(A, B, B);
        for(LL x=B+1; x<=N; x++) {
            LL t = calc(A, B, x);
            if(t>ans) {
                ans = t; 
            }
        }
        
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  ios_base::sync_with_stdio(false); 
  cin.tie(0);
  cout.tie(0);
  long long int a,b,n,product;
  cin>>a>>b>>n;
  if(b==1)
  {
      cout<<0;
  }
  else
  {
      cout<<(a*(b-1)/b;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: expected ')' before ';' token
   16 |       cout<<(a*(b-1)/b;
      |             ~         ^
      |                       )
Language: C++

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

int main()
{
    long long a,b,n;
    cin>>a>>b>>n;
    long long sum=0;

  
    if(n<b-1)
    {
       int x =n;
       int fl1 = (ax-ax%b)/b;
       cout<<fl1<<endl;
    }
     else
     {
        int x = b-1;
        int fl1 = (ax-ax%b)/b;
        cout<<fl1<<endl;
     }
  
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'ax' was not declared in this scope; did you mean 'x'?
   14 |        int fl1 = (ax-ax%b)/b;
      |                   ^~
      |                   x
a.cc:20:20: error: 'ax' was not declared in this scope; did you mean 'x'?
   20 |         int fl1 = (ax-ax%b)/b;
      |                    ^~
      |                    x
Language: C++

#include<bits/stdc++.h>
#define ll long long
const int N=100005;
using namespace std;
ll a,b,n; 
int main(){
	cin>>a>>b>>n;
	cout<<a*min(b-1,n)/d;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: 'd' was not declared in this scope
    8 |         cout<<a*min(b-1,n)/d;
      |                            ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
const int N=100005;
using namespace std;
ll a,b,c; 
int main(){
	cin>>a>>b>>c;
	cout<<a*min(b-1,n)/d;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: 'n' was not declared in this scope
    8 |         cout<<a*min(b-1,n)/d;
      |                         ^
a.cc:8:28: error: 'd' was not declared in this scope
    8 |         cout<<a*min(b-1,n)/d;
      |                            ^
Language: C++

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

int main(){
  long long a,b,n;
  cin >>a>>b>>n;
  if(b>n)cout <<(a*n)/b;
  else if(b<=n)<<(a*b)/b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected primary-expression before '<<' token
    8 |   else if(b<=n)<<(a*b)/b;
      |                ^~
Language: C++

int a, b, n;
	readi(&a); readi(&b); readi(&n);

	writeiln(f(a,b,_min(b-1,n)));

Compiler output:
a.cc:2:14: error: expected constructor, destructor, or type conversion before '(' token
    2 |         readi(&a); readi(&b); readi(&n);
      |              ^
a.cc:2:25: error: expected constructor, destructor, or type conversion before '(' token
    2 |         readi(&a); readi(&b); readi(&n);
      |                         ^
a.cc:2:36: error: expected constructor, destructor, or type conversion before '(' token
    2 |         readi(&a); readi(&b); readi(&n);
      |                                    ^
a.cc:4:17: error: expected constructor, destructor, or type conversion before '(' token
    4 |         writeiln(f(a,b,_min(b-1,n)));
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
#define RREP(i,a) for(int (i)=a-1; (i)>=(0); (i)--)
#define REP2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll A,B,N; cin >> A >> B >> N;
    ll tmp = (ll)(A*N/B) - A*(ll)(N/B);
    N--;
    ll ans = (ll)(A*N/B) - A*(ll)(N/B);
    cout max(tmp, ans);
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: expected ';' before 'max'
   22 |     cout max(tmp, ans);
      |         ^~~~
      |         ;
Language: Java

import java.util.Scanner;

public class Nain {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final double a = sc.nextDouble();
        final double b = sc.nextDouble();
        final double n = sc.nextDouble();

        System.out.println((long)Math.floor(a*Math.min(b-1, n)/b) - a * Math.floor(Math.min(b-1, n)/b));
    }
}

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

#include<iostream>
#include<cmath>
using namespace std;
#define ll long long
int main()
{
  double a,b,lim,max=floor(a*lim/b)-a*floor(lim/b);;
  cin>>a>>b>>lim;
  for(ll i=(ll)lim;i>=0lim;i--)
  {
    ll ans=floor(a*i/b)-a*floor(i/b);
    if(ans>max)
    {  	
      max=ans;
     break;
    }
  }
  
  cout<<max;
  return 0;
        
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: unable to find numeric literal operator 'operator""lim'
    9 |   for(ll i=(ll)lim;i>=0lim;i--)
      |                       ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

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

  ll max = b-1;
  if(n<max) max =n;

  ll r = (a*max)/b;
  cout<<r<<endl;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected '}' at end of input
   14 |   cout<<r<<endl;
      |                 ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

int main(void) {
    long long int a, b, n, max = 0;
    cin >> a >> b >> n;
    for (long long int x=1; x<min(101, n+1); x++) {
        long long int temp = (a*x)/b - a*(x/b);
        if (temp > max) {
            max = temp;
        }
    }
    cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:34: error: no matching function for call to 'min(int, long long int)'
    7 |     for (long long int x=1; x<min(101, n+1); 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:7:34: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
    7 |     for (long long int x=1; x<min(101, n+1); 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:7:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    7 |     for (long long int x=1; x<min(101, n+1); x++) {
      |                               ~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
using Int = int64_t;
Int f(a, b, x) {
  return 
}
int main() {
  Int A, B, N;
  cin >> A >> B >> N;
  auto f = [](Int a, Int b, Int x) {
    return a * x / b - x / b * a;
  };
  cout << f(A, B, min(N, B - 1)) << endl;
}


Compiler output:
a.cc:5:7: error: 'a' was not declared in this scope
    5 | Int f(a, b, x) {
      |       ^
a.cc:5:10: error: 'b' was not declared in this scope
    5 | Int f(a, b, x) {
      |          ^
a.cc:5:13: error: 'x' was not declared in this scope
    5 | Int f(a, b, x) {
      |             ^
a.cc:5:14: error: expression list treated as compound expression in initializer [-fpermissive]
    5 | Int f(a, b, x) {
      |              ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
using Int = int64_t;
Int f(a, b, x) {
  return 
}
int main() {
  Int A, B, N;
  cin >> A >> B >> N;
  auto f = [](Int a, Int b, Int x) {
    return A * x / B - x / B * A;
  };
  cout << f(A, B, min(N, B - 1)) << endl;
}

Compiler output:
a.cc:5:7: error: 'a' was not declared in this scope
    5 | Int f(a, b, x) {
      |       ^
a.cc:5:10: error: 'b' was not declared in this scope
    5 | Int f(a, b, x) {
      |          ^
a.cc:5:13: error: 'x' was not declared in this scope
    5 | Int f(a, b, x) {
      |             ^
a.cc:5:14: error: expression list treated as compound expression in initializer [-fpermissive]
    5 | Int f(a, b, x) {
      |              ^
a.cc: In lambda function:
a.cc:12:12: error: 'A' is not captured
   12 |     return A * x / B - x / B * A;
      |            ^
a.cc:11:13: note: the lambda has no capture-default
   11 |   auto f = [](Int a, Int b, Int x) {
      |             ^
a.cc:9:7: note: 'Int A' declared here
    9 |   Int A, B, N;
      |       ^
a.cc:12:20: error: 'B' is not captured
   12 |     return A * x / B - x / B * A;
      |                    ^
a.cc:11:13: note: the lambda has no capture-default
   11 |   auto f = [](Int a, Int b, Int x) {
      |             ^
a.cc:9:10: note: 'Int B' declared here
    9 |   Int A, B, N;
      |          ^
a.cc:12:28: error: 'B' is not captured
   12 |     return A * x / B - x / B * A;
      |                            ^
a.cc:11:13: note: the lambda has no capture-default
   11 |   auto f = [](Int a, Int b, Int x) {
      |             ^
a.cc:9:10: note: 'Int B' declared here
    9 |   Int A, B, N;
      |          ^
a.cc:12:32: error: 'A' is not captured
   12 |     return A * x / B - x / B * A;
      |                                ^
a.cc:11:13: note: the lambda has no capture-default
   11 |   auto f = [](Int a, Int b, Int x) {
      |             ^
a.cc:9:7: note: 'Int A' declared here
    9 |   Int A, B, N;
      |       ^
Language: C++

#include <stdio.h>
int main()
{
	long long a, b, n;
	scanf("%lld%lld%lld", &a, &b, &n);
	printf("%lld", long long((a * min(b - 1, n)) / b - a * (min(b - 1, n) / b)));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected primary-expression before 'long'
    6 |         printf("%lld", long long((a * min(b - 1, n)) / b - a * (min(b - 1, n) / b)));
      |                        ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'll' was not declared in this scope
    5 |         ll a,b,n;
      |         ^~
a.cc:6:14: error: 'a' was not declared in this scope
    6 |         cin>>a>>b>>n;
      |              ^
a.cc:6:17: error: 'b' was not declared in this scope
    6 |         cin>>a>>b>>n;
      |                 ^
a.cc:6:20: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         cin>>a>>b>>n;
      |                    ^
      |                    yn
a.cc:7:11: error: expected ';' before 'x'
    7 |         ll x = min(b-1,n);
      |           ^~
      |           ;
a.cc:8:17: error: 'x' was not declared in this scope
    8 |         cout<<a*x/b-a*(x/b)<<endl;
      |                 ^
Language: C++

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

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | {#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {#include <bits/stdc++.h>
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'ax' was not declared in this scope; did you mean 'x'?
    8 |         cout<<ax/b<<endl;
      |               ^~
      |               x
Language: C

#include <stdio.h>
int main()
{
	long long a, b, n;
	scanf("%lld%lld%lld", &a, &b, &n);
	printf("%lld", (a * min(b - 1, n)) / b - a * (min(b - 1, n) / b));
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:29: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    6 |         printf("%lld", (a * min(b - 1, n)) / b - a * (min(b - 1, n) / b));
      |                             ^~~
      |                             main
Language: Java

import java.util.*;
 
class Main {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
        double A = sc.nextDouble();        
	double B = sc.nextDouble();
        double N = sc.nextDouble();
 
        if(B<=N){
            if(N != 1) N = B - 1;
        }
        long ans1 = (int)((A*N)/B);
        long ans2 = (long)A * (int)(N/B);
        long ans3 = ans1 - ans2;
        System.out.println(ans3);
        
    }
}

Compiler output:
Main.java:2: error: illegal character: '\u00a0'
?
^
Main.java:3: error: class, interface, enum, or record expected
class Main {
      ^
Main.java:9: error: illegal character: '\u00a0'
?
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:19: error: class, interface, enum, or record expected
}
^
5 errors
Language: C

#include <stdio.h>

int main()
{
    long long int a,b,n;
    scanf("%lli %lli %lli",&a,&b,&n);
    int i;
    for(i=0; i<10; i++)
    {
        long long int c=(a*n)/b;
        long long int d=n/b;
        d=d*a;
        c=c-d;
        n--;
    }
    printf("%lli",c);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:16:19: error: 'c' undeclared (first use in this function)
   16 |     printf("%lli",c);
      |                   ^
main.c:16:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;

int main()
{
	int A=0,B=0,N=0;
	cin>>A>>B>>N;
	int x;
	if(N>B-1)
	x=B-1;
	else x=N;
	f=(A*x/B)-A*(x/B);
	cout<<f;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'f' was not declared in this scope
   12 |         f=(A*x/B)-A*(x/B);
      |         ^
Language: C++

 #include<iostream>
 #include<algorithm>
 #include<cmath>
 #include<iomanip>
 #include<string.h>
 #include<cmath>
 #include<map>
 #include<vector>
using namespace std;
typedef long long ll;
char s[4005];
int main()
{

ll a,b,n;
ll mid=0;
cin>>a>>b>>n;
if(n<b) x=n;
else x=b-1;
cout<<a*x/b;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'x' was not declared in this scope
   18 | if(n<b) x=n;
      |         ^
a.cc:19:6: error: 'x' was not declared in this scope
   19 | else x=b-1;
      |      ^
a.cc:20:9: error: 'x' was not declared in this scope
   20 | cout<<a*x/b;
      |         ^
Language: C++

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

using ll = long long;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    ll a,b,n;
    cin >> a >> b >> n;
    
    ll x = min(b-1,n);
    print(floor(a*x/b)-a*floor(x/b));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'print' was not declared in this scope; did you mean 'rint'?
   14 |     print(floor(a*x/b)-a*floor(x/b));
      |     ^~~~~
      |     rint
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long a, b, n;
    cin >> a >> b >> n;
    long x = ( n % b );
    long n = 0;

    for( long i = 1; i <= x; i++ )
        n = max( n, a * ( double )( i / b ));
    
    cout << n << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: redeclaration of 'long int n'
   10 |     long n = 0;
      |          ^
a.cc:7:16: note: 'long int n' previously declared here
    7 |     long a, b, n;
      |                ^
a.cc:13:16: error: no matching function for call to 'max(long int&, double)'
   13 |         n = max( n, a * ( double )( i / b ));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:13:16: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'double')
   13 |         n = max( n, a * ( double )( i / b ));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:13:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   13 |         n = max( n, a * ( double )( i / b ));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{

      long long int t,a,b,n;
    cin >>t;

    for (int i = 0; i < t; i++)
    {
        cin >> a >> b >> n;

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

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:43: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   18 |          {cout << (a*(n-1)/b -a*((n-1)/b) << endl;}
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:18:50: error: expected ')' before ';' token
   18 |          {cout << (a*(n-1)/b -a*((n-1)/b) << endl;}
      |                   ~                              ^
      |                                                  )
Language: C++

#include <iostream>

using namespace std;

int main()
{

    int t,a,b,n;
    cin >>t;

    for (int i = 0; i < t; i++)
    {
        cin >> a >> b >> n;

         if (b%n != 0)
            cout << (a*n)/b -a*(n/b) << endl;
         else
            cout << (a*(n-1)/b -a*((n-1)/b) << endl;

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:45: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   18 |             cout << (a*(n-1)/b -a*((n-1)/b) << endl;
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:18:52: error: expected ')' before ';' token
   18 |             cout << (a*(n-1)/b -a*((n-1)/b) << endl;
      |                     ~                              ^
      |                                                    )
Language: C++

#include <iostream>

using namespace std;

int main()
{

      long long int t,a,b,n;
    cin >>t;

    for (int i = 0; i < t; i++)
    {
        cin >> a >> b >> n;

         if (b%n != 0)
            cout << (a*n)/b -a*(n/b) << endl;
         else
            cout << (a*(n-1)/b -a*((n-1)/b) << endl;

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:45: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   18 |             cout << (a*(n-1)/b -a*((n-1)/b) << endl;
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:18:52: error: expected ')' before ';' token
   18 |             cout << (a*(n-1)/b -a*((n-1)/b) << endl;
      |                     ~                              ^
      |                                                    )
Language: C++

            #include <iostream>
			#include <algorithm>
            #define lld long long int
        	using namespace std;
             
            int main(){
            	lld a,b,n;
              cin >> a >>b >> n;
              temp1 = min(b-1,n);
              cout << (temp1*a)/b - temp1*(a/b);             
            }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'temp1' was not declared in this scope
    9 |               temp1 = min(b-1,n);
      |               ^~~~~
Language: C++

    #include <iostream>
    #define lld long long int
	using namespace std;
     
    int main(){
    	lld a,b,n;
      cin >> a >> b >> n;
      temp1 = ((b-1)*a)/b;
      temp2 = (a*n)/b - a*(n/b);
      
      if(temp1 < temp2)
        cout << temp1;
      else cout << temp2;
     
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'temp1' was not declared in this scope
    8 |       temp1 = ((b-1)*a)/b;
      |       ^~~~~
a.cc:9:7: error: 'temp2' was not declared in this scope
    9 |       temp2 = (a*n)/b - a*(n/b);
      |       ^~~~~
Language: C++

#include <iostream>
#define lld long long int

int main(){
	lld a,b,n;
  cin >> a >> b >> n;
  temp1 = ((b-1)*a)/b;
  temp2 = (a*n)/b - a*(n/b);
  
  if(temp1 < temp2)
    cout << temp1;
  else cout << temp2;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> 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:7:3: error: 'temp1' was not declared in this scope
    7 |   temp1 = ((b-1)*a)/b;
      |   ^~~~~
a.cc:8:3: error: 'temp2' was not declared in this scope
    8 |   temp2 = (a*n)/b - a*(n/b);
      |   ^~~~~
a.cc:11:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |     cout << temp1;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   else cout << temp2;
      |        ^~~~
      |        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<bits/stdc++.h>
#define ll long long
int main()
{
    ll a,b,n;
    cin>>a>>b>>n;
    int max1=INT_MIN;
    for(ll i=0;i<=n++)
    {
        ll t=((a*i)/b)-a*(i/b);
        max1=max(t,max1);
    }
    cout<<max1<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     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:22: error: expected ';' before ')' token
    9 |     for(ll i=0;i<=n++)
      |                      ^
      |                      ;
a.cc:12:14: error: 'max' was not declared in this scope; did you mean 'std::max'?
   12 |         max1=max(t,max1);
      |              ^~~
      |              std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:14:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |     cout<<max1<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |     cout<<max1<<endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF =1001001001;
using P = pair<int,int>;

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

int main(void) 
{
    ll a, b, n;
    cin >> a >> b >> n;
    ll ans =0;
    ll N = min(b-1,n);
    ans = f(a,b,N-i));
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: 'i' was not declared in this scope
   18 |     ans = f(a,b,N-i));
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF =1001001001;
using P = pair<int,int>;

ll f(ll a, ll b, ll x){
    return floor((a*x)/b) - a* floor(x/b));
}

int main(void) 
{
    ll a, b, n;
    cin >> a >> b >> n;
    ll ans =0;
    ll N = min(b-1.n);
    rep(i,N){
        ans = max(ans, f(a,b,N-i));
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'll f(ll, ll, ll)':
a.cc:9:42: error: expected ';' before ')' token
    9 |     return floor((a*x)/b) - a* floor(x/b));
      |                                          ^
      |                                          ;
a.cc:9:42: error: expected primary-expression before ')' token
a.cc: In function 'int main()':
a.cc:17:18: error: unable to find numeric literal operator 'operator""n'
   17 |     ll N = min(b-1.n);
      |                  ^~~
Language: C++

#include <iostream>

using namespace std;

int main()
{

      long int t,a,b,n;
    cin >>t;

    for (int i = 0; i < t; i++)
    {
        cin >> a >> b >> n;

         if (b%n != 0)
            cout << (a*n)/b -a*(n/b) << endl;
         else
            cout << (a*(n-1)/b -a*((n-1)/b) << endl;

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:45: error: invalid operands of types 'long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   18 |             cout << (a*(n-1)/b -a*((n-1)/b) << endl;
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:18:52: error: expected ')' before ';' token
   18 |             cout << (a*(n-1)/b -a*((n-1)/b) << endl;
      |                     ~                              ^
      |                                                    )
Language: C++

using namespace std;
int main()
{
    long long int a,b,n;
    cin>>a>>b>>n;
    long long int i=b-1;
    long long int x=0;
    if(a*i>b && i<=n)
        x=i;
    else
        x=n;
   long long int z=a*x;

    long long int k=z/b;
    long long int l=(x/b);
    long long int h=a*l;
    long long int diff=k-h;
    cout<<diff<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     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 | using namespace std;
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<diff<<endl;
      |     ^~~~
a.cc:18:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:17: error: 'endl' was not declared in this scope
   18 |     cout<<diff<<endl;
      |                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

    #include <iostream>
    #include <algorithm>
    #define lld long long int
     
    int main(){
      lld a,b,n;
      lld temp1;
      lld temp2;
        temp1 = ((b-1)*a)/b;
      	temp2 = (a*n)/b - a*(n/b);
      cout << min(temp1,temp2);
      
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |       cout << min(temp1,temp2);
      |       ^~~~
      |       std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:15: error: 'min' was not declared in this scope; did you mean 'std::min'?
   11 |       cout << min(temp1,temp2);
      |               ^~~
      |               std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~