CPP program to find optimal number of trials for k floors and 2 eggs .
#include <bits/stdc++.h> NEW_LINE using namespace std ; int twoEggDrop ( int k ) { return ceil ( ( -1.0 + sqrt ( 1 + 8 * k ) ) / 2.0 ) ; }