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

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

int main() {
  int64_t N,K,ans=0;
  cin>>N>>K;
  for(int b=K+1;b<N;b++){
    ans+=(b-K)*(N/b);
    ans+=min(N%b-K,0);
  }
  cout<<ans;
}


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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define int ll
int main(){
    ios::sync_with_stdio(false);
    int n,k;
    cin >> n >> k;
    if(n == 1) {
        if(k == 0) cout << 1 << endl;    
        else cout << 0 << endl;
        return 0;
    }
    int ans = 0;
    for(int b = k+1; b <=n; b++) {
        int q = (n-b+1)/b;
        ans+=(q+1)*((b-1)-k+1);
        if(k == 0) ans--;
        if((q+1)*b+k>n) continue;
        ans += n - (q+1)*b - k + 1;
    }
    cout << ans << endl;
}


Compiler output:
a.cc:7:13: error: '::main' must return 'int'
    7 | #define int ll
      |             ^~
a.cc:8:1: note: in expansion of macro 'int'
    8 | int main(){
      | ^~~
Language: C++

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

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

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

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define For(i, a, b) for(int i = (a); i < (b); ++i)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
typedef vector<long long> vlint;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<vector<long long>> vlint2;



int main() {
    lint n, k; cin >> n >> k;
    lint ans = 0;

    // a = y (mod b) の個数
    lint ans_mod_b;
    lint n_mod_b;
    For(b, k+1, n+1){
        n_mod_b = n%b;
        ans_mod_b = n/b;
        ans += ans_mod_b * (b - k);
        //端数
        ans += max(0, n_mod_b - k + 1);
    }
    if (k == 0){
        ans = n * n;
    }
    cout << ans << endl;

    


}



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

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

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

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,K; cin >> N >> K;
    if (!K){cout << N*N << '\n'; return 0;}
    ll ans=0;
    for (ll i=K+1;i<=N;++i){
        ans+=N/i*(i-K)+max(N%i-K+1,0);
    }
    cout << ans << '\n';
}

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

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

//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;

void setfspattern_core(int floor,int number,int degree){
  if(floor==degree){
    fspattern.at(fspcnt) = fspattern_draft;
    fspcnt++;
  }else{
    rep(i,number){
      fspattern_draft.at(floor) = i;
      setfspattern_core(floor+1,number,degree);
    }
  }
}

void setfspattern(int number,int degree){
  int64_t array_num = 1;
  rep(i,degree){
    array_num *= number;
  }
  fspattern = vector<vector<int>>(array_num,vector<int>(degree));
  fspattern_draft = vector<int>(degree);
  setfspattern_core(0,number,degree);
}

//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);

/*void setmodfact(){
  for(int i=0;i<factnum;i++){
    if(i == 0){
      modfact.at(i) = 1;
    }else{
      modfact.at(i) = (modfact.at(i-1)*i)%univMod;
    }
  }
}

int64_t calcmodpower(int64_t a,int64_t n){
  int64_t res = 1;
  while(n != 0){
    if(n & 1){
      res = (res * a) % univMod;
    }
    a = (a*a) % univMod;
    n = n >> 1;
  }
  return res;
}

int64_t calcinverse(int64_t n){
	return calcmodpower(n,univMod-2);
}

void setmodinvfact(){
  for(int i=0;i<factnum;i++){
    if(i==0){
      modinvfact.at(i) = 1;
    }else{
      modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
    }
  }
}

int64_t calcmodcomb(int64_t n,int64_t r){
  return (((modfact.at(n)*modinvfact.at(r))%univMod)*modinvfact.at(n-r))%univMod;
}

int64_t calcmodpositive(int64_t n){
  return (n + ((abs(n)+univMod-1)/univMod)*univMod)%univMod;
}
  
    */


/*
int64_t calcGCD(int64_t a,int64_t b){
	int64_t p = a;
	int64_t q = b;
	int64_t c = a%b;
	while(c != 0){
		p = q;
		q = c;
		c = p%q;
	}
	return q;
}
*/

