Bob and balls
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Recently Bob learned that balls can be played in a very entertaining game. In this game you want to stack the balls in the form of various geometric shapes. Just now Bob is engaged in laying the balls in the form of an equilateral triangle. But here's the thing: sometimes Bob do not have enough balls, and he wants to know, what is the greatest side of the triangle for which it is enough balls? Help Bob to count the value of — the length of equilateral triangle for given number of balls .
Below given the example of placing the balls in the form of an equilateral triangle:
Input
One positive integer — the existing number of balls.
Output
Print the value of — the answer to the problem.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 2K
Acceptance rate 44%