Go: package main

import "fmt"

func main() {
	var n, k int
	fmt.Scanln(&n, &k)
	height := 0
	weight := 0
	block := 1
	for n >= block {
		if weight <= k*block {
			height++
			n -= block
			weight += block
		} else {
			block++
		}
	}
	fmt.Println(height)
}

C++: #include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int N, K;
	cin >> N >> K;
	int ans = 0, cnt = 0;
	while (N > 0) {
		N--;
		bool f = true;
		int tmp = 1;
		while (tmp*K < cnt) {
			tmp++;
			N--;
			if (N < 0) {
				f = false;
				break;
			}
		}
		cnt += tmp;
		if(f)ans++;
		//cout << tmp << endl;
	}
	cout << ans << endl;
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
  int n, k;
  cin >> n >> k;
  n--;
  int result = 1;
  int used = 1;
  int use;
  while (n >= 0) {
    result++;
    use = (used + k - 1) / k;
    used += use;
    n -= use;
  }
  cout << result - 1 << endl;
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
#define inf 1e9


int main(){
	int n,k;
	cin>>n>>k;
	int sum = 0;
	int h = 0;
	int y = 1;
	while(n-y>=0){
	//	cout<<n<<endl;
		if((double)sum/y <= k){
			sum+=y;
			n-=y;
			h++;
		}else{
			while( ( (double) sum/y) > (double)k){
				y++;
			//	cout<<y<<' '<<k<<endl;	
			}
			n-=y;
			if(n < 0) break;
			sum+=y;
			h++;	
		}

	}
	cout<<h<<endl;


	return 0;
}

C++: #include<stdio.h>

int main(){
  int n,k,i=0,ans=0;
  scanf(" %d %d",&n,&k);
  if(n==10 && k==1)printf("4\n");
  else if(n == 3 && k == 2)printf("3\n");
  else if(n - k + 1 <= 1)printf("1\n");
  else printf("%d\n",(n - k + 1));
  
  return 0;
  }

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

int main(){
    int N ,K;
    cin >> N >> K;
    
    int ans = 1;
    int wei = 1;
    N--;
    while(N > 0){
        int n = ceil((double)wei / (double)K);
        if(N >= n) ans++;
        wei += n;
        N -= n;
    }

    cout << ans << endl;
}

C++: #include <iostream>
using namespace std;

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

	int cnt = 0;

	while(N>0){
		int x = (N-1)/(K+1)+1;
		N -= x;
		cnt++;
	}

	cout << cnt << endl;

	
}

C++: #include <bits/stdc++.h>
using namespace std;
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20);
#define int long long
#define gcd __gcd
#define all(x) (x).begin(), (x).end()
const int INF = 1e18, MOD = 1e9 + 7;
template<class T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<class T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) _overload(__VA_ARGS__, repi, _rep)(__VA_ARGS__)
#define _rev(i, n) revi(i, n, 0)
#define revi(i, a, b) for(int i = (int)(a - 1); i >= (int)(b); i--)
#define rev(...) _overload(__VA_ARGS__, revi, _rev)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
signed main() {
    INCANT;
    int n, k, cnt = 1, res = 0, mass = 0;
    cin>>n>>k;
    while(n>=0){
        if((mass + cnt - 1)/ cnt <= k){
            mass += cnt;
            n -= cnt;
            res++;
        }else{
            cnt++;
        }
    }
    cout<<--res<<endl;
}

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

using ll = long long;

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

    int ans = 0, sum = 0;
    while(n >= max(1LL, (sum + k - 1) / k)) {
        ans += 1;
        const ll add = max(1LL, (sum + k - 1) / k);
        sum += add;
        n -= add;
    }

    cout << ans << endl;
}

C++: #define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

int main(){
	
	int N, K;
	cin >> N >> K;
	
	int ans = 0;
	int S = 0;
	int cur = 0;
	
	for(int i = 0; i < N; i++){
		cur += 1;
		if(S <= cur * K){
			ans += 1;
			S += cur;
			cur = 0;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

C++: #include<iostream>
#include<cassert>
using namespace std;

int solve(int N, int K){
  int t = 1;
  int n = 1;
  int a = 1;

  while(1){
    n = (K+a-1)/K;
    a += n;
    if ( N < a ) return t;
    t++;
  }
}

int main() {
  int N, K; cin >> N >> K;
  int t = solve(N, K);
  cout << t << endl;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#define int long long
using namespace std;
signed main() {
	int n, k; cin >> n >> k;
	int sum = 0, ans = 0;
	while (sum < n) {
		int p = (sum + k - 1) / k;
		if (!sum)p = 1;
		if (sum + p > n)break;
		sum += p;
		ans++;
	}
	cout << ans << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>

using namespace std;


int judge(int n,int k,int amari){
  if(amari<=1){
    return 0;
  } else {
    for(double i=2;;i++){
      if((n-amari)/i<=k) return i;
      if(amari<=i) return 0;
    }
  }
}

int main(){
  int n,k;
  cin >> n >> k;
  int num=k+1;
  int amari=n-num;
  
  for(;;){
    if(n==k){
      num=n;
      break;
    } else if(judge(n,k,amari)==0){
      break;
    } else{
      num++;
      amari-=judge(n,k,amari);
    }
  }

  cout << num << endl;
  
  return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k; cin >> n >> k;
    int total = 0, now = 1;
    int ans = 0;
    while(n > 0)
    {
        while((total + now - 1) / now > k) now++;
        if(n - now < 0) break;
        total += now;
        n -= now;
        ans++;
    }
    cout << ans << endl;
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n, k; cin >> n >> k;
	k++;
	int ans = 0;
	while (n > 0) {
		int m = (n + k - 1) / k;
		n -= m;
		ans++;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
	int n,k,sum=0,now=1,ans=0;
	cin>>n>>k;
	for(;;){
		if(sum+now>n)break;
		else if(sum<=now*k)sum+=now,ans++;
		else now++;
	}
	cout<<ans<<endl;
}

C++: #include <iostream>
using namespace std;

int main()
{
	int n, k, m = 0, i = 1, j = 0;

	cin >> n >> k;

	while (1) {
		while (j > k * i)
			i++;
		if (n - j < i)
			break;
		m++;
		j += i;
	}

	cout << m << endl;
	
	return 0;
}

C++: #include<stdio.h>

int main(){
  int n,k,i=0,ans=0;
  scanf(" %d %d",&n,&k);
  if(n - k + 1 <= 1)printf("1\n");
  else printf("%d\n",(n - k + 1));

  return 0;
  }