int main(){
  int n,k;
  cin >> n >> k;
  int64_t sum = 0;
 for(int i=1;i <= n;i++){
   if(i < k+1){
     // through
   }else{
     sum += (((n+1) / i)*(i - k)) + max(0,((n+1) % i)-k);
     if(k == 0){
       sum--;
     }
   }
 }
  cout << sum << endl;
     
}

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

import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long K = sc.nextLong();
        long ans = 0;
        if(K==0) {
            System.out.println(N*N);
            return;
        }
        for(int i = K+1; i<=N; i++) {
            System.err.println((N)/i * (i-K) +" , "+ Math.max(N%i-(K-1), 0));
            ans += (N)/i * (i-K) + Math.max(N%i-(K-1), 0);
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from long to int
        for(int i = K+1; i<=N; i++) {
                     ^
1 error
Language: C++

#include<iostream>
using namespace std ;

int main()
{
  int N,K ;
  cin>>N>>K ;
  
  int count=0 ;
  for(int a=0;a<=K:a++){
    for(int b=0;b<=K;b++) if(a%b>=K) count++ ;
  }
  cout<<count<<endl ;
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   10 |   for(int a=0;a<=K:a++){
      |               ^
a.cc:10:19: error: found ':' in nested-name-specifier, expected '::'
   10 |   for(int a=0;a<=K:a++){
      |                   ^
      |                   ::
a.cc:10:18: error: 'K' is not a class, namespace, or enumeration
   10 |   for(int a=0;a<=K:a++){
      |                  ^
a.cc:14:3: error: expected primary-expression before 'return'
   14 |   return 0 ;
      |   ^~~~~~
a.cc:13:22: error: expected ')' before 'return'
   13 |   cout<<count<<endl ;
      |                      ^
      |                      )
   14 |   return 0 ;
      |   ~~~~~~              
a.cc:10:6: note: to match this '('
   10 |   for(int a=0;a<=K:a++){
      |      ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long k = sc.nextLong();
    long ans = 0;
    for(int j = k + 1; j <= n; j++) {
      long t = n / j;
      long r = n - t * j;
      long a = (j - k) * t + Math.max(0, r - k + 1);
      ans += a;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from long to int
    for(int j = k + 1; j <= n; j++) {
                  ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n,k;
  cin >> n >>k;
  long long ans ＝ 0;
  int cnt ＝ k+1;
  while(cnt<＝n){
      ans+＝(cnt-k)*((n+1)/cnt);
      ans+＝(n+1)%cnt-k;
      }
   cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: expected initializer before '\U0000ff1d'
    6 |   long long ans ＝ 0;
      |                 ^~
a.cc:7:11: error: expected initializer before '\U0000ff1d'
    7 |   int cnt ＝ k+1;
      |           ^~
a.cc:8:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
    8 |   while(cnt<＝n){
      |         ^~~
      |         int
a.cc:8:13: error: '\U0000ff1dn' was not declared in this scope
    8 |   while(cnt<＝n){
      |             ^~~
a.cc:9:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |       ans+＝(cnt-k)*((n+1)/cnt);
      |       ^~~
      |       abs
a.cc:9:11: error: '\U0000ff1d' was not declared in this scope
    9 |       ans+＝(cnt-k)*((n+1)/cnt);
      |           ^~
a.cc:12:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |    cout << ans << endl;
      |            ^~~
      |            abs
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define eee(a) (cerr << (#a) << ": " << (a) << endl);


using ll = long long;
using pint = pair<int, int>;
using mint = map<int, int>;

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

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 (b<a) { a=b; return 1; } return 0; }
template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    s << '[';
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len-1) s << ", ";
    }
    s << ']';
    return s;
}

struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);
    };
}fastio;

int main(){

    int n, k;
    cin >> n >> k;

    if(k == 0){
        ppp(a*a);
        return 0;
    }
    ll cnt = 0ll;
    for(int i = 1; i <= n; ++i){
        int q = n/i;
        int r = n%i;
        cnt += q*(max(0, i-k)) + max(0, r-k+1);
    }

    ppp(cnt);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:13: error: 'a' was not declared in this scope
   61 |         ppp(a*a);
      |             ^
Language: C++

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

signed main(){
	int n,k;cin>>n>>k;
	if(k==0)cout<<n*n<<endl,exit(0);
		int ans=0;
	for(int i=k+1;i<=n;i++){
		int m=n/i;
		ans+=m*(i-k)+max(0,n%i-k+1);
	}
	cout<<ans<<endl;
}


Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <bits/stdc++.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:11:33: error: no matching function for call to 'max(int, long long int)'
   11 |                 ans+=m*(i-k)+max(0,n%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:11:33: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   11 |                 ans+=m*(i-k)+max(0,n%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:11:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |                 ans+=m*(i-k)+max(0,n%i-k+1);
      |                              ~~~^~~~~~~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll ans=0;
      |   ^~
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     ans+=i-k;
      |     ^~~
      |     abs
a.cc:13:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<"!"<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,k;cin>>n>>k;
  ll ans=0;
  for(int i=k+1;i<=n;i++){
    ans+=a/i;
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: 'a' was not declared in this scope
   27 |     ans+=a/i;
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long N, K, sum;
int main() {
	cin >> N >> K;
	if (K == 0) {
		cout << N * N << endl;
		return 0;
	}
	for (int i = K + 1; i <= N; i++) {
		long long D = (N + 1) / i;
		long long E = D * (i - K);
		long long F = (N + 1) % i;
		long long G = max(0LL, F - K);
		sum += E + G;
	}
	cout << sum << endl;
	return 0;


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


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


int main(void)
{
	//変数の宣言
	
	int n,k;
	int temp=0;
	long int ans=0;
	int i,j,k;
	
	//データの読み込み
	scanf("%d %d",&n,&k);
	
	
//	printf("nは%dです\n", n);
//	printf("データの読み込み終了\n");
	//実際の処理
	
	for(i=1;i<n+1;i++){
		if(i>=k){
			temp=(i-k)*(n/i);
			if(n%i-k+1>0){
				if(k==0){
					temp=temp+n%i-k;
				}else{
					temp=temp+n%i-k+1;
				}
			}
//			printf("i=%d temp=%d\n",i,temp);
		}else{
			temp=0;
		}
		ans=ans+temp;
	}
	
	
//	printf("計算部分終了\n");
	
	//出力
	
	
	printf("%ld",ans);
	
	
//	printf("結果の出力終了\n");
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:17: error: redeclaration of 'k' with no linkage
   15 |         int i,j,k;
      |                 ^
main.c:12:15: note: previous declaration of 'k' with type 'int'
   12 |         int n,k;
      |               ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: 'i' was not declared in this scope
   15 |     ans += n/i*(i-k) + s;
      |              ^
Language: C++

#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#include "queue"
#include "functional"
#include "map"
#include "unordered_map"

#define lp(n) for (int i = 0; i < n; i++)
#define LP(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nya_n "(=^･ω･^=)"
typedef long long ll;
using namespace std;

ll n, k, cnt;

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

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

#include <iostream>
#include <vector>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <regex>

using namespace std;

using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using vvs = vector<vs>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define rFOR(i,a,b) for(int i=(b);i>=(a);i--)
#define SORT(a) sort((a).begin(),(a).end());
#define rSORT(a) sort((a).rbegin(),(a).rend());
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end());
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;

const ll MOD = 1e9+7;

//sankou
//vvi = vector<vector<int>>(20, vector<int>(10, 0));

//seiki
//#include <regex>
/*bubun*/
//regex_search("u32", regex("[0-9]"));      // true
/*kanzen*/
//regex_match("u32", regex("(i|u)\\d+"));   // true

int isP(int n) {
    if(n<=1) return 0;
    FOR(i,2,(int)sqrt(n)) {
        if(n%i==0) return 0;
    }
    return 1;
}

int main() {
javascript:void(0)
    int N,K,cnt=0,n;
    cin >>N>>K;
    
    FOR(b,K+1,N){
        n=N/b;
        cnt+=(b-K)*n;
        if(N-(b*n)>=K) cnt+=(N-(b*n)-K+1);
        if(K==0) cnt--;
    }
    cout <<cnt<<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:19: error: expected ';' before 'int'
   58 | javascript:void(0)
      |                   ^
      |                   ;
   59 |     int N,K,cnt=0,n;
      |     ~~~            
a.cc:60:11: error: 'N' was not declared in this scope; did you mean 'YN'?
   60 |     cin >>N>>K;
      |           ^
      |           YN
a.cc:60:14: error: 'K' was not declared in this scope
   60 |     cin >>N>>K;
      |              ^
a.cc:63:9: error: 'n' was not declared in this scope
   63 |         n=N/b;
      |         ^
a.cc:64:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   64 |         cnt+=(b-K)*n;
      |         ^~~
      |         int
a.cc:68:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   68 |     cout <<cnt<<endl;
      |            ^~~
      |            int
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

ll N, K;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N >> K;
  if (K == 0) {
    cout << N * N << endl;
    return 0;
  }
  ll ans = 0;
  for (int i = K + 1; i <= N; i++) {
    ans += N / i * (i - K) + max(0, N % i - K + 1);
  }
  cout << ans << endl;

  return 0;
}

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

#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define rrep(i,n) RFOR(i,n,0)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

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

	ll n, k;
	cin >> n >> k;

	ll ans = 0;
	for(ll b = k+1; b <= n; b++){
		ll q = n / b;
		ll r = n % b;

		ans += q * (b - k) + max(r - k + 1, 0);
	}

	if(k == 0) ans -= n;

	cout << ans << endl;
}

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

#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long int

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int N, K;
	cin >> N >> K;

	int ans = 0;
	if (K == 0) {
		cout << N * N << endl;
		return 0;
	}
	REP(b, K + 1, N) {
		int l = b - K;
		ans += l * (N / b);
		int tmp = max(0, N - (N / b) * b - K + 1);
		ans += tmp;
		// cout << ans << " " << l * (N / b) << " " << tmp << endl;
	}
	cout << ans << endl;

    return 0;
}


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

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

int n, k;

int main()
{
    scanf( "%d%d", &n, &k );
    
    if( k == 0 ) {
    	pritnf( "%lld\n", ll(n) * n ); return 0;
	}
    
    ll ans = 0;
    for( int i = k+1; i <= n; i ++ )
    {
        ans += ( n / i ) * ( i - k );
        int tmp = ( n % i ) - k + 1; 
        if( tmp > 0 ) ans += tmp;
    }

    printf( "%lld\n", ans );

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   12 |         pritnf( "%lld\n", ll(n) * n ); return 0;
      |         ^~~~~~
      |         printf
Language: Java

public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        
        if(k == 0) {
            System.out.print(n * n);
            return;
        }
        
        int sum = 0;
        for(int i = k + 1; i <= n; i++) {
            sum += (n / i) * (i - k);
            sum += Math.max(n%i-k+1, 0);
        }
        System.out.print(sum);
    }
}


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

import java.util.Scanner;

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

        int sum = 0;
        for(int i = k + 1; i <= n; i++) {
            sum += (n / i) * (i - k);
            sum += Math.max(n%i-k+1, 0);
        }
        System.out.print(sum);
    }
}


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

import java.util.Scanner;

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

        int sum = 0;
        for(int i = k + 1; i <= n; i++) {
            sum += (n / i) * (i - k);
            sum += Math.max(n%i-k+1, 0);
        }
    }
}

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

#include <bits/stdc++.h>
#define ll long long

using namespace  std;

ll n,k,res;

int main() {
    cin>>n>>k;
    if (k==0) cout<<n*n;
    else {
        for (int b=k+1;b<=n;b++) res+=1ll*(b-k)*(n/b) + max(n%b-k+1,0);
        cout<<res;
    }
}


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