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)
}

Python: import math
n, k = map(int, input().split())
ret = 1
acc = 1
while True:
    want = math.ceil(acc / k)
    if(want+acc > n):
        break
    acc += want
    ret += 1
print(ret)

Python: n,k = map(int,input().split())

ans = 0
d,s = 1,0
while True:
    # s/d <= k
    # s <= d*k
    while d*k < s:
        d += 1
    if s+d > n:
        break
    s += d
    ans += 1

print(ans)

Python: n, k = map(int, input().split())
weight = 1
rest = n - 1
layers = 1
while True:
  add = weight // k + bool(weight % k)
  if add <= rest:
    rest -= add
    weight += add
    layers += 1
  else:
    break
print(layers)

Python: N, K = (int(x) for x in input().split())

t = 1
r = N - 1
s = 1

while True:
    b = s // K + 1 if s % K else s // K
    if r >= b:
        r -= b
        s += b
        t += 1
    else:
        break

print(t)

Python: 
N,K = [int(i) for i in input().split()]

weight = 1
ans = 1
N -= 1

while N > 0:
    d = 0
    if weight % K == 0:
        d = weight // K
    else:
        d = weight // K + 1
    
    N -= d
    weight += d
    
    if N >= 0:
        ans += 1
        
print(ans)

Python: n,k = map(int, input().split())
res = 0
row = 1
w = 0
while n >= row :
    if row*k >= w :
        res += 1
        w += row
        n -= row
    elif n >= row+1 : row += 1
    else : break
print(res)

Python: N, K = map(int, input().split())
ans = 1
s = 1
N -= 1
while 1:
    m = (s+K-1) // K
    if N < m:
        break
    s += m; N -= m
    ans += 1
print(ans)

Python: n, k = map(int, input().split())
ans = 1
w = 1
while n-w>0:
    blw = (w+k-1)//k
    w += blw
    if n-w>=0: ans+=1
print(ans)

Python: N,K = map(int, input().split())
t = n = a = 1
while True:
    n = (K+a-1)//K
    a += n;
    if  N < a: break
    t += 1
print(t)

Python: N,K = map(int, input().split())
t = n = a = 1
while True:
    n = (K+a-1)/K
    a += n;
    if  N < a: break
    t += 1
print(t)

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
 int a,b;
cin>>a>>b;
int ans=a/b+1;
if(a%b!=0){++ans;}
cout<<ans<<endl;
}

C++: #include <bits/stdc++.h>

using namespace std;

int N, K;

int main() {
	int h, m;
	double rest;

	h = 1;
	cin >> N >> K;
	rest = N;
	while (true) {
		m = rest / (K + 1) * K;
		if (m == 0) {
			break;
		}
		++h;
		rest = m;
	}	
	cout << h << endl;

	return 0;
}

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

int main() {

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

    int res = 0;
    int row = 1;
    int w = 0;
    while ( n >= row ) {

	//	cout << w << " " << row << endl;
	
	if ( row*k >= w ) {
	    ++res;
	    w += row;
	    n -= row;
	}
	else if ( n >= row+1 ) ++row;
	else break;
    }
    
    cout << res << endl;
    
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    int ret = 1;
    int used = 1;
    while (true) {
        used += (used + k - 1) / k;
        if (used > n)break;
        ret++;
    }

    cout << ret << endl;
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a) = min((a), (b)))
#define chmax(a, b) ((a) = max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const double pi = acos(-1);
const double eps = 1e-10;

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

int main(){
    int n, k; cin>>n>>k;
    int ans = 0;
    int sum = 0;
    for(int i=0; i<n; i++){
        int cur = 1;
        bool valid = false;
        while(i < n){
            if((sum + (cur - 1)) / cur <= k){
                valid = true;
                break;
            }
            cur++;
            i++;
        }

        sum += cur;

        if(valid){
            ans++;
        }
    }

    cout << ans << endl;
}

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

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n, k;
    cin >> n >> k;
    int ans = 1;
    int weights = 1;
    n--;
    while (n > 0) {
        int cnt = 0;
        while (weights > cnt * k) {
            cnt++;
        }
        if (n >= cnt) {
            n -= cnt;
            weights += cnt;
            ans++;
        } else {
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

C++: // 2018/12/09 Tazoe

#include <iostream>
using namespace std;

int main()
{
	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;

	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
int main(){
  int towerh = 1,maxyoko,yoko=1,taikyu,taikyutemp,blockcnt = 1;
  scanf(" %d %d",&maxyoko,&taikyu);
  if(maxyoko == 1 && taikyu == 1){
    printf("1\n");
    return 0;
  }
  taikyutemp = taikyu;
  while(1){
    if(maxyoko + 1 == yoko)break;
    else if((blockcnt/yoko) > taikyutemp){
      yoko++;
      continue;
    }else{
      towerh++;
      taikyutemp -= (blockcnt / yoko);
      blockcnt += yoko;
    }
  }
  printf("%d\n",towerh);
  return 0;
  }

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

using std::vector;
using std::cin;
using std::cout;
using std::endl;

int main()
{
	int N, K, num = 0;  // N: ブロック個数、K: ブロック強度、num: 積み上げるブロック数
	vector<int> digit;
	cin >> N >> K;
	for (;;) {
		int n = 0;
		while (num > ++n * K);
		num += n;
		if (num > N) {
			break;
		}
		digit.push_back(n);
	}
	cout << digit.size() << endl;
	return 0;
}

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

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

	int remove = 0, count = 0;
	if( n <= k + 1 ) {
		cout << n << endl;
	} else {
		n -= k + 1;
		remove += k + 1;
		while( 1 ) {
			n -= ceil( static_cast<double>( remove ) / k );
			remove += ceil( static_cast<double>( remove ) / k );
			if( n < 0 ) {
				break;
			}
			count++;
		}

		cout << count + k + 1 << endl;

	}
}

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

long long N, K;

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

	long long ret = 1, cnt = 1;
	while (true) {
		long long nex = (ret + K - 1) / K;
		if (ret + nex > N) {
			cout << cnt << endl;
			return 0;
		}
		ret += nex;
		cnt++;
	}
	return 0;
}