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

#include <bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll = long long;

const double PI = 3.14159265358979;

void solve()
{
  ll n, k;
  cin >> n >> k;
  ll ans = 0;

  for(ll i = k + 1; i <= n; ++i)
  {
    // a % b >= k
    // a % i >= k
    ans += n / i * (i - k) + max(n % i - k + 1, 0);
  }
  if (k == 0) ans -= n;
  cout << ans;
}

int main()
{
  fastio;
  solve();

  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:22:33: error: no matching function for call to 'max(ll, int)'
   22 |     ans += n / i * (i - k) + max(n % i - k + 1, 0);
      |                              ~~~^~~~~~~~~~~~~~~~~~
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:22:33: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   22 |     ans += n / i * (i - k) + max(n % i - k + 1, 0);
      |                              ~~~^~~~~~~~~~~~~~~~~~
/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:22:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   22 |     ans += n / i * (i - k) + max(n % i - k + 1, 0);
      |                              ~~~^~~~~~~~~~~~~~~~~~
Language: C++

 "bits/stdc++.h"

using namespace std;

void Main() {
    int N, K;
    cin >> N >> K;

    if (K == 0) {
        cout << N * N << endl;
        return;
    }
    int ans = 0;
    for (int b = K + 1; b <= N; ++b) {
        ans += (b - K) * (N / b);
        if (N % b != 0) {
            int begin = b * (N / b) + K;
            int end = N + 1;
            ans += max(0, end - begin);
        }
    }
    cout << ans << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Compiler output:
a.cc:1:2: error: expected unqualified-id before string constant
    1 |  "bits/stdc++.h"
      |  ^~~~~~~~~~~~~~~
a.cc: In function 'void Main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> N >> K;
      |     ^~~
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout << N * N << endl;
      |         ^~~~
a.cc:10:26: error: 'endl' was not declared in this scope
   10 |         cout << N * N << endl;
      |                          ^~~~
a.cc:19:20: error: 'max' was not declared in this scope
   19 |             ans += max(0, end - begin);
      |                    ^~~
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout << ans << endl;
      |     ^~~~
a.cc:22:20: error: 'endl' was not declared in this scope
   22 |     cout << ans << endl;
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:26:10: error: 'cout' is not a member of 'std'
   26 |     std::cout << std::fixed << std::setprecision(15);
      |          ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 |  "bits/stdc++.h"
a.cc:26:23: error: 'fixed' is not a member of 'std'
   26 |     std::cout << std::fixed << std::setprecision(15);
      |                       ^~~~~
a.cc:1:1: note: 'std::fixed' is defined in header '<ios>'; this is probably fixable by adding '#include <ios>'
  +++ |+#include <ios>
    1 |  "bits/stdc++.h"
a.cc:26:37: error: 'setprecision' is not a member of 'std'
   26 |     std::cout << std::fixed << std::setprecision(15);
      |                                     ^~~~~~~~~~~~
a.cc:1:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
  +++ |+#include <iomanip>
    1 |  "bits/stdc++.h"
Language: C++

#include<iostream>
using namespace std;
int main()
{
  long long n,k;
  long long i,j;
  long long count=0;
  cin>>n >>k;
  for(i=1;i<n;i++)
  {
    for(j=1;j<n;j++)
    {
      if((i/j)>=k)
      {
        count++;
      }
    }
  }

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

#include <bits/stdc++.h>
using namespace std;
#define __Mammamia__                ios_base :: sync_with_stdio(false);
#define ll                          long long
#define MAXN                        100007

int main()
{
    __Mammamia__

    ll n, k, res = 0; cin >> n >> k;

    if(!k){cout << n * n << endl; return 0;}

    for(ll i = 1; i <= n; ++i)
    {
        if(i > k)
        {
            res += ll(n / i) * (i - k) + max(ll(0), (n % i - k + 1));
        }
    }
    cout << res << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:4:37: error: expected primary-expression before 'long'
    4 | #define ll                          long long
      |                                     ^~~~
a.cc:19:20: note: in expansion of macro 'll'
   19 |             res += ll(n / i) * (i - k) + max(ll(0), (n % i - k + 1));
      |                    ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define __Mammamia__                ios_base :: sync_with_stdio(false);
#define ll                          long long
#define MAXN                        100007

int main()
{
    __Mammamia__

    ll n, k, res = 0; cin >> n >> k;

    if(!k){cout << n * n << endl; return 0;}

    for(ll i = 1; i <= N; ++i)
    {
        if(i > K)
        {
            res += ll(N/i)*(i-K) + max(ll(0), (N%i-K+1));
        }
    }
    cout << res << endl;
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: 'N' was not declared in this scope
   15 |     for(ll i = 1; i <= N; ++i)
      |                        ^
a.cc:17:16: error: 'K' was not declared in this scope
   17 |         if(i > K)
      |                ^
a.cc:4:37: error: expected primary-expression before 'long'
    4 | #define ll                          long long
      |                                     ^~~~
a.cc:19:20: note: in expansion of macro 'll'
   19 |             res += ll(N/i)*(i-K) + max(ll(0), (N%i-K+1));
      |                    ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long n,k,l = 0;
  cin >> n >> k;
  
  if (k == 0) {
    cout << n * n << endl;
    return 0;
  }
  
  for (long b = k + 1; b <= n; b++) {
    l += (b - k) * (n / b) + max(n % b - k + 1, 0);
  }
    
  cout << l << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long n,k,l = 0;
  cin >> n >> k;
  
  if (k == 0) {
    cout << n * n << endl;
    return 0;
  }
  
  for (int b = k + 1; b <= n; b++) {
    l += (b - k) * (n / b) + max(n % b - k + 1, 0);
  }
    
  cout << l << endl;
}

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

using namespace std;
 
int main() {
  int n,k,l = 0;
  cin >> n >> k;
  
  for (int b = k + 1; b <= n; b++) {
    int p = n / b, r = n % b;
    l += (b - k) * p + max(r - k + 1, 0);
  }
  if(k == 0){
    l -= n - k;
  }
    
  cout << l << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n >> k;
      |   ^~~
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:9:24: error: 'max' was not declared in this scope
    9 |     l += (b - k) * p + max(r - k + 1, 0);
      |                        ^~~
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << l << endl;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:16: error: 'endl' was not declared in this scope
   15 |   cout << l << 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<bits/stdc++.h>
using namespace std;
int main(){
    long long n,k;
    cin>>n>>k;
    n++;
    long long x=0;
    for(long long i=k+1;i<n;i++){
        x+=n/i*(i-k);
        x+=max(n%i-k,0);
    }
    if(k==0)x=(n-1)*(n-1);
    cout<<x<<endl;
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,k;
    cin>>n>>k;
    n++;
    long long x=0;
    for(int i=k+1;i<n;i++){
        x+=n/i*(i-k);
        x+=max(n%i-k,0);
    }
    if(k==0)x=(n-1)*(n-1);
    cout<<x<<endl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD=1e9+7;

/* WA→解説
余りは1,2,3より0,1,2のほうが方針が立てやすそう
実装力
単にlong long使ってないからn/b*(b-k)のオーバーフロー？
*/
int main() {
  long long n,k;
  cin>>n>>k;
  if(k==0){
    cout<<n*n<<endl;
    return 0;
  }
  long long ans=0;
  for(long long b=k+1;b<=n;++b){
    ans+=n/b*(b-k);//bで割ったあまりが0,1,2,~b-1の周期が何回あるか
    ans+=max(0,n%b-k+1);
    //cout<<n/b*(b-k)<<" "<<max(0,n%b-k+1)<<endl;
  }
  cout<<ans<<endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
  cin>>N>>K;
  if(K==0)
    cout<<N*N<<endll;
  else{
  int ans=0;
  for(int b=K+1;b<=N;b++){
  int r=(N%b);
    int x=N/b;
    x--;
    int y=x*(b-K)+min(0,r-K+1);
    ans+=y;
  
  }cout<<ans<<endl;
    
  }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'endll' was not declared in this scope
    7 |     cout<<N*N<<endll;
      |                ^~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;

const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;
int main(){
    int n, k;
  cin >> n >> k;

  if(k == 0) {
    cout << n*n << endl;
    return 0;
  }

  int ans = 0;
  FOR(i, 1, n+1) {
    if(i-1 >= k) {
      ans += n/i*(i-k);
      ans += max(0LL, (n%i) - k + 1);
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:7: error: 'i' was not declared in this scope
   26 |   FOR(i, 1, n+1) {
      |       ^
a.cc:26:3: error: 'FOR' was not declared in this scope
   26 |   FOR(i, 1, n+1) {
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;


int main(){
    ll n, k;
    cin >> n >> k;
    ll ans = 0;
    if (k==0) {
        cout << n*n << endl;
        return 0;
    }
    for (ll i=k+1; i<=n; i++) {
        ll v = n/i;
        ll now = v*(i-k);
        v = n%i;
        if (v>0) {
            if (k==0) now += v;
            else now += max(0, v-k+1);
        }
        ans += now;
        //cout << now << endl;
    }
    
    
    
    
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:28: error: no matching function for call to 'max(int, ll)'
   26 |             else now += max(0, v-k+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: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:26:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   26 |             else now += max(0, v-k+1);
      |                         ~~~^~~~~~~~~~
/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:26:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   26 |             else now += max(0, v-k+1);
      |                         ~~~^~~~~~~~~~
Language: C++

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

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

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

#include <iostream>
#include <algorithm>

using namespace std;

int main(){
    long N, K;
    cin >> N >> K;
    long ans = 0;
    for(int b=K + 1; b <= N; b++){
        ans += (b - K) * ((N + 1) / b) + max(0, (N + 1) % b - K);
        if(K == 0) ans--;
    }    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:45: error: no matching function for call to 'max(int, long int)'
   11 |         ans += (b - K) * ((N + 1) / b) + max(0, (N + 1) % b - K);
      |                                          ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:11:45: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   11 |         ans += (b - K) * ((N + 1) / b) + max(0, (N + 1) % b - K);
      |                                          ~~~^~~~~~~~~~~~~~~~~~~~
/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,
                 from a.cc:2:
/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:11:45: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |         ans += (b - K) * ((N + 1) / b) + max(0, (N + 1) % b - K);
      |                                          ~~~^~~~~~~~~~~~~~~~~~~~
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 n,k;
  cin >>n >> k ;
  int ans==0 ;
  for(b=k+1 ;b<n+1 ;b++){
    int q=n%b ;
    int p=n/b ;
    if(q<k)
    ans +=p(b-k) ;
    else
    ans+=p(b-k)+q-k+1 ;
  }
cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: expected initializer before '==' token
   10 |   int ans==0 ;
      |          ^~
a.cc:11:7: error: 'b' was not declared in this scope
   11 |   for(b=k+1 ;b<n+1 ;b++){
      |       ^
a.cc:15:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |     ans +=p(b-k) ;
      |     ^~~
      |     abs
a.cc:15:16: error: 'p' cannot be used as a function
   15 |     ans +=p(b-k) ;
      |                ^
a.cc:17:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     ans+=p(b-k)+q-k+1 ;
      |     ^~~
      |     abs
a.cc:17:15: error: 'p' cannot be used as a function
   17 |     ans+=p(b-k)+q-k+1 ;
      |               ^
a.cc:19:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 | cout << ans << endl;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long n,k,ans;
int main(){
    cin>>n>>k;
    if(k==0) ans=n*n;
    else
    {
        for(int i=k+1;i<=n;i++)
        {
            ans+=(n/b)*(b-k);
            if(n%b>=k) ans+=n%b-k+1;
        }
    }
    cout<<ans;
    return 0;
}
//68871358
//76140264
//25446011
//200841159

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'b' was not declared in this scope
   11 |             ans+=(n/b)*(b-k);
      |                     ^
Language: Java

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        long cnt = 0;
        for(int b = k+1; b <= n; b++) {
        	int p = n / b;
    		
        	if(k == 0)
        		cnt += Math.max(b - k, 0) * p + Math.max((n % b) - k, 0);
        	else
        	    cnt += Math.max(b - k, 0) * p + Math.max((n % b) - k + 1, 0);
    	}
        System.out.println(cnt);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: 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 main() {
  long long n, k; cin >> n >> k;
  long long r = 0;
  if (k == 0) {
    cout << n * n << endl;
    return 0;
  }
  for (int b = k+1; b <= n; b++) {
    int cnt = b - k;
    int loop = n / b;
    r += loop * cnt;
    r += max(n % b - (k - 1), 0);
  }
  cout << r << endl;
}

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

typedef long long ll;
 
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const long long INF = 1000000007;
 
#define CLR(a) memset((a), 0 ,sizeof(a))
 
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
int main(void){
    ll N,K; cin >> N >> K;
    ll ans = 0;
    if(K == 0){
        cout << (ll)N*N << endl;
        return 0;
    }
    FOR(i,K+1,N+1){
        ans += (N+1)/i * (i-K);
        ans += max((ll)0,(N+1)%i - K);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:17:20: error: 'acos' was not declared in this scope
   17 | const double PI  = acos(-1.0);
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:29:13: error: 'cin' was not declared in this scope
   29 |     ll N,K; cin >> N >> K;
      |             ^~~
a.cc:32:9: error: 'cout' was not declared in this scope
   32 |         cout << (ll)N*N << endl;
      |         ^~~~
a.cc:32:28: error: 'endl' was not declared in this scope
   32 |         cout << (ll)N*N << endl;
      |                            ^~~~
a.cc:37:16: error: 'max' was not declared in this scope
   37 |         ans += max((ll)0,(N+1)%i - K);
      |                ^~~
a.cc:39:5: error: 'cout' was not declared in this scope
   39 |     cout << ans << endl;
      |     ^~~~
a.cc:39:20: error: 'endl' was not declared in this scope
   39 |     cout << ans << endl;
      |                    ^~~~
Language: C++

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

int main(){
    long long int n, k;
    cin >> n >> k;
    // a % b >= k
    // --> k+1 <= a, b <= n

    if(k == 0){
        cout << n * n << endl;
        return 0;
    }

    long long int count = 0;
    for(int b=k+1; b<=n; b++){
        // 0 * b + k  ~  0 * b + (b-1)
        // 1 * b + k  ~  1 * b + (b-1)
        // ...
        // n/b * b + k  ~  n
        count += n/b * ((b - 1) - k + 1) + max((n - (n/b * b + k) + 1),0);
    }
    cout << count << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:47: error: no matching function for call to 'max(long long int, int)'
   21 |         count += n/b * ((b - 1) - k + 1) + max((n - (n/b * b + k) + 1),0);
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:21:47: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   21 |         count += n/b * ((b - 1) - k + 1) + max((n - (n/b * b + k) + 1),0);
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:21:47: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |         count += n/b * ((b - 1) - k + 1) + max((n - (n/b * b + k) + 1),0);
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <numeric>
typedef long long int ll;
using namespace std;
int main(){ 
	ll N,K,num,num1,count=0;
	cin >> N>>K;
	if(K==0){
		cout<<N*N<<endl;
		return 0;
	}
	for(int i=1;i<=N;i++){
		count+=max(0,(i-K))*(N/i);
		if(N%i==0) continue;
		else if(N%i>=K){
			count+=N%i-K+1;
		}
	}
	cout<< count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: no matching function for call to 'max(int, ll)'
   18 |                 count+=max(0,(i-K))*(N/i);
      |                        ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:18:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   18 |                 count+=max(0,(i-K))*(N/i);
      |                        ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/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:18:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |                 count+=max(0,(i-K))*(N/i);
      |                        ~~~^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int N,K; cin>>N>>K;
  int ans=0;
  REP(a,K,N){
    REP(b,K+1,N){
      if(a%n>=K)
        ans++;
      }
    }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 'n' was not declared in this scope
   19 |       if(a%n>=K)
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
#define OUT(n) cout << (n) << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

int main(void)
{
    IOS
    ll n, k;
    cin >> n >> k;

    ll ans = 0;
    if (k == 0) ans = n*n;
    else FOR(i,k+1,n+1) ans += n/i * (i-k) + max(0,(n-n/i*i-k+1));

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:49: error: no matching function for call to 'max(int, ll)'
   23 |     else FOR(i,k+1,n+1) ans += n/i * (i-k) + max(0,(n-n/i*i-k+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: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:23:49: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   23 |     else FOR(i,k+1,n+1) ans += n/i * (i-k) + max(0,(n-n/i*i-k+1));
      |                                              ~~~^~~~~~~~~~~~~~~~~
/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:23:49: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |     else FOR(i,k+1,n+1) ans += n/i * (i-k) + max(0,(n-n/i*i-k+1));
      |                                              ~~~^~~~~~~~~~~~~~~~~