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

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: incomplete type 'std::ios' {aka 'std::basic_ios<char>'} used in nested name specifier
   17 |         ios::sync_with_stdio(0); cin.tie(0);
      |              ^~~~~~~~~~~~~~~
a.cc:17:34: error: 'cin' was not declared in this scope
   17 |         ios::sync_with_stdio(0); cin.tie(0);
      |                                  ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include<cstring>
  +++ |+#include <iostream>
    9 | #define ll long long;
a.cc:27:36: error: 'floor' was not declared in this scope
   27 |                         int temp = floor(double(a) * i / double(b)) - floor(i / double(b)) * (a);
      |                                    ^~~~~
a.cc:32:9: error: 'cout' was not declared in this scope
   32 |         cout << ans;
      |         ^~~~
a.cc:32:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define rev(v) reverse(v.begin(), v.end())
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
#define uniq(a) sort(all(a));(a).resize(unique(all(a)) - a.begin());
#define dab(v) for(auto i:v)cout<<i<<' '; cout << endl;
#define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, const T& b) { if (a > b) { a = b; return 1; } return 0; }
int dx[] = { 0, 0, -1, 1 };
int dy[] = { 1, -1, 0, 0 };
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }


long long int value(long long int x, long long int A, long long int B) {
	return floor(A * x / B) - A * floor(x / B);
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	
	long long int A, B, N;
	cin >> A >> B >> N;

	long long int D;
	long long int temp1;
	long long int temp2;
	D = long long int(N / B);

	temp1 = D * B - 1;
	temp2 = N;

	if (value(temp1, A, B) > value(temp2, A, B)) {
		cout << value(temp1, A, B);
	}
	else {
		cout << value(temp2, A, B);
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:13: error: expected primary-expression before 'long'
   67 |         D = long long int(N / B);
      |             ^~~~
Language: C++

using namespace std;
int main()
{
  long a,b,n;
  cin>>a>>b>>n;
  cout<<((a*n)/b)<<endl;
  return 0;
}

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

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: incomplete type 'std::ios' {aka 'std::basic_ios<char>'} used in nested name specifier
   17 |         ios::sync_with_stdio(0); cin.tie(0);
      |              ^~~~~~~~~~~~~~~
a.cc:17:34: error: 'cin' was not declared in this scope
   17 |         ios::sync_with_stdio(0); cin.tie(0);
      |                                  ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include<cstring>
  +++ |+#include <iostream>
    9 | #define ll long long;
a.cc:25:28: error: 'floor' was not declared in this scope
   25 |                 int temp = floor(double(a )* i / double(b)) - floor(i / double(b)) * (a);
      |                            ^~~~~
a.cc:28:26: error: 'floor' was not declared in this scope
   28 |         if (n == 0)ans = floor(double(a) * 0 / double(b)) - floor(0 / double(b)) * (a);
      |                          ^~~~~
a.cc:29:9: error: 'cout' was not declared in this scope
   29 |         cout << ans;
      |         ^~~~
a.cc:29:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.Scanner;

public class Solution {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        int max = -1000000;
        for(int i=0;i<10000000&&i<=c;i++)
        {
            int fc =(int)((a*i)/b) -(a*(int)(i/b));
            if(fc>max)
            {
                //System.out.println(fc+" "+i);
                max=fc;
            }
        }
        System.out.print(max);
    }
}


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

#include "cmath"
#include "iostream"

using namespace std;

long long a1, b1, n;

long long fuuuxx(long long x) { return floorl(a1 * x / b1) - (a1 * floorl(x / b1)); }

int main() {
  
    cin >> a1 >> b1 >> n;
    cout << max(fuuuxx(min(b1 - 1, n)), fuuu(0));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: 'fuuu' was not declared in this scope; did you mean 'fuuuxx'?
   13 |     cout << max(fuuuxx(min(b1 - 1, n)), fuuu(0));
      |                                         ^~~~
      |                                         fuuuxx
Language: Java

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

		int a = sc.nextInt();
		int b = sc.nextInt();
		int n = sc.nextInt();
		int max = 0;
		long floor = 0;


		for (int i = 1;i<=n ;i++ ) {
			floor = ((a*i)/b)-(a*(i/b));
			max = Math.max(max,floor);
		}
		System.out.println(max);


	}
}


