<?php
header("Content-Type: text/plain; charset=utf-8"); ?>
<?php
function getPyramid($n)
{
$x = 0;
$y = 0;
for ($i = 1; $y <= $n; $i++) {
$x += $i;
$y += $x;
}
if ($n <= $y) {
$i -= 2;
}
return $i;
}
echo getPyramid(84);
echo "\n";
echo getPyramid(3);
echo "\n";
echo getPyramid(5);
echo "\n";
echo getPyramid(14);
echo "\n";
echo getPyramid(23);
echo "\n";
PD9waHAKaGVhZGVyKCJDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9dXRmLTgiKTsKPz4gCjw/cGhwCgplcnJvcl9yZXBvcnRpbmcoLTEpOwptYl9pbnRlcm5hbF9lbmNvZGluZygndXRmLTgnKTsKCmZ1bmN0aW9uIGdldFB5cmFtaWQoJG4pCnsKICAgICR4ID0gMDsKICAgICR5ID0gMDsKICAgIGZvciAoJGkgPSAxOyAkeSA8PSAkbjsgJGkrKykgewogICAgICAgICR4ICs9ICRpOwogICAgICAgICR5ICs9ICR4OwogICAgICAgIAogICAgfQogICAgaWYgKCRuIDw9ICR5KSB7CiAgICAgICAgJGkgLT0gMjsKICAgIH0KICAgIHJldHVybiAkaTsKfQoKZWNobyBnZXRQeXJhbWlkKDg0KTsKZWNobyAiXG4iOwplY2hvIGdldFB5cmFtaWQoMyk7CmVjaG8gIlxuIjsKZWNobyBnZXRQeXJhbWlkKDUpOwplY2hvICJcbiI7CmVjaG8gZ2V0UHlyYW1pZCgxNCk7CmVjaG8gIlxuIjsKZWNobyBnZXRQeXJhbWlkKDIzKTsKZWNobyAiXG4iOw==