Language: C++

#include <string>
#include <vector>
#include <array>
#include <memory>
#include <iostream>
#include <algorithm>
long long int memo[100][100];
int main(void) {
	//boost::shared_ptr<vector<string>>  log(boost::make_shared<vector<string>>());
	//log->push_back("dd");
	//log->push_back("dde");
	//boost::shared_ptr<vector<string>>  blog(boost::make_shared<vector<string>>());
	//blog->push_back("fsdfsdfd");
	//OpChara a(3,log);
	//OpChara b(2,log);
	//OpChara c(1, log);
	//log->push_back("dde3");
	//std::ofstream ofs("output1.txt");
	//assert(ofs);
	//boost::archive::text_oarchive oa(ofs);
	//oa << (a);
	//ofs.close();
	//std::ofstream cofs("output2.txt");
	//assert(cofs);
	//boost::archive::text_oarchive coa(cofs);
	//coa << (b);
	//cofs.close();

	//// de-serialize
	//std::ifstream ifs("output1.txt");
	//assert(ifs);
	//boost::archive::text_iarchive ia(ifs);

	//ia >> (b);
	//
	//ifs.close();
	//std::ifstream cifs("output2.txt");
	//assert(cifs);
	//boost::archive::text_iarchive iac(cifs);
	//iac >> c;
	//
	//// check
	//b.actionlog->push_back("111");

	/*int n, m;
	cin >> n >> m;
	vector<vector<tyu>> Pots;
	for (int i = 0; i < n; ++i) {
		Pots.push_back(vector<tyu>());
		int k;
		cin >> k;
		for (int j = 0; j < k; ++j) {
			int s,h;
			cin >> s >> h;
			Pots[i].push_back({ s,h });
		}
	}
	double ans=0;
	while (1) {

	
		vector<memo> amemo;
		for (int i = 0; i < n; ++i) {
			double h = 0;
			int taiseki = 0;
			for (int j = 0; j < Pots[i].size(); ++j) {
				bool flag = false;
				if (m > taiseki+ Pots[i][j].height*Pots[i][j].wide) {
					h += Pots[i][j].height;
					taiseki += Pots[i][j].height*Pots[i][j].wide;
				}
				else {
					flag = true;
					h += (double(m - taiseki)) / Pots[i][j].wide;
					taiseki = m;
				}
				const double akouritu = double(taiseki) / h;
				amemo.push_back({ akouritu, i, h,j,taiseki });
				if (flag) { break; }
			}
		}
		sort(amemo.begin(), amemo.end(), [](const memo m1, const memo m2) {return m1.kouritu < m2.kouritu; });
		bool flag=false;
		memo me = *amemo.begin();
		m -= me.taiseki;
		if (m < 0.0000000001) {
			flag = true;
		}
		ans += me.height;
		for (int i = 0; i < me.num + 1;++i) {
			Pots[me.id].erase(Pots[me.id].begin());
		}
		if (flag) {
			break;
		}
		
	}
	printf("%.10d", &ans);
	cout << ans;*/


	
	for (int i = 0; i < 100; ++i) {
		for (int j = 0; j < 100; ++j) {
			memo[i][j] = 999999999999999999;
		}
	}
	for (int i = 0; i < 100; ++i) {
		memo[1][i] = i;//x+1こ卵があるとき　e<=iならy回で割れる
		memo[i][2] = 2;//x+1こ卵があるとき　e<=iならy回で割れる
		memo[i][1] = 1;//x+1こ卵があるとき　e<=iならy回で割れる
		memo[i][0] = 0;//x+1こ卵があるとき　e<=iならy回で割れる
		memo[0][i] = 999999999999999999;//x+1こ卵があるとき　e<=iならy回で割れる
	}
	
	for (int i = 2; i < 50; ++i) {
		for (int j = 2; j < 50; ++j) {
			for (int k = 0; k < j-2; ++k) {
				memo[i][j] = min(memo[i][j], 1+max(memo[i][k], memo[i - 1][j-1-k]));
			}
		}
	}
	for (int i = 0; i < 100; ++i) {
		for (int j = 0; j < 100; ++j) {
			memo[i][j] = 999999999999999999;
		}
	}
	for (int i = 0; i < 100; ++i) {
		memo[1][i] = i;//x+1こ卵があるとき　e<=iならy回で割れる
		memo[i][1] = 1;//x+1こ卵があるとき　e<=iならy回で割れる
	}

	for (int i = 2; i <= 50; ++i) {
		for (int j = 2; j <= 50; ++j) {
				memo[i][j] = 1 + memo[i][j - 1] + memo[i - 1][j - 1];
			
		}
	}
	int tl;
	cin >> tl;
	for (int i = 0; i < tl; ++i) {
		int n;
		int e;
		cin >> n >> e;
		for (int j = 1; j < 51; ++j) {
			if (memo[e][j] >= n) {
				cout << j << endl;
				break;
			}
		}
	}
	
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:119:64: error: 'max' was not declared in this scope; did you mean 'std::max'?
  119 |                                 memo[i][j] = min(memo[i][j], 1+max(memo[i][k], memo[i - 1][j-1-k]));
      |                                                                ^~~
      |                                                                std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:119:46: error: 'min' was not declared in this scope; did you mean 'std::min'?
  119 |                                 memo[i][j] = min(memo[i][j], 1+max(memo[i][k], memo[i - 1][j-1-k]));
      |                                              ^~~
      |                                              std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:140:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
  140 |         cin >> tl;
      |         ^~~
      |         std::cin
In file included from a.cc:5:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:147:33: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
  147 |                                 cout << j << endl;
      |                                 ^~~~
      |                                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:147:46: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
  147 |                                 cout << j << endl;
      |                                              ^~~~
      |                                              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~