Compiler output:
Main.java:15: error: incompatible types: possible lossy conversion from long to int
			max = Math.max(max,floor);
			              ^
1 error
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
using ll = long long;

int main()
{
	ll a, b, n;
	cin >> a >> b >> n;
	int sol = 0;
	for (int x = 0; x < n; ++x)
	{
		int u = floor((a*x)/b);
		int v = a * (floor (x/b));
		int z = u - v;
		sol = max(sol, z);
	}
	cout << z;
}

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

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

int main() {
  long a, b, n;
  cin >> a >> b >> n;
  long ans = 0;
  for(int i = 0; i <= n; i++) {
    long temp1 = a * i / b;
    long temp2 = i / b;
    int temp = temp1 - a * temp2;
    ans = max(ans, temp);
  }
  cout << ans << endl;
}


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



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.StringTokenizer;

public class D {
	static long N = 1000000007;

	static long exponentiation(long base, long exp) {
		long t = 1L;
		while (exp > 0) {
			if (exp % 2 != 0)
				t = (t * base) % N;

			base = (base * base) % N;
			exp /= 2;
		}
		return t % N;
	}

	public static void main(String args[]) throws Exception {
		MyScanner sc = new MyScanner();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long n = sc.nextLong();
		
		long x = 0;
		
		if(b - 1 > n)
			x = n;
		else
			x = b - 1;
		
		long ans = (long)(Math.floorDiv((a * x) , b));
		System.out.println(ans);
		
		
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}

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

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

#define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
#define fb(i,a,b) for(int (i) = (a); (i) >= (b); --(i))
#define mod 998244353
#define xx first
#define yy second
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define ll long long
#define pii pair<int,int>


using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>,rb_tree_tag, tree_order_statistics_node_update> ordered_set;/// find_by_order(x)(x+1th) , order_of_key() (strictly less)
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());


ll a,b,n;



