Language: C++

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

float floor(float a){
    return (int64)a;
}

int64_t floor_maxsum(int64_t a,int64_t b,int64_t n){
    int64_t sumb=0,suma,x=0;
    suma=floor((float)a*(float)x/(float)b)-a*floor((float)x/(float)b);
    x++;
    while(sumb<=suma&&x<=n){
        sumb=suma;
        x++;
        suma=floor((float)a*(float)x/(float)b)-a*floor((float)x/(float)b);
    }
    return sumb;
}

int main(){
    int64_t a,b,n;
    cin>>a>>b>>n;
    cout<<floor_maxsum(a,b,n);
    }


Compiler output:
a.cc: In function 'float floor(float)':
a.cc:6:13: error: 'int64' was not declared in this scope
    6 |     return (int64)a;
      |             ^~~~~
a.cc:6:19: error: expected ';' before 'a'
    6 |     return (int64)a;
      |                   ^
      |                   ;
a.cc: In function 'int64_t floor_maxsum(int64_t, int64_t, int64_t)':
a.cc:11:15: error: call of overloaded 'floor(float)' is ambiguous
   11 |     suma=floor((float)a*(float)x/(float)b)-a*floor((float)x/(float)b);
      |          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:198:1: note: candidate: 'double floor(double)'
  198 | __MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
a.cc:5:7: note: candidate: 'float floor(float)'
    5 | float floor(float a){
      |       ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114:
/usr/include/c++/14/cmath:261:3: note: candidate: 'constexpr long double std::floor(long double)'
  261 |   floor(long double __x)
      |   ^~~~~
/usr/include/c++/14/cmath:257:3: note: candidate: 'constexpr float std::floor(float)'
  257 |   floor(float __x)
      |   ^~~~~
a.cc:11:51: error: call of overloaded 'floor(float)' is ambiguous
   11 |     suma=floor((float)a*(float)x/(float)b)-a*floor((float)x/(float)b);
      |                                              ~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:198:1: note: candidate: 'double floor(double)'
  198 | __MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
a.cc:5:7: note: candidate: 'float floor(float)'
    5 | float floor(float a){
      |       ^~~~~
/usr/include/c++/14/cmath:261:3: note: candidate: 'constexpr long double std::floor(long double)'
  261 |   floor(long double __x)
      |   ^~~~~
/usr/include/c++/14/cmath:257:3: note: candidate: 'constexpr float std::floor(float)'
  257 |   floor(float __x)
      |   ^~~~~
a.cc:16:19: error: call of overloaded 'floor(float)' is ambiguous
   16 |         suma=floor((float)a*(float)x/(float)b)-a*floor((float)x/(float)b);
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:198:1: note: candidate: 'double floor(double)'
  198 | __MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
a.cc:5:7: note: candidate: 'float floor(float)'
    5 | float floor(float a){
      |       ^~~~~
/usr/include/c++/14/cmath:261:3: note: candidate: 'constexpr long double std::floor(long double)'
  261 |   floor(long double __x)
      |   ^~~~~
/usr/include/c++/14/cmath:257:3: note: candidate: 'constexpr float std::floor(float)'
  257 |   floor(float __x)
      |   ^~~~~
a.cc:16:55: error: call of overloaded 'floor(float)' is ambiguous
   16 |         suma=floor((float)a*(float)x/(float)b)-a*floor((float)x/(float)b);
      |                                                  ~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:198:1: note: candidate: 'double floor(double)'
  198 | __MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
a.cc:5:7: note: candidate: 'float floor(float)'
    5 | float floor(float a){
      |       ^~~~~
/usr/include/c++/14/cmath:261:3: note: candidate: 'constexpr long double std::floor(long double)'
  261 |   floor(long double __x)
      |   ^~~~~
/usr/include/c++/14/cmath:257:3: note: candidate: 'constexpr float std::floor(float)'
  257 |   floor(float __x)
      |   ^~~~~