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

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

int main() {
	long long A, B, N;
	cin >> A >> B >> N;
	int val = 0;
	for (long long x = N; x > (B / A); x--) {

		val = max(val, (A*x) / B - A * (x / B));
	}
	cout << val << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: no matching function for call to 'max(int&, long long int)'
   10 |                 val = max(val, (A*x) / B - A * (x / 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:10:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   10 |                 val = max(val, (A*x) / B - A * (x / 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:10:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   10 |                 val = max(val, (A*x) / B - A * (x / B));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){

            BigDecimal a = new BigDecimal(sc.next());
            BigDecimal b = new BigDecimal(sc.next());
            BigDecimal n = new BigDecimal(sc.next());
            BigDecimal one = new BigDecimal("1");  


            BigDecimal ans = new BigDecimal("0");

            if(n.compareTo(one) == 0){
                BigDecimal ans1 = a.multiply(one.divide(b));
                BigDecimal ans11 = ans1.setScale(0, BigDecimal.ROUND_DOWN);
                BigDecimal ans2 = one.divide(b);
                BigDecimal ans22 = ans2.setScale(0, BigDecimal.ROUND_DOWN);

                ans = ans11.subtract(a.multiply(ans22));
            }else if(b.compareTo(n) == 1){
                BigDecimal ans1 = a.multiply(n.divide(b));
                BigDecimal ans11 = ans1.setScale(0, BigDecimal.ROUND_DOWN);
                BigDecimal ans2 = n.divide(b);
                BigDecimal ans22 = ans2.setScale(0, BigDecimal.ROUND_DOWN);

                ans = ans11.subtract(a.multiply(ans22));
            }else{
                BigDecimal ans1 = a.multiply((n.subtract(one)).divide(b));
                BigDecimal ans11 = ans1.setScale(0, BigDecimal.ROUND_DOWN);
                BigDecimal ans2 = (n.subtract(one)).divide(b);
                BigDecimal ans22 = ans2.setScale(0, BigDecimal.ROUND_DOWN);

                ans = ans11.subtract(a.multiply(ans22));
            }

            System.out.println((long)ans);

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}


Compiler output:
Main.java:40: error: incompatible types: BigDecimal cannot be converted to long
            System.out.println((long)ans);
                                     ^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
Language: Java

import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){

            BigDecimal a = new BigDecimal(sc.next());
            BigDecimal b = new BigDecimal(sc.next());
            BigDecimal n = new BigDecimal(sc.next());
            BigDecimal one = new BigDecimal("1");  


            BigDecimal ans = new BigDecimal("0");

            if(n.compareTo(one)){
                BigDecimal ans1 = a.multiply(one.divide(b));
                BigDecimal ans11 = ans1.setScale(0, BigDecimal.ROUND_DOWN);
                BigDecimal ans2 = one.divide(b);
                BigDecimal ans22 = ans2.setScale(0, BigDecimal.ROUND_DOWN);

                ans = ans11.subtract(a.multiply(ans22));
            }else if(b.compareTo(n) == 1){
                BigDecimal ans1 = a.multiply(n.divide(b));
                BigDecimal ans11 = ans1.setScale(0, BigDecimal.ROUND_DOWN);
                BigDecimal ans2 = n.divide(b);
                BigDecimal ans22 = ans2.setScale(0, BigDecimal.ROUND_DOWN);

                ans = ans11.subtract(a.multiply(ans22));
            }else{
                BigDecimal ans1 = a.multiply((n.subtract(one)).divide(b));
                BigDecimal ans11 = ans1.setScale(0, BigDecimal.ROUND_DOWN);
                BigDecimal ans2 = (n.subtract(one)).divide(b);
                BigDecimal ans22 = ans2.setScale(0, BigDecimal.ROUND_DOWN);

                ans = ans11.subtract(a.multiply(ans22));
            }

            System.out.println((long)ans);

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

Compiler output:
Main.java:17: error: incompatible types: int cannot be converted to boolean
            if(n.compareTo(one)){
                          ^
Main.java:40: error: incompatible types: BigDecimal cannot be converted to long
            System.out.println((long)ans);
                                     ^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
Language: C

#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <cmath>         // sqrt
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <bits/stdc++.h> // isupper, islower, isdigit, toupper, tolower
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pl;
typedef pair<int, int> P;
typedef tuple<ll, ll, string> Tlls;

int main()
{
  ll A, B, N;
  cin >> A >> B >> N;
  ll ans = 0;
  ll x = min(B - 1, N);
  ll tmp = floor(A * x / B) - A * floor(x / B);

  ans = max(ans, tmp);

  cout << ans << endl;
  return 0;
}


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

#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<numeric>
#define ll long long
#define MOD = 1e9+7
 
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'n' was not declared in this scope
   14 |   ll x = n;
      |          ^
a.cc:15:9: error: 'b' was not declared in this scope
   15 |   if(x>=b){
      |         ^
a.cc:18:14: error: 'a' was not declared in this scope
   18 |     cout << (a*x)/b << endl;
      |              ^
Language: C++

#include <iostream>

using namespace std;

unsigned long long get_value(unsigned long long A, unsigned long long B, unsigned long long x) {
    return ((A * x) / B) - A * (x / B);
}

int main()
{
    unsigned long long A, B, N;
    cin >> A >> B >> N;

    unsigned long long result = 0;

    unsigned long long x;
    for (x = B - 1; x <= N; x++) {
        unsigned long long tmp = get_value(A, B, x);
        if (result < tmp) result = tmp;

    cout << result;

    return 0;
}

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

#include<stdio.h>
#include<math.h>
int main(void){
  int a;
  long int b, n;
  long int c[1000000000000];
  scanf("%d%ld%ld", &a, &b, &n);
  for(long int i=0;i<=n;i++){
    c[i]=foor(a*i/b)-a*floor(i/b);
  }
  for(long int i=0;i<=n;i++){
    
  

Compiler output:
main.c: In function 'main':
main.c:9:10: error: implicit declaration of function 'foor'; did you mean 'floor'? [-Wimplicit-function-declaration]
    9 |     c[i]=foor(a*i/b)-a*floor(i/b);
      |          ^~~~
      |          floor
main.c:11:3: error: expected declaration or statement at end of input
   11 |   for(long int i=0;i<=n;i++){
      |   ^~~
main.c:11:3: error: expected declaration or statement at end of input
Language: C++

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

int main(){
    ll a, b,n;
    cin >> a>>b>>n;
//    ll x = 3;
    ll max = 0;
    ll count = 0;

    if(n > 100000000){
        for (ll i = 1; i <= n; i++) {
            if(count >= 10000) break;
            else if(a==1 || b==1) break;
            else if (max < (a*i/b - a*(i/b))) max = a*i/b - a*(i/b);
            else count++;
        }
        cout << max <<endl;
    }
    else{
        for (ll i = 1; i <= n; i++) {
            else if(a==1 || b==1) break;
            else if (max < (a*i/b - a*(i/b))) max = a*i/b - a*(i/b);
        }
        cout << max <<endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'else' without a previous 'if'
   25 |             else if(a==1 || b==1) break;
      |             ^~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(void){
  long long N, A, B, frontAns = 0, backAns = 0, maxans = 0;
  cin >> A >> B >> N;
  
  for(int i=1; i<=N; i++){
    frontAns = A * i / B - A * (i / B);
    backAns = A * (N - i + 1) / B - A * ((N - i + 1) / B);
    if(frontAns < maxans || backAns < maxans)break;
    if(frontAns == backAns){
      maxans = max(maxans, frontAns = A * i / B - A * (i / B));
      break;
    }
    if(frontAns >= backAns){
      checkAns = i;
      maxans = max(maxans, frontAns);
    }
    if(frontAns < backAns){
      checkAns = N - i + 1;
      maxans = max(maxans, backAns);
    }
  }

  cout << maxans << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: 'checkAns' was not declared in this scope
   19 |       checkAns = i;
      |       ^~~~~~~~
a.cc:23:7: error: 'checkAns' was not declared in this scope
   23 |       checkAns = N - i + 1;
      |       ^~~~~~~~
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();
      	long N = sc.nextLong();
      	if (N > B) {
            N = B;
        }
      	double ans = 1;
      	for(int x=0;x<=N;x++){
          double p1 = Math.floor(A*x/B);
          double p2 = A * Math.floor(x/B);
          double p = p1 - p2;
          ans = Math.max(ans, p);
        }

      	int c = (int)ans;
       	System.out.println(c);
    }
}

Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from double to long
            N = B;
                ^
1 error
Language: C++

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


int floor(float x){
  return static_cast<int>(x);
}

int main(){
  int A
  long int N;
  double B;
  cin >> A >> B >> N;



  int diff;
  int max=0;
  vector<int> values(N+1);
  for(long int x=0;x<N+1;x++){
    diff = floor((A*x)/B) - A*floor(x/B);
    //cout << x << ' ' << floor((A*x)/B) << '-' << A*floor(x/B) << '=' << diff << endl;
    if(diff>=max){
      max=diff;
    }
    values.at(x)=diff;

    int flag=0;
    if(x>3 && (x-1)%2==0){
      for(int j=0;j<x;j++){
        if(values.at(j)==values.at(x)){
          flag=1;
          for(int k=0;k<(x-1)/2;k++){
            if(values.at(k)!=values.at(k+(x-1)/2)){
              flag=0;
            }
          }
        }
      }
    }
    if(flag){
      break;
    }


  }
  cout << max << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected initializer before 'long'
   12 |   long int N;
      |   ^~~~
a.cc:14:10: error: 'A' was not declared in this scope
   14 |   cin >> A >> B >> N;
      |          ^
a.cc:14:20: error: 'N' was not declared in this scope
   14 |   cin >> A >> B >> N;
      |                    ^
Language: C++

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

int main() {
  int A,B,N;
  cin >> A >> B >> N;
  long long ans = 0;
  long long K = 0;
  if (B > N) {
    ans = A*N/B;
  }
  else {
    for (int i = 1; i < N/B+1; i++) {
      K = max(A*(B*i-1)/B-A*((B*i-1)/B),A*B*i/B-A*(B*I)/B);
      ans = max(ans,K);
    }
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:54: error: 'I' was not declared in this scope
   14 |       K = max(A*(B*i-1)/B-A*((B*i-1)/B),A*B*i/B-A*(B*I)/B);
      |                                                      ^
Language: C

#include<stdio.h>
#include<math.h>
//using namespace std;
int main ()
{  long long a,b,n;
   scanf("%lld %lld %lld",&a,&b,&n);
   long long sum=0;
    long long i=1;
    //if(n<=b)  {printf("%lld",(a*n)/b-a*(n/b));return 0;} 
  for(long long i=n;i>=1;i--)
   if(i%(b-1)==0) {ans=i;break;}
   long long ans=b*(i)-1;
	     if(sum<(a*ans)/b-a*(ans/b))
	     sum=(a*ans)/b-a*(ans/b);
   if(sum<(a*n)/b-a*(n/b)) sum=(a*n)/b-a*(n/b);
   printf("%lld",sum);
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:20: error: 'ans' undeclared (first use in this function)
   11 |    if(i%(b-1)==0) {ans=i;break;}
      |                    ^~~
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,i,max=0;		//x/b=iとしている。この前後で値が切り替わる
  int64_t b,n;
  cin>>a>>b>>n;
  max=floor(a*n/b)-a*floor(n/b);
  for(i=0;i<n/b;i++){
    if(floor(a*(b*i-1)/b)-a*floor((b*i-1)/b)>max){max=floor(a*(b*i-1)/b)-a*floor((b*i-1)/b);}
  }
  cout<<max<<endl;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,i,max=0;		//x/b=iとしている。この前後で値が切り替わる
  int64_t b,n;
  cin>>a>>b>>n;
  max=floor(a*n/b)-a*floor(n/b);
  for(i=0;i<n/b;i++){
    if(floor(a*(b*i-1)/b)-a*(i-1)>max){max=floor(a*(b*i-1)/b)-a*floor((b*i-1)/b);}
  }
  cout<<max<<endl;
  return 0;
}

Compiler output:
a.cc:16:5: error: redefinition of 'int main()'
   16 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: C++

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

int main(){
    ll a, b , n, ans, temp2;
    double temp1;
    cin >> a >> b >> n;
    ans = a * ((b - 1) % b) / b 
    cout << ans <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: expected ';' before 'cout'
   11 |     ans = a * ((b - 1) % b) / b
      |                                ^
      |                                ;
   12 |     cout << ans <<endl;
      |     ~~~~
Language: C++

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

int main() {
  int A,B,N;
  cin >> A >> B >> N;
  long long ans = 0;
  if (B > N) {
    ans = A*N/B;
  }
  else {
    for (int i = 1; i < N/B+1; i++) {
      K = max(A*(B*i-1)/B-A*((B*i-1)/B),A*B*i/B-A*(B*I)/B);
      ans = max(ans,K);
    }
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'K' was not declared in this scope
   13 |       K = max(A*(B*i-1)/B-A*((B*i-1)/B),A*B*i/B-A*(B*I)/B);
      |       ^
a.cc:13:54: error: 'I' was not declared in this scope
   13 |       K = max(A*(B*i-1)/B-A*((B*i-1)/B),A*B*i/B-A*(B*I)/B);
      |                                                      ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define SUM(x) accumulate(ALL(x), 0)
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MAXR 100000

ll solve(ll &a, ll &b, ll &x) {
  ll res = (int)(a * x / b) - a * (int)(x / b);
  return res;
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:32:13: error: 'x' was not declared in this scope
   32 |   else a_ = x;
      |             ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main() {

    int A;
    long long B, N;
    cin >> A >> B >> N;

    int x;

    int ans[N + 1];

    int answer = 0;
    

    vector<int> members;

    for(int x = 1; x <= N; x++) {
        ans[x] = 0;
        ans[x] = floor(A * x / B) - A * floor(x / B);
        members.push_back(ans[x]);
    }

    answer = max_element(members.begin(), members.end());
    
    cout << answer << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   26 |     answer = max_element(members.begin(), members.end());
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                         |
      |                         __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

import math
a,b,n=map(int,input().split())
max=-2
if b<n:
    n=b
for i in range(1,n+1):
    if i<b:
        s=math.floor(a*i/b)
    else:
        p=i//b
        q=i/b-p
        z=q*a
        s=math.floor(z)
    if s>max:
        max=s
print(max)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main() {
  long long A,B,N,x,sum,tmp;
  cin >> A >> B >> N;
  sum=0;

  while((A*i)/B!=0) {
    tmp=(A*i)/B-A*(i/B);
    if(sum<tmp) sum=tmp;
    i++;
  }

  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'i' was not declared in this scope
    9 |   while((A*i)/B!=0) {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for(ll i=0; i<n; i++)
#define all(v) v.begin(), v.end()
#define vec vector

/*  <<bit全探索>>
 
    for (int tmp = 0; tmp < (1 << ビット数); tmp++) {
        bitset<ビット数> s(tmp);
    }
*/
 
/*　<<stringで読み込んだ数列を一桁ずつint型へ変換>>
 
    string str;
    int N[桁数];
 
    cin >> str;
 
    for (int i = 0; i < 桁数; ++i) {
 
        N[i] = (int)(str[i] - '0');  //str[i]　はchar型なのでchar→intへ変換
 
        //cout << N[i] << endl;  //確認のため表示
    }
*/
 
typedef long long ll;

///////////////////////////////////////////////////////////////////////////


int main() { 

    ll A, B, N;
    cin >> A >> B >> N;
    
    int X = 0, Y = 0;

    for(ll i=1; i<=N; i++){
        
        X = floor(A * (i + 1) / B) - A * floor((i + 1) / B);
        if(Y >= X){
             X = Y;
        }

        Y = floor(A * (i + 1) / B) - A * floor((i + 1) / B);
    }
    

    cout << S.at(N) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:13: error: 'S' was not declared in this scope
   53 |     cout << S.at(N) << endl;
      |             ^
Language: C++

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

int main(){
    ll a, b , n, ans, temp2;
    double temp1;
    cin >> a >> b >> n;
    ans = a * ((b - 1) )% b / b 
    cout << ans <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: expected ';' before 'cout'
   11 |     ans = a * ((b - 1) )% b / b
      |                                ^
      |                                ;
   12 |     cout << ans <<endl;
      |     ~~~~
Language: C++

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

int main() {
  int A,B,N;
  cin >> A >> B >> N;
  long long ans = 0;
  if (B > N) {
    ans = A*N/B;
  }
  else {
    for (int i = 1; i < N/B;1; i++) {
      K = max(A*(B*i-1)/B-A*((B*i-1)/B),A*B*i/B-A*(B*I)/B);
      ans = max(ans,K);
    }
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: expected ')' before ';' token
   12 |     for (int i = 1; i < N/B;1; i++) {
      |         ~                    ^
      |                              )
a.cc:12:32: error: 'i' was not declared in this scope
   12 |     for (int i = 1; i < N/B;1; i++) {
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 long long A,B,N;
 cin >> A >> B >> N;
 if(A*N/B == 0){
    cout << 0 << endl;
  }
  else{
    int x = B -1 ;
    cout < <A*x/B - A*(j/B)<< endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected primary-expression before '<' token
   11 |     cout < <A*x/B - A*(j/B)<< endl;
      |            ^
a.cc:11:24: error: 'j' was not declared in this scope
   11 |     cout < <A*x/B - A*(j/B)<< endl;
      |                        ^
Language: C++

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

int main() {
  int64_t A, B, N, x;
  cin >> A >> B >> N;
  
  a = 0
  int i = 0
  while (i < N) {
      i++;
      x = Ai/B - A*(i/B);
      
      if (a < x) {
      a = x;
      }
    }
    
    cout << a << endl;
  
}

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

#include <stdio.h> 
#include <math.h>

int main(void)
{
    // int x;
    // scanf("%d", &x);
    // printf("%d\n", x);

    // long x;
    // scanf("%ld", &x);
    // printf("%ld\n", x);

    // char array[x];

    long x=1, a, b, n, ret, m=0;
    scanf("%ld", &a);
    scanf("%ld", &b);
    scanf("%ld", &n);

    if (a < 1 || b < 1　|| n < 1)
        return 1;

    while (x++ < n) {
        ret = 0;
        ret = floor((a * x) / b) - a * floor(x / b);
        //ret = a - floor(a);
        //printf("%ld\n", ret);
        if (ret > m)
            m = ret;
    }

    printf("%ld\n", m);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:23: error: stray '\343' in program
   21 |     if (a < 1 || b < 1<U+3000>|| n < 1)
      |                       ^~~~~~~~
Language: C++

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

int main() {
  int long long a,b,n;
  cin>>a>>b>>n;
  int bk=(a*n)/b;
  int ck=a*(n/b);
   int na=bk-ck;
  int sb=(a*(n-1))/b;
  int sc=a*((n-1)/b);
   int sa=sb-sc;
   for(int i=n-2;i>0;i-=1){
  int wb=(a*i)/b;
  int wc=a*(i/b);
   int wa=sb-sc;
  
  if(wa>=na){
    na=sa;
  }
  if(sa>=na){
    cout<<sa<<endl;
  }
  else{
    cout<<na<<endl;
  }
}
 


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int A;
  int64_t B,N;
  int c = 0;
  cin >> A >> B >> N;
  if (N <= B){
  for (int64_t i = 0;i <= N;i++){
    if (c < (A*i)/B - A*(i/B)){
    c = (A*i)/B - A*(i/B);
    }
    else if ((A*i)/B - A*(i/B) == A-1){
    c = (A*i)/B - A*(i/B);
      break;
    }
  }
  }
      if (B < N){
  for (int64_t i = 0;i <= B;i++){
    if (c < (A*i)/B - A*(i/B)){
    c = (A*i)/B - A*(i/B);
    }
    else if ((A*i)/B - A*(i/B) == A-1){
    c = (A*i)/B - A*(i/B);
      break;
    }
  }
  cout << c;
}

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

#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

typedef struct PAIR
{
    int a, b, c, d;
} PAIR;

template <class T>
void fub(T A, int N)
{
    if (A[N - 1] == 10)
    {
        A[N - 2]++;
        for (int i = A.size(); i > N - 2; i--)
            A[i] = A[N - 2];
        fub(A, N - 1);
    }
}

int main(void)
{
    int N, M, Q;
    cin >> N >> M >> Q;
    PAIR p[Q];
    for (int i = 0; i < Q; i++)
    {
        cin >> p[i].a >> p[i].b >> p[i].c >> p[i].d;
    }
    int MAX = 0, var;
    bool flag = true;
    vector<int> A, A_;
    int a = 0, flag;
    for (int i = 0; i < N; i++)
    {
        A.emplace_back(1);
        A.emplace_back(9);
    }
    while (flag)
    {
        var = 0;
        for (int j = 0; j < Q; j++)
            if (A[p[j].b] - A[p[j].a] == p[j].c)
                var += p[j].d;
        if (var > MAX)
            MAX = var;
        A[N - 1]++;
        fub(A, N);
        if (A == A_)
            flag = false;
    }
    printf("%d", MAX);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:16: error: conflicting declaration 'int flag'
   36 |     int a = 0, flag;
      |                ^~~~
a.cc:34:10: note: previous declaration as 'bool flag'
   34 |     bool flag = true;
      |          ^~~~
Language: Java

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
	int b = sc.nextLong();
	int n = sc.nextLong();
	
	int result=0;
	int max = 0;

	if(n<b) max = (a*n)/b;
	else{
	    for(int x=0;x<=n;x++){
		if(x<b) result = (a*x)/b;
		else result = (a*x)/b - a * (x/b);
		if(result > max) max = result;
	    }
	}
       
	System.out.print(max);
    }
}


Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from long to int
	int b = sc.nextLong();
	                   ^
Main.java:8: error: incompatible types: possible lossy conversion from long to int
	int n = sc.nextLong();
	                   ^
2 errors
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
typedef long long ll;

int main()
{
	ll A,B,N;
	scanf("%lld %lld %lld", &A,&B,&N);
	ll i = n;
	ll x;
	ll max = -1;
	ll sum = 0;
	while (i > 0)
	{
		sum = (A*i/B) - A * (i/B);
		if (sum >= max)
		{
			x = i;
			max = sum;
			break;
		}
		i--;
	}
	printf("%lld\n",max);
	return (0);
}


Compiler output:
main.c: In function 'main':
main.c:11:16: error: 'n' undeclared (first use in this function)
   11 |         ll i = n;
      |                ^
main.c:11:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
#include <utility>
#include <cstring>
#include <numeric>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define repll(i,n) for(long long int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
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;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
template <typename T_char>
char ToUpper (char cX) { return toupper(cX); }
//g++ -std=c++1z temp.cpp
//./a.exe
ll digit(ll a){
    ll count = 0;
    for (ll i = 0; i < a; i++)
    {   if (a == 0)
        {
            break;
        }else
        {
            a = a/10;
            count++;
        }
    }
    return count;
}

uintmax_t comb(unsigned int n, unsigned int r) {
  if ( r * 2 > n ) r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor  = 1;
  for ( unsigned int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}
//桁数のカウント
//pow(x,n) == x^n
//sum = accumulate(v.begin(),v.end(),0);
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a,   b) * b;}

unsigned GetDigit(unsigned num){
    return log10(num)+1;
}
int binary(int bina){
    int ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}



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

ll a,b,c,ans = 0,x;
cin >> a >> b >> c;

if(c < b){
    ans = (ll)(floorl(a*c/b)-a*floorl(c/b));
}else{
    ans = (ll)(floorl(a*(b-1)/b)-a*floorl((b-1)/b);
}
cout << ans << endl;

//////////////////////////////////////////////////////
return 0;}


Compiler output:
a.cc:59:1: error: 'uintmax_t' does not name a type
   59 | uintmax_t comb(unsigned int n, unsigned int r) {
      | ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:99:51: error: expected ')' before ';' token
   99 |     ans = (ll)(floorl(a*(b-1)/b)-a*floorl((b-1)/b);
      |               ~                                   ^
      |                                                   )
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define SUM(x) accumulate(ALL(x), 0)
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MAXR 100000

ll solve(ll &a, ll &b, ll &x) {
  ll res = (int)(a * x / b) - a * (int)(x / b);
  return res;
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:31:12: error: 'x' was not declared in this scope
   31 |   if (b <= x) a_ = b - 1;
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

int main()
{
    long long int a, b, n;
    cin >> a >> b >> n;
    // vector<int> v((n + 1) / b);
    
    if (b - 1 >= n)
    {
        cout << floor(a * n / b);
        return 0;
    }
   
    long long int ans=0;
    long long int i = b - 1;
    vector<long long int> v;
    v.reserve(100000000000);
while (i < n + 1){ 
    v.clear();
    while (i < n + 1)
    {
        v.push_back(floor(a * i / b) - a * floor(i / b));
        i+=b;
        if (v.size==100000000000)
        {
            goto lab;F
        }
        
    }
    lab:
    ans =max(ans, v[distance(v.begin(), max_element(v.begin(), v.end()))]);
}
    // cout << a-1;
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:15: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   29 |         if (v.size==100000000000)
      |             ~~^~~~
      |                   ()
a.cc:31:22: error: 'F' was not declared in this scope
   31 |             goto lab;F
      |                      ^
Language: C

#include <stdio.h>

int f(int A, int B, int x)
{
    return (A * x) / B - A * (x / B)
}

int max(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int main(void)
{
    int A, B, N;
    scanf("%d %d %d", &A, &B, &N);

    int x, res;
    res = 0;
    for (x = 1; x <= N; ++x)
    {
        res = max(res, f(A, B, x))
    }

    printf("%d", res);

    return 0;
}

Compiler output:
main.c: In function 'f':
main.c:5:37: error: expected ';' before '}' token
    5 |     return (A * x) / B - A * (x / B)
      |                                     ^
      |                                     ;
    6 | }
      | ~                                    
main.c: In function 'main':
main.c:24:35: error: expected ';' before '}' token
   24 |         res = max(res, f(A, B, x))
      |                                   ^
      |                                   ;
   25 |     }
      |     ~
Language: Java

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long n = sc.nextLong();
        if (n < b) {
            System.out.println(a * n / b);
            return;
        }
        long x = n - (n % b) - 1;
        if (n % b == b - 1) {
            x = n;
        }
        long x2 = Math.max(0, x - b);
        System.out.println(
                Math.max((a * x / b) - a * (x / b), (a * x2 / b) - a * (x2 / b));
    }
}


Compiler output:
Main.java:20: error: ')' or ',' expected
                Math.max((a * x / b) - a * (x / b), (a * x2 / b) - a * (x2 / b));
                                                                                ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
const int MAXN = 105;
int main()
{
    ll a,b,n,m1,m2,m=0,f=1;
    scanf("%I64d%I64d%I64d",&a,&b,&n);
    for(int i=1;i<=n-1;i++){
        m1=a*i/b-a*(i/b);
        m2=a*(i+1)/b-a*((i+1)/b));
        m=max(m1,m2);
        if(m1>m2){
            printf("%I64d\n",m1);
            f=0;
            break;
        }
    }
    if(f)printf("%I64d\n",m);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:33: error: expected ';' before ')' token
   13 |         m2=a*(i+1)/b-a*((i+1)/b));
      |                                 ^
      |                                 ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int A,B,N;
    cin >> A >> B >> N;
    if(B > N) {
        X += N;
    }
    else if(B == N) {
        X += B-1;
    }
    else if(B < N) {
        if(N/B < 2) {
            X += B-1;
        }
        else {
            X += (N/B)*B
        }
    }
    cout << ((A*X)/B)-(A*(X/B)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'X' was not declared in this scope
    7 |         X += N;
      |         ^
a.cc:10:9: error: 'X' was not declared in this scope
   10 |         X += B-1;
      |         ^
a.cc:14:13: error: 'X' was not declared in this scope
   14 |             X += B-1;
      |             ^
a.cc:17:13: error: 'X' was not declared in this scope
   17 |             X += (N/B)*B
      |             ^
a.cc:20:17: error: 'X' was not declared in this scope
   20 |     cout << ((A*X)/B)-(A*(X/B)) << endl;
      |                 ^
Language: C++

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
using namespace std;
typedef long long ll;

void Main()
{
    ll a, b, n;
    cin >> a >> b >> n;
    int max = -1;
    ll t = 0;

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

int main()
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(15);
    Main();
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:28:9: error: 'x' was not declared in this scope
   28 |         x = b - 1;
      |         ^
Language: C

#include <stdio.h>

int f(int A, int B, int x)
{
    return (A * x) / B - A * (x / B)
}

int max(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int main(void)
{
    int A, B, N;
    scanf("%d %d %d", &A, &B, &N);

    int res, tmp;
    res = 0;
    for (int x = 1, x <=N, ++x)
    {
        res = max(res, f(A, B, x))
    }

    printf("%d", res);

    return 0;
}

Compiler output:
main.c: In function 'f':
main.c:5:37: error: expected ';' before '}' token
    5 |     return (A * x) / B - A * (x / B)
      |                                     ^
      |                                     ;
    6 | }
      | ~                                    
main.c: In function 'main':
main.c:22:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   22 |     for (int x = 1, x <=N, ++x)
      |                       ^~
main.c:29:5: error: expected expression before 'return'
   29 |     return 0;
      |     ^~~~~~
main.c:30:1: error: expected expression before '}' token
   30 | }
      | ^
Language: C++

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

signed main() {
    int a,b,n;
    cin >> a >> b >> n;
    int ans = 0;
    int p = 0;
    int pp;
    if (n > 300000000000) {
        pp = 1;
    }
    else {
        pp = n - 2
    }
    for (int x = pp; x != n+1; x++) {
        p = a * x / b - a * (x / b);
        if (ans < p) {
            ans = p;
        }
    };
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: expected ';' before '}' token
   15 |         pp = n - 2
      |                   ^
      |                   ;
   16 |     }
      |     ~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<tuple>
#include<ctime>
#include<functional>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> p; 
#define rep(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))

int main(){
   ll A,B,N,ans=0,t[1000000000000]u[10000000];
   cin>>A>>B>>N;
   for(ll i=0;i<100000000;i++){
       t[i]=(N-i)/B;
       if(ans<A*(N-i)/B-A*t[i]) ans=A*(N-i)/B-A*t[i];
   }
   for(ll i=0;i<100000;i++){
       u[i]=(N+i)/B;
       if(ans<A*(N+i)/B-A*u[i]) ans=ans<A*(N+i)/B-A*u[i];
   }
    p(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:35: error: expected initializer before 'u'
   34 |    ll A,B,N,ans=0,t[1000000000000]u[10000000];
      |                                   ^
a.cc:37:8: error: 't' was not declared in this scope
   37 |        t[i]=(N-i)/B;
      |        ^
a.cc:41:8: error: 'u' was not declared in this scope
   41 |        u[i]=(N+i)/B;
      |        ^
Language: Java

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long b = sc.nextLong();
		long n = sc.nextLong();
		double bb = b;
		sc.close();
		double ans = 0;
		double inv = 1 / bb;
		int count = 1000;
		int j = 0;
		for (long i=n; i>=1; i--) {
			double inv2 = inv*i;
			double kai = Math.floor(a*inv2)-a*Math.floor(inv2);
			if (ans < kai) 	{
				ans = kai;
			} else {
				j++;
				if (j == count) {
					i = 10000;
				}
			}
		}
		/*
		j = 0;
		for (long i=0; i<=n; i++) {
			double inv2 = inv*i;
			double kai = Math.floor(a*inv2)-a*Math.floor(inv2);
			if (ans < kai) 	{
				ans = kai;
			} else {
				j++;
				if (j == count) {
					break;
				}
			}
		}
		*/
		System.out.println((int)ans);
	}
}


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

#include <bits/stdc++.h>
using namespace std;
int sum_ex(int);
int input(){
    int N;
    cin >> N;
    return N; 
}
vector<int> input(int N){
    vector<int> vec(N);
    for(auto& v : vec)
        cin >> v;
    return vec;
}

void Cont(){
    int A = input();
    long long　unsigned int B = input();
    long long N = input();
    long long　unsigned int kai = min(N, B-1);
    if(kai>=B){
        cout << 0 << "\n";
        return;
    }
    cout << (kai*A)/B << "\n";
}

int main()
{
	std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Cont();
}

Compiler output:
a.cc:18:10: error: extended character 　 is not valid in an identifier
   18 |     long long　unsigned int B = input();
      |          ^
a.cc:20:10: error: extended character 　 is not valid in an identifier
   20 |     long long　unsigned int kai = min(N, B-1);
      |          ^
a.cc: In function 'void Cont()':
a.cc:18:25: error: expected initializer before 'int'
   18 |     long long　unsigned int B = input();
      |                         ^~~
a.cc:20:25: error: expected initializer before 'int'
   20 |     long long　unsigned int kai = min(N, B-1);
      |                         ^~~
a.cc:21:8: error: 'kai' was not declared in this scope
   21 |     if(kai>=B){
      |        ^~~
a.cc:21:13: error: 'B' was not declared in this scope
   21 |     if(kai>=B){
      |             ^
a.cc:25:14: error: 'kai' was not declared in this scope
   25 |     cout << (kai*A)/B << "\n";
      |              ^~~
a.cc:25:21: error: 'B' was not declared in this scope
   25 |     cout << (kai*A)/B << "\n";
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    double a,b,n;
    long long kq = 0;
    long long kq2 = 0;
    cin >> a >> b >>n;
    kq = floor(a * (n) / b);
    kq2 = floor((n)/b)
    cout<<kq - kq2;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected ';' before 'cout'
   10 |     kq2 = floor((n)/b)
      |                       ^
      |                       ;
   11 |     cout<<kq - kq2;
      |     ~~~~
Language: C

#include <stdio.h>
#include <math.h>

int main()
{
	double B,N,C;
	int A,max = 0;

	scanf("%d %lf %lf",&A,&B,&N);

	if (N < B){
		max = floor(A * N / B) - A * floor(N / B);
	}else{
		for (double x = B - 1;x <= N;x += B){
			if (max < floor(A * x / B) - A * floor(x / B);){
				max = floor(A * x / B) - A * floor(x / B);;
			}
		}
	}

	printf("%d\n",max);

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:70: error: expected ')' before ';' token
   15 |                         if (max < floor(A * x / B) - A * floor(x / B);){
      |                            ~                                         ^
      |                                                                      )
Language: C++

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

int main() {
  long a,b,n;
  cin >>a>>b>>n;
  vector<long> vec(n);
  for(long i=1;i <= n;i++){
    long long aa= floor(a*i/b)-a*floor(i/b)
    vec[i-1] = aa;
  }
  sort(vec.begin(),vec.end());
  cout << vec[n-1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'vec'
   10 |     vec[i-1] = aa;
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0; i<(n); ++i)
#define REP(i, d, n) for(long long i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {//言語変えろ言語変えろ言語変えろ言語変えろ言語変えろ
            
ll a,b,n; cin>>a>>b>>n;
  ll max=-999999;
  ll ans;
  
  
  if(b>n){ans=n;}
  else{ans=b-1;}
    
  }
              
     max=ans*a/b-a*(ans/b);
              
              
  
  cout<<max<<endl;
  
}


Compiler output:
a.cc:19:6: error: 'max' does not name a type
   19 |      max=ans*a/b-a*(ans/b);
      |      ^~~
a.cc:23:3: error: 'cout' does not name a type
   23 |   cout<<max<<endl;
      |   ^~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C

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

int main() {
  long long int A,B,N;
  int max = 0;
  cin >> A >> B >> N;
  
  for( int i = 1 ; i <= (N/B) ; i++){
    long long int k;
    k = A*i-A/B - A*(i);
    if(k > max){
      max = k;
    }
  }
  cout << max << endl;
}

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

#include <stdio.h>

int main(void){
    long int a,b,n,lp,lq;
    long int max = 0;
    int save = 1000
    int maxNum;
    scanf("%ld%ld%ld",&a,&b,&n);
    if(0 < n < 10000){
        for(long int i =0; i <=n; i++){
            lp = a*i/b;
            lq = i/b;
            long int ans = lp - a * lq;
            if(max < ans){
                max = ans;
            }
        }
    }else{
        long int data[save];
        data[0] = n/save;
        for(int i = 1; i < save;i++){
            data[i] = data[i-1] + n/save;
        }
        for(int i = 0; i < 20;i++){
            lp = a*data[i]/b;
            lq = data[i]/b;
            long int ans = lp - a * lq;
            if(max < ans){
                maxNum = i;
                max = ans;
            }
        }
        for (int i = data[maxNum-1];i < data[maxNum + 1];i++){
            lp = a*i/b;
            lq = i/b;
            long int ans = lp - a * lq;
            if(max < ans){
                maxNum = i;
            }
        }
    }
    printf("%d",max);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: expected ',' or ';' before 'int'
    7 |     int maxNum;
      |     ^~~
main.c:29:17: error: 'maxNum' undeclared (first use in this function)
   29 |                 maxNum = i;
      |                 ^~~~~~
main.c:29:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int m = 1e9 + 6;
int main()
{
    double a,b,n;
    cin >> a >> b >>n;
    cout<<floor(a * (n) / b)-floor((n)/b) % m;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:43: error: invalid operands of types 'double' and 'const int' to binary 'operator%'
    8 |     cout<<floor(a * (n) / b)-floor((n)/b) % m;
      |                              ~~~~~~~~~~~~ ^ ~
      |                                   |         |
      |                                   double    const int
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
//int floor(double a){
//  int answer;
 // answer=

int main() {
  int64_t A,B,N;
  cin>>A>>B>>N;
  int64_t answer=1;
  int64_t a;
  for(int64_t x=1;x<N+1;x++){
    a=floor(A*x/B)-A*floor(x/B);
    answer=max(a,answer);
    if
  }
  cout<<answer<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected '(' before '}' token
   17 |   }
      |   ^
      |   (