int main()
{

    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> a >> b >> n;
    ll sta = n%b;
    ll kojen = n;
    if(sta != b-1){
        kojen = (n - n%b) - 1;
    }
    if(kojen >= 0)ll res = (a*kojen) / b  - a*((kojen)/b);
    //cout << res << endl;
    fb(i,n,n-100){
        if(i < 0)break;

        res = max(res, (a*i)/b - a*((i)/b));
    }
    if(b-1 <= n)res = max(res, (a*(b-1))/b - a*((b-1)/b));
    ff(i,0,100){
        if(i > n)break;
        res = max(res, (a*i)/b - a*((i)/b));
    }
    ll last = -1;
    if(a == 1 || b == 1){
        cout << res << endl;
        return 0;
    }
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'res' was not declared in this scope
   42 |         res = max(res, (a*i)/b - a*((i)/b));
      |         ^~~
a.cc:44:17: error: 'res' was not declared in this scope
   44 |     if(b-1 <= n)res = max(res, (a*(b-1))/b - a*((b-1)/b));
      |                 ^~~
a.cc:47:9: error: 'res' was not declared in this scope
   47 |         res = max(res, (a*i)/b - a*((i)/b));
      |         ^~~
a.cc:51:17: error: 'res' was not declared in this scope
   51 |         cout << res << endl;
      |                 ^~~
a.cc:54:13: error: 'res' was not declared in this scope
   54 |     cout << res << endl;
      |             ^~~
Language: C++

#include "cmath"
#include "iostream"

using namespace std;

long long a1, b1, n;

long long fuuuxx(long long x) { return floorl(a * x / b) - (a * floorl(x / b)); }

int main() {
  
    cin >> a1 >> b1 >> n;
    cout << max(fuuuxx(min(b - 1, n)), fuuu(0));
    return 0;
}

Compiler output:
a.cc: In function 'long long int fuuuxx(long long int)':
a.cc:8:47: error: 'a' was not declared in this scope
    8 | long long fuuuxx(long long x) { return floorl(a * x / b) - (a * floorl(x / b)); }
      |                                               ^
a.cc:8:55: error: 'b' was not declared in this scope
    8 | long long fuuuxx(long long x) { return floorl(a * x / b) - (a * floorl(x / b)); }
      |                                                       ^
a.cc: In function 'int main()':
a.cc:13:28: error: 'b' was not declared in this scope
   13 |     cout << max(fuuuxx(min(b - 1, n)), fuuu(0));
      |                            ^
a.cc:13:40: error: 'fuuu' was not declared in this scope; did you mean 'fuuuxx'?
   13 |     cout << max(fuuuxx(min(b - 1, n)), fuuu(0));
      |                                        ^~~~
      |                                        fuuuxx
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
using ll = long long;

int main()
{
	ll a, b, c;
	cin >> a >> b >> c;
	int sol = 0;
	for (int x = 0; x < n; ++x)
	{
		int u = floor((a*x)/b);
		int v = a * (floor (x/b));
		int z = u - v
		sol = max(sol, z)
	}
	cout << z;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: 'n' was not declared in this scope
   12 |         for (int x = 0; x < n; ++x)
      |                             ^
a.cc:17:17: error: expected ',' or ';' before 'sol'
   17 |                 sol = max(sol, z)
      |                 ^~~
a.cc:19:17: error: 'z' was not declared in this scope
   19 |         cout << z;
      |                 ^
Language: C++

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: incomplete type 'std::ios' {aka 'std::basic_ios<char>'} used in nested name specifier
   17 |         ios::sync_with_stdio(0); cin.tie(0);
      |              ^~~~~~~~~~~~~~~
a.cc:17:34: error: 'cin' was not declared in this scope
   17 |         ios::sync_with_stdio(0); cin.tie(0);
      |                                  ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include<cstring>
  +++ |+#include <iostream>
    9 | #define ll long long;
a.cc:25:28: error: 'floor' was not declared in this scope
   25 |                 int temp = floor(double(a )* i / double(b)) - floor(i / double(b)) * (a);
      |                            ^~~~~
a.cc:29:9: error: 'cout' was not declared in this scope
   29 |         cout << ans;
      |         ^~~~
a.cc:29:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <io#include <iostream>
#include <bits/stdc++.h>

#define rep(i,z) for(int i = 0; i<(int)(z); i++)
#define rep1(i,z) for(int i = 1; i<=(int)(z); i++)
 
using namespace std;

typedef long long ll;
const ll MOD=1e9+7;
using pear = pair<int,int>;

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

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

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

int main(){
    ll N, A ,B;
    cin >> A >> B >> N;
    ll ans = 0;

    for(int x = 0; x < min(1e8 , N); x += 1){
        ans = max(ans, ll(floor(A * x / B) - A * floor(x / B)));
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: no matching function for call to 'min(double, ll&)'
   10 |     for(int x = 0; x < min(1e8 , N); x += 1){
      |                        ~~~^~~~~~~~~
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:10:27: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'll' {aka 'long long int'})
   10 |     for(int x = 0; x < min(1e8 , N); x += 1){
      |                        ~~~^~~~~~~~~
/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:10:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   10 |     for(int x = 0; x < min(1e8 , N); x += 1){
      |                        ~~~^~~~~~~~~
Language: C++

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

#define ll long long


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

	ll a,b,n;
	cin>>a>>b>>n;
	ll ans=0,x=1;
	while(x<=n){
		int tmp=floor(a*1.0*x/b)-a*floor(x*1.0/b);
		ans=max(ans,tmp);
		x++;
	}
	cout<<ans<<"\n";
	return 0;
}


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

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class ssss {
    public static void main(String[] args){
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            String[] ss=br.readLine().split(" ");
            long A=Long.parseLong(ss[0]);
            long B=Long.parseLong(ss[1]);
            long N=Long.parseLong(ss[2]);
            long ans=0;
          if(B==1){
            System.out.println(0);
            return;
          }
            if(B>N){
                ans=(A*N)/B;
            }else{
                long p=B-1;
                while(p<=N){
                    ans=Math.max(ans,(A*p)/B-A*(p/B));
                    p+=B;
                }
            }
            System.out.println(ans);
        }catch(Exception e){
            System.out.println("KKKK "+e.getMessage());
        }
    }
    static int mod(int a,int b){
        if (a>b){
            return a-b;
        }
        return b-a;
    }
    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }
}


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


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

int main()
{

    long long  n,m,q;
    cin >> n >> m >> q;
    long long v = n * (long long )(min(q,m-1)/m);
    long long c = (long long )(n*min(m-1a,q))/m;
    cout<<c-v;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:40: error: unable to find numeric literal operator 'operator""a'
   12 |     long long c = (long long )(n*min(m-1a,q))/m;
      |                                        ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PI 3.1415926535
#define MOD 1000000007
 
int main(){
  
  ll A,B,N;
  cin >> A >> B >> N;
  
  ll mx = 0;
  ll ans;
  for(int i = 0;i <= min(N,B);i++){
    ans = (ll)(A * / B * (i % B));
    mx = max(mx,ans);
  }
  
  cout << ans << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected primary-expression before '/' token
   15 |     ans = (ll)(A * / B * (i % B));
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PI 3.1415926535
#define MOD 1000000007
 
int main(){
  
  ll A,B,N;
  cin >> A >> B >> N;
  
  ll mx = 0;
  ll ans;
  for(int i = 0;i <= min(N,B);i++){
    ans = (ll)(A * / B (i % B));
    mx = max(mx,ans);
  }
  
  cout << ans << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected primary-expression before '/' token
   15 |     ans = (ll)(A * / B (i % B));
      |                    ^
a.cc:15:24: error: 'B' cannot be used as a function
   15 |     ans = (ll)(A * / B (i % B));
      |                      ~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
    ll a,b,n;
    cin>>a>>b>>n;
    ll maxi=0;
    for(ll i=0;i<=min(1000000,n);i++)
    {
        maxi=max(maxi,(a*i/b)-a*(i/b));
    }
    cout<<maxi;
}

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

#int(input())
#map(int,input().split())
#list(map(int,input().split()))

a,b,n=map(int,input().split())
l=[]
if n>=b:
    x=b-1
else:
    x=n
print(math.floor((a*x)/b)-a*math.floor(x/b))

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #int
    1 | #int(input())
      |  ^~~
a.cc:2:2: error: invalid preprocessing directive #map
    2 | #map(int,input().split())
      |  ^~~
a.cc:3:2: error: invalid preprocessing directive #list
    3 | #list(map(int,input().split()))
      |  ^~~~
a.cc:5:1: error: 'a' does not name a type
    5 | a,b,n=map(int,input().split())
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

long long a,b,n;

long long eval(long long x)
{
	return a*x/b - a*(x/b);
}

int main()
{
	cin >> a >> b >> n;
	long long ans=0;
	for(long long i=0;i<=min(n,a);i++)
		ans=max(ans,a*i/b - a*(i/b));
	for(long long i=1;i*i<=b;i++)
	{
		if(i<=n) ans=max(ans,a*i/b - a*(i/b));
		long long x=b/i;
		if(x<=n) ans=max(ans,a*x/b - a*(x/b));
	}
	for(long long x=max(b-a,0LL);x<=b+a;x++)
		if(x<=n) ans=max(ans,eval(x));
	ans=max(ans,eval(n));
	for(long long x=n;x>=max(0LL,n-2*a);x--)
		ans=max(anx,eval(x));
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:25: error: 'anx' was not declared in this scope; did you mean 'ans'?
   28 |                 ans=max(anx,eval(x));
      |                         ^~~
      |                         ans
Language: C++

/*Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.

My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.

He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
const int maxn= 100010;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli a=0ll,b=0ll,n=0ll;
    cin>>a>>b>>n;
    if(n<b)
        cout<<(1ll*a*n)/b;
    else
    {
        cout<<max((1ll*a*(n-1ll))/b-(1ll*a*((n-1ll)/b)),(1ll*a*(b-1ll)/b);
    }
    cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:74: error: expected ')' before ';' token
   39 |         cout<<max((1ll*a*(n-1ll))/b-(1ll*a*((n-1ll)/b)),(1ll*a*(b-1ll)/b);
      |                  ~                                                       ^
      |                                                                          )
Language: C++

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

typedef long long ll;

int a;
ll b, n;
ll x;
ll t, maxt = -INT_MAX;

int main()
{
	cin >> a >> b >> n;
	for(x = 0; x <= n; i++)
	{
		ll v1 = floor(a * x / b);
		ll v2 = a * floor(x / b);
		t = v1 - v2;
		if(maxt < t) maxt = t;
	}
	cout << maxt;
	
//	system("pause");
	return 0;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'c' was not declared in this scope
    9 |         if(c>=b) c=b-1;
      |            ^
a.cc:10:23: error: 'c' was not declared in this scope
   10 |         cout<<floor(a*c/b)-a*floor(c/b)<<endl;
      |                       ^
Language: Java

import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String a = sc.next();
    long aa = Long.parseLong(a);
    String b = sc.next();
    long bb = Long.parseLong();
    String n = sc.next();
    long nn = Long.parseLong(n);
    long ans = 0;
    for(long i = 1; i <= nn; i++){
     	long temp = (aa*i)/bb - aa*(i/bb);
      	if(temp > ans) ans = temp;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:9: error: no suitable method found for parseLong(no arguments)
    long bb = Long.parseLong();
                  ^
    method Long.parseLong(String,int) is not applicable
      (actual and formal argument lists differ in length)
    method Long.parseLong(CharSequence,int,int,int) is not applicable
      (actual and formal argument lists differ in length)
    method Long.parseLong(String) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

long long a,b,n;

long long eval(long long x)
{
	return a*x/b - a*(x/b);
}

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

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

import math
A, B, N = map(int, input().split())


if N < B:
    print(math.floor(A * N / B) - A * math.floor(N / B))
else:
    print(math.floor(A * (B-1) / B) - A * math.floor((B-1) / B))

    

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 <vector>
#include <algorithm>
using namespace std;

typedef long long ll;

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

	int max = 0;
	for (int x = 0; x <= n; x++) {
		int y = x % b;
		int c = a * y / b;
		if (c > max) {
			max = c;
		}
		if (x == b) {
			break;
		}
	}

	cout << max << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |         cin >> a >> b >> n;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << max << endl;
      |         ^~~~
a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:24: error: 'endl' was not declared in this scope
   24 |         cout << max << endl;
      |                        ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
  long long int a,b,n;
  cin>>a>>b>>n;
  int x[n+1];
  for(int i=0;i<=n;i++)
  {
    x[i]=floor(a*i/b)-a*floor(i/b);
  }
  int m=x[0];
  for(int i=0;i<=n;i++)
  {
    if(x[i]>m)
      m=x[i];
  }
  
  cout<<m;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'floor' was not declared in this scope
   11 |     x[i]=floor(a*i/b)-a*floor(i/b);
      |          ^~~~~
Language: Java

import java.io.*;
import java.util.Random;
import java.util.StringTokenizer;

public class D {
    //Solution by Sathvik Kuthuru
    public static void main(String[] args) {
        FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = 1;
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader scan, PrintWriter out) {
            long a = scan.nextLong(), b = scan.nextLong(), c = scan.nextLong();
            out.println(Math.max(Math.max(func(a, b, b - 1), func(a, b, b)), func(a, b, b + 1)));
        }

        static long func(long a, long b, long x) {
            return a * x / b - a * (x / b);
        }
    }

    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

Compiler output:
Main.java:5: error: class D is public, should be declared in a file named D.java
public class D {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Solution {
    Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        new Solution().solve();
    }

    void solve() {
        int a = in.nextInt();
        int b = in.nextInt();
        int n = in.nextInt();

        double max = 0;
        for (int i = n; i >= 1; i--) {
            if (i % b == 1 || b % i == 1) {
                max = Math.max(max, i);
                break;
            }
        }
        double x = Math.floor(a * max / b) - a * Math.floor(max / b);
        System.out.println((int) x);
    }
}


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


#include <iostream>
#include <cmath>

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


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

#include <algorithm>
#include <string.h>
#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;

typedef long long ll;
typedef double db;
db a, b, n;
db x, x2 = -1;

int main() {
	cin >> a >> b >> n;
	
	x = floor(a * n / b) - a * floor(n / b);
	if (n > b) {
		db t = n / b * b - 1;
		x2 = floor(a * t / b) - a * floor(t / b);
	}

	cout << max(x, x2) << endl;
	
	return 0;
}

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

#include <bits/stdc++.h>
#define ls x<<1
#define rs x<<1|1
#define fi first
#define se second
#define ll long long
#define pb push_back
#define mp make_pair
#define fun function
#define sz(x) (x).size()
#define lowbit(x) (x)&(-x)
#define all(x) (x).begin(),(x).end()
#define mem(a,b) memset(a,b,sizeof(a))

namespace FastIO {
#define BUF_SIZE 100000
#define OUT_SIZE 100000
	bool IOerror=0;
	inline char nc() {
		static char buf[BUF_SIZE],*p1=buf+BUF_SIZE,*pend=buf+BUF_SIZE;
		if(p1==pend) {
			p1=buf;
			pend=buf+fread(buf,1,BUF_SIZE,stdin);
			if(pend==p1) {
				IOerror=1;
				return -1;
			}
		}
		return *p1++;
	}
	inline bool blank(char ch) {
		return ch==' '||ch=='\n'||ch=='\r'||ch=='\t';
	}
	template<class T> inline bool read(T &x) {
		bool sign=0;
		char ch=nc();
		x=0;
		for(; blank(ch); ch=nc());
		if(IOerror)return false;
		if(ch=='-')sign=1,ch=nc();
		for(; ch>='0'&&ch<='9'; ch=nc())x=x*10+ch-'0';
		if(sign)x=-x;
		return true;
	}
	template<class T,class... U>bool read(T& h,U&... t) {
		return read(h)&&read(t...);
	}
#undef OUT_SIZE
#undef BUF_SIZE
};
using namespace std;
using namespace FastIO;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int INF = 0x3f3f3f3f;

ll a,b,n;

ll get(ll x){
	ll ans=(a*x)/b-a*(x/b);
	return ans;
}

int main() {

#ifdef xiaofan
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
#endif

	
	read(a,b,n);
	ll l=1,r=n;
	while(r>l) {
		ll m1=l+(r-l)/3;
		ll m2=r-(r-l)/3;
		if(get(m1)>get(m2))
			r=m2-1;
		else
			l=m1+1;
	}
	cout<<cnt<<endl;




	return 0;
}



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

#include <iostream>
#include <string>
#include <limits.h>
#include <numeric>
#include <math.h>
#include <bits/stdc++.h>
#define rep(i,c) for (int i=0;i<c;i++)
using namespace std;
typedef long long ll;

int main(){
    long int  A,B,N;
    cin >> A>>B>>N;
    int ans = 0;
    for(int i=1;i<=N;i++){

        if(a>ans) ans = a;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'a' was not declared in this scope
   17 |         if(a>ans) ans = a;
      |            ^
Language: C

# include <bits/stdc++.h>
# define speed ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
# pragma GCC optimize "-O3"
# define int long long
  
using namespace std;
  
const int N = 1e4 + 7;
const int mod = 1e9 + 7;

void solve() {
	int a, b, n;
	cin >> a >> b >> n;
	cout << (a*n) / b - a * (n / b) << '\n';
}

int32_t main() {
	speed;
	int T = 1;
	// cin >> T;
	while ( T-- ) {
		solve();
	}
}

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