Problem:
 Score : 200 points    Problem Statement There is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0 .
During the period between time i-1 and time i , the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right.
That is, if his coordinate at time i-1 is x , he can be at coordinate x-i , x or x+i at time i .
The kangaroo's nest is at coordinate X , and he wants to travel to coordinate X as fast as possible.
Find the earliest possible time to reach coordinate X .      Constraints  X is an integer.  1≤X≤10^9         Input The input is given from Standard Input in the following format:  X       Output Print the earliest possible time for the kangaroo to reach coordinate X .        Sample Input 1 6      Sample Output 1 3  The kangaroo can reach his nest at time 3 by jumping to the right three times, which is the earliest possible time.       Sample Input 2 2      Sample Output 2 2  He can reach his nest at time 2 by staying at his position during the first second, and jumping to the right at the next second.       Sample Input 3 11      Sample Output 3 5

Solution (Python):
X = int(input())
N = int(1e+5)
n_sum = lambda n: n*(n+1)/2
ans = 0
for i in range(N):
    if X <= n_sum(i):
        ans = i
        break
print(ans)

Solution (Python):
x = int(input())
s = 0
for i in range(1, x+1):
    s += i
    if s >= x:
        print(i)
        break

Solution (Python):
x = int(input())
c = 0
i = 0
while x > c:
    i += 1
    c += i
print(i)

Solution (Python):
import itertools

x = int(input())
s = 0
for i in itertools.count(1):
  s += i
  if s >= x:
    print(i)
    break

Solution (Python):
x=int(input())
t=0
while True:
    if t*(t+1)//2 >=x:
        print(t)
        exit()
    else:
        t +=1

Solution (Python):





X = int(input().strip())
sum = 0
n = 1
while True:
    sum = sum + n
    if X <= sum:
        print(n)
        break

    n = n + 1

Solution (Python):
sum=0
X=int(input())
for i in range(1,X+1):
    sum+=i
    if sum>=X:
        print(i)
        break

Solution (Python):

X = int(input())


sum = 0
for i in range(1,X+1):
    sum += i
    
    if sum >= X:
        print(i)
        
        break

Solution (Python):
x = int(input())
cnt= 1
ans = 0
while True:
    tmp = cnt**2 + cnt
    if tmp >= 2*x:
        ans = cnt
        break
    cnt += 1
print(ans)

Solution (Python):
iX = int(input())
iK =  int((2*(iX)) ** 0.5)
for k in [iK,iK+1]:
    if k*(k-1) < iX *2 <= k*(k+1):
        print(k)
        exit()

Solution (Python):
from math import ceil
X = int(input())
print(ceil((-1+(1+8*X)**0.5)/2))

Solution (Python):
X = int(input())


for i in range(1, 10**5):
    if (1+i)/2 * i >= X:
        break
      
print(i)

Solution (Python):
a = int(input())
count = 0
j = 1
ar = []
while count < a:
    count += j
    ar.append(j)
    j += 1
print(ar[len(ar)-1])

Solution (Python):
X = int(input())
ans = []
def move(x, T):
    for i in range(T, 0, -1):
        if x >= i:
            x -= i
    if x == 0:
        return T
    else:
        return 50000

for i in range(1, 45000):
    ans.append(move(X, i))

print(min(ans))

Solution (Python):
X = int(input())

i = 1
x = 1
while(x <= X):
  x += i
  i += 1
  
print(i - 1)

Solution (Python):

X = int(input())

s = 1
i = 1
while s <= X:
    s += i
    i += 1
    

print(i-1)

Solution (Python):
x = int(input())
t = 1
s = 1

while s < x:
    s += t+1
    t += 1

print(t)

Solution (Python):
X = int(input())

t = 1
while True:
    if t*(t+1)//2 >= X:
        break
    else:
        t += 1
print(t)

Solution (Python):
x = int(input())
n = (2*x+0.25)**0.5-0.5
m = int(n)
if n > m:
  m += 1
print(m)

Solution (Python):
x=int(input())
for i in range(1,x+1):
    if i*(i+1)//2>=x:
        print(i)
        break

Solution (Python):
X = int(input())
t = 0

for n in range(X):
  t += 1
  if X <= (t * (t+1)) // 2:
    break

print(t)

Solution (Python):
import math
print(math.ceil((-1+((1+8*int(input()))**(1/2)))/2))

Solution (Python):
x = int(input())

t =0

for i in range(10**5):
	t += 1
	if x< (i*(i+1)//2)+1:
		break
print(t-1)

Solution (Python):
x = int(input())

c = 0
k = 1
while True:
    c += k
    if c >= x:
        break
    k += 1

print(k)

Solution (Python):
X = int( input())
now = 0
for i in range(10**5):
    if X*2 > i*(i+1):
        pass
    else:
        print(i)
        break

Solution (Python):
x = int(input())
ans = 0

while ans*(ans+1)//2 < x:
    ans += 1

print(ans)

Solution (Python):
x = int(input())
ans = 0

for i in range(1,x+1):
    if x > 0:
        ans += 1
        x -= i
    else:
        break

print(ans)

Solution (Python):
import math

X = int(input())
N = int(math.sqrt(2*X))
if N*(N+1) >= 2*X:
    N = N
else:
    N += 1
print(N)

Solution (Python):
x = int(input())
ans, temp, idx = 0, 0, 1
while temp <= x:
  temp += idx
  idx += 1
  ans += 1
  if temp >= x:
    break
print(ans)

Solution (Python):
X = int(input())
t = 1
max_t = (t* (t+1)) // 2



while max_t < X:
    
    t += 1 
    max_t = (t* (t+1)) // 2
    
print(t)

Solution (Python):
x=int(input())
t=0
while t*(t+1)/2<x:
    t+=1
print(t)

Solution (Python):
x = int(input())
long = 0
i = 0
while True:
    long += i
    if long >= x:
        print(i)
        break
    i += 1

Solution (Python):
x = int(input())
print(int(-(-(-1+(1+8*x)**.5)//2)))

Solution (Python):
x = int(input())

ans = 0
i = 0

while True:
    if ans >= x:
        print(i)
        break
    
    i += 1
    ans += i

Solution (Python):
X = int(input())
ans = 0
for i in range(X + 1):
    ans += i
    if ans >= X:
        break
print(i)

Solution (Python):
x=int(input())
for i in range(1,x+1):
    if i*(i+1)//2>=x:
        print(i)
        break

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    X = int(input())

    total = 0
    for i in count(1):
        total += i
        if total >= X:
            print(i)
            return


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
cou = 0
num = 0
while num < n:
  cou += 1
  num += cou
print(cou)

Solution (Python):
X = int(input())
flag = False
for i in range(100000):
  if (i*(i+1)//2 < X <= (i+1)*(i+2)//2):
    flag = True
    break
print(i+1)

Solution (Python):
def tria(n):
  return n * (n+1) // 2

X = int(input())

l = 0
r = int(1e9)

while l+1<r:
  mid = (l+r)//2
  if tria(mid) < X:
    l = mid
  else:
    r = mid
    
print(r)

Solution (Python):
x = int(input())
a = 0
for i in range(1, 10 ** 9):
    if a >= x:
        print(i - 1)
        break
    a += i

Solution (Python):
x = int(input())

a = []
num = 0
for i in range(1, 10**5):
    num += i
    a.append(num)

for i in range(len(a)):
    if a[i] >= x:
        print(i+1)
        break

Solution (Python):
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

from itertools import accumulate
from bisect import bisect_left

x = ni()
jump = [i for i in range(1,10**5)]
jump_cum = list(accumulate(jump))
print(bisect_left(jump_cum, x) + 1)

Solution (Python):
X = int(input())
now = 0
maxjump = 1
while now+maxjump < X:
    now += maxjump
    maxjump += 1
print(maxjump)

Solution (Python):

"""
Created on Sun Sep  2 11:49:26 2018
ABC056C
@author: maezawa
"""

x = int(input())

fib = [0]
i = 1
j = 0
while True:
    j = fib[i-1] + i
    fib.append(j)
    if j >= x:
        break
    i += 1
if x == 0:
    print(0)
else:
    print(i)

Solution (Python):
x=int(input())
a=0
for i in range(1,10**9):
    if a>=x:
        print(i-1)
        break
    a +=i

Solution (Python):
x=int(input())
n=int((2*x)**0.5)
if n*(n-1)<2*x<=n*(n+1):
    print(n)
elif (n-1)*(n-2)<2*x<=n*(n-1):
    print(n-1)
else:
    print(n+1)

Solution (Python):
import math
X=int(input())
ans=int(-(-((-1+math.sqrt(8*X+1))/2)//1))
print(ans)

Solution (Python):
X = int(input())

i = 0
while True:
    if i*(i+1)/2 >= X:
        print(i)
        break
    i += 1

Solution (Python):
n = int(input())
i = 1;
while(True):
    if((i ** 2 + i) // 2 >= n):
        break
    i += 1
print(i)

Solution (Python):
n = int(input())
ans = 0
x = 0
while(x < n):
    x += ans
    ans += 1
print(ans - 1)

Solution (Python):
import math
N = int(input())

M = int(math.sqrt(2 * N))

while 1:
    if M * (M + 1) / 2 < N:
        M = M + 1
    else:
        print(M)
        break

Solution (Python):
import math
print(math.ceil((math.sqrt(8*int(input())+1)-1)/2))

Solution (Python):
print(round((2*int(input()))**.5))

Solution (Python):
print(int((8*int(input())-7)**.5/2+.5))

Solution (Python):
import math
print(math.ceil((1+8*int(input()))**.5/2-.5))

Solution (Python):
a = int(input())
i = 1
j = 0
ans = 0
while True:
    ans += 1
    j += i
    i += 1
    if j >= a:
      print(ans)
      break

Solution (Python):


def main():
    x = int(input())

    i = 1
    j = 0
    ans = 0
    while True:
        ans += 1
        j += i
        i += 1
        if j >= x:
            print(ans)
            break



if __name__ == '__main__':
    main()

Solution (Python):
import math

x = int(input())

print(math.ceil(((8*x + 1) ** (1/2)) / 2 - (1/2)))

Solution (Python):
X = int(input())

ans = 0
a, i = 0, 1
while a < X:
    a += i
    i += 1
    ans += 1
print(ans)

Solution (Python):
x = int(input())
for i in range(100000):
    if x - i * (i + 1) // 2 <= 0:
        print(i)
        break

Solution (Python):
x = int(input())
ans = 0
cnt = 1
while x > 0:
    x -= cnt 
    cnt += 1
    ans += 1
print(ans)

Solution (Python):
n = int(input())

ans = 0
i = 1
while n > ans :
	ans += i
	i += 1

print i-1

Solution (Python):
v=0
e=1
n=int(input())
while 1:
  v+=e
  if n<=v:
    print(e)
    break
  e+=1

Solution (Python):
import math
x = int(input())

i = (2*x+1/4)**(1/2)-1/2
print(math.ceil(i))

Solution (Python):
x = int(input())

i = 1
ans = 0
while True:
    ans += i
    if ans >= x:
        print(i)
        break
    i += 1

Solution (Python):
N = int(input())
X = []
x = 1
i = 1
while x<10**9+1:
    X.append(x)
    i += 1
    x += i
X.append(x)
    
for i,x in enumerate(X):
    if x < N:
        continue
    else:
        print(i+1)
        break

Solution (Python):
X = int(input())
n=0

while(True):
    n += 1
    if n*(n + 1) // 2 >= X:
        print(n)
        break

Solution (Python):
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7

X = int(input())
N = int(math.sqrt(2*X))-1

while True:
	if N*(N+1)//2 >= X:
		print(N)
		break
	N += 1

Solution (Python):
x = int(input())

for i in range(1, x+1):
    if (i*(i+1)>=2*x):
        print(i)
        exit()

Solution (Python):


X = int(input())

sum1 = 0
i = 1
while True:
    sum1 += i
    if sum1 >= X:
        print(i)
        exit()
    i += 1

Solution (Python):
X = int(input())

t = 1
while True:
    if 0.5 * t * (t + 1) >= X:
        print(t)
        exit()
    t += 1

Solution (Python):
import math
x = int(input())
print(math.ceil(math.sqrt(2 * x + 0.25) - 0.5))

Solution (Python):
import math
X = int(input())
print(int(0.5 + math.sqrt(2 * X)))

Solution (Python):
X = int(raw_input())
for i in range(100000):
  if i*(i+1)//2 >= X:
    print i
    break

Solution (Python):

def main():
    x = int(input())

    ans = 0
    c = 0
    for i in range(1,100000000):
        ans+=1
        c +=i
        if c >= x:
            print(ans)
            exit()



if __name__ == "__main__":
        main()

Solution (Python):
n=int(input())

now=0
c=1

while now<n:
  now+=c
  c+=1
  
print(c-1)

Solution (Python):

X = int(input())

i = 1
while 2 * X > i * (i + 1):
    i += 1

print(i)

Solution (Python):
x = int(input())

pos = 0
i = 0
while x > pos:
    i += 1
    pos += i

print(i)

Solution (Python):
X = int(input())
i =0
while i*(i+1)//2<X:
  i += 1
print(i)

Solution (Python):
X = int(input())
ans = pow(10, 9)
for t in range(X + 1):
  if t*(t+1) / 2 >= X and t < ans:
    ans = t
    break
print(ans)

Solution (Python):
import math
print(math.ceil((math.sqrt(8*int(input())+1)-1)/2))

Solution (Python):
x=int(input())
for i in range(10**6):
    if i**2+i>=x*2:
        print(i)
        break

Solution (Python):
X = int(input())
i =0
while i*(i+1)//2<X:
  i += 1
print(i)

Solution (Python):
x = int(input())
 
for i in range(1, 10000000):
    x -= i
    if x <= 0:
        break
print(i)

Solution (Python):
X = int(input())

result = 0
for i in range(0, X):
    result += (i+1)
    if X <= result:
        print(i+1)
        break

Solution (Python):
X = int(input())

ls = [0]*100000
for i in range(1,100000):
    ls[i] = ls[i-1] + i 
    if X <= ls[i]:
        print(i)
        break

Solution (Python):
X = int(input())
memo = [0]*100000
for i in range(1,100000):
    memo[i] = memo[i-1] + i
    if memo[i] >= X:
        print(i)
        break

Solution (Python):
def m():
    x = int(input())
    i = 0
    while (i*(i+1)//2) <= x*2:
        if x <= (i*(i+1)//2):
            return i
        i+=1

print(m())

Solution (Python):
X = int(input())
ans = 1
mx = 1
while mx < X:
    ans += 1
    mx += ans
print(ans)

Solution (Python):
x=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*x))/2))

Solution (Python):
X = int(input())
lo = 1
hi = X
while hi - lo > 1:
    m = (hi+lo)//2
    if m*(m+1)//2 >= X:
        hi = m
    else:
        lo = m
if lo*(lo+1)//2 >= X:
    print(lo)
else:
    print(hi)

Solution (Python):
x = int(input())
s, i = 0, 0

while s < x:
    i += 1
    s += i

print(i)

Solution (Python):
x = int(input())
import math as m
print(m.ceil((-1 + m.sqrt(1 + 8 * x)) / 2))

Solution (Python):
x = int(input())
now = 0
t = 0
while now < abs(x):
    t += 1
    now = now + t
print(t)

Solution (Python):
X = int(input())

s = 0
t = 0
while True:
    t += 1
    s += t
    if s >= X:
        print(t)
        exit(0)

Solution (Python):
x = int(input())
i = 1

while True:
  if x <= 0:
    print(i-1)
    break
  
  x -= i
  i += 1

Solution (Python):
from math import sqrt
x = int(input())
a = int(sqrt(2*x))
if a * (a + 1) < 2 * x: a+=1
print(a)

Solution (Python):
m=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*m))/2))

Solution (Python):
N=int(input())
i=0
w=0
while i<N:
    w+=1
    i+=w
print(w)

Solution (Python):
x = int(input())

for i in range(1, 10000000):
    x -= i
    if x <= 0:
        break
print(i)

Solution (Python):
X = int(input())
ans = 0
d = 1
while d <= X:
    ans += 1
    d += ans
print(ans)

Solution (Python):
X = int(input())
maxX = 0
for i in range(1,X+1):
    maxX += i
    if maxX >= X:
        print(i)
        break

Solution (Python):





if __name__ == '__main__':
    x = int(input())

    i = 1
    pre = 0
    current = i

    while True:
        if pre < x <= current:
            print(i)
            exit()

        pre = current
        i += 1
        current += i

Solution (Python):
x=int(input())

i=1
while i*(i+1)/2<x:
    i+=1
print(i)

Solution (Python):
x = int(input())

n = int(x **.5)
while n*(n+1) < 2*x:
    n += 1
print(n)

Solution (Python):
x = int(input())
i = (-1+(1+8*x)**0.5)/2
if int(i) == i:
  print(int(i))
else:
  print(int(i)+1)

Solution (Python):
X=int(input())
cnt=1
ans=0
while True:
  ans+=cnt
  if ans >= X:
    break
  cnt+=1
print(cnt)

Solution (Python):
x=int(input())
tot,i=0,0
while tot<x:
    i+=1
    tot+=i
print(i)

Solution (Python):
x = int(input())
total = 0
t = 0
while total < x: 
    t += 1
    total += t
print(t)

Solution (Python):
def sum_naturals(n):
    return (n * (1 + n)) / 2

def jump(x):
    i = 0
    while x > sum_naturals(i):
        i += 1
    return i


if __name__ == '__main__':
    x = int(input())
    print(jump(x))

Solution (Python):
x = int(input())
i = 1
while i * (i + 1) // 2 < x: i += 1
print(i)

Solution (Python):
n = int(input())
num = 0
for i in range(n+1):
	num += i
	if n<=num:
		print(i)
		break

Solution (Python):
X = int(input())
j=0
for i in range(X*2):
    if (i*(i+1))//2<=X<=((i+1)*(i+2))//2:
        j=i
        break
print(j+1)

Solution (Python):
x=int(input())
t=1
while(1):
  if((t*(t+1))/2>=x):break
  t+=1
print(t)

Solution (Python):
x = int(input())

def foo():
    n = 0
    s = 0
    while True:
        n += 1
        s = s + n
        yield n, s

for n, s in foo():
    if s >= x:
        print(n)
        break

Solution (Python):
x=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*x))/2))

Solution (Python):
X = int(input())
 
i = 0
while i * (i + 1) / 2 < X:
    i += 1
 
print(i)

Solution (Python):
import math
n=int(input())
i=0
x=0
while 1:
  if n <= x:
    break
  i+=1
  x+=i

print(i)

Solution (Python):
x=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*x))/2))

Solution (Python):
x=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*x))/2))

Solution (Python):
n=int(input())
count,add=0,0
while True:
    if n<=count:
        break
    add+=1
    count+=add
print(add)

Solution (Python):
N = int(input())
ans = 0
for i in range(1, N+1):
   if i * (i + 1) // 2 >= N:
       ans = i
       break
print(ans)

Solution (Python):
X = int(input())
sum = 0
cnt = 1
while(True):
    sum += cnt
    if(sum >= X):
        break
    cnt += 1
print(cnt)

Solution (Python):
def solve():
    X = int(input())
    fibsum = 0
    cnt = 0
    while fibsum < X:
        cnt += 1
        fibsum += cnt
    print(cnt)
    
solve()

Solution (Python):
X = int(input())

sumval = 0
for i in range(1,X+1):
	sumval += i
	if sumval >= X:
		ans = i
		break

print(ans)

Solution (Python):
n=int(input())
count,add=0,0
while 1:
    if n<=count:
        break
    add+=1
    count+=add
print(add)

Solution (Python):
import math
def test(n):
    n=math.ceil((-1+math.sqrt(1+8*n))/2)
    return n
n=int(input())
print(test(n))

Solution (Python):
import math
def test(n):
    n=math.ceil((-1+math.sqrt(1+8*n))/2)
    return n
n=int(input())
print(test(n))

Solution (Python):
def c_GoHome(X):
    """
    1+2+...+n>=Xとなる最小のnがわかれば、時刻nで到達できる。
    (時刻iに右に跳ぶか、なにもしないかのどちらかを行う)
    左辺はn(n+1)/2なので、n^2+n-2X=0の正の解を切り上げたものが求める解である。
    よって、方程式を解いて、n_min=ceil( (-1+√(1+8X))/2 )を得られる。
    """
    import math
    n = math.ceil((-1 + math.sqrt(1 + 8 * X)) / 2)
    return n

X = int(input())
print(c_GoHome(X))

Solution (Python):
X = int(input())

sum = 0
for t in range(1, X+1):
    if t*(t+1)//2 >= X:
        print(t)
        exit()

Solution (Python):
num = int(input())

for i in range(45000):
    res = i * (i + 1) / 2
    if res >= num:
        print(i)
        break

Solution (Python):
n = int(input())
l = []

def f(n, l):
  sum = 0
  for i in range(1, n+1):
    sum += i
    if sum >= n:
      return i

print(f(n, l))

Solution (Python):
def limit():
    """
    i=44721

    全探索
    0 = [0]
    1 = [1,-1,0]と0の組合せ
    2 = [2,-2,0]と1の組合せ
    3**44721 => 無理
    """
    s = 0
    x = 10 ** 9
    for i in range(x):
        s += i
        if s >= x:
            print(i)
            break


def TLE(X):
    """
    11
    1 {0, 1, -1}
    2 {0, 1, 2, 3, -3, -1, -2}
    3 {0, 1, 2, 3, 4, 5, 6, -6, -5, -4, -3, -1, -2}
    4 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -10, -9, -8, -7, -6, -5, -4, -3, -1, -2}
    ans: 5
    """
    from itertools import product
    pos = set([0])
    for i in range(1, X + 1):
        for x, y in product(pos, (i, -i, 0)):
            if x + y == X:
                return i
            pos.add(x + y)
        print(i, pos)


def main():
    X = int(input())

    s = 0
    for i in range(1, X + 1):
        s += i
        if X <= s:
            print(i)
            break

if __name__ == '__main__':
    main()

Solution (Python):
N=input()
left=1
right=10**9

while left <= right:
	center = (left + right)/2
	x=(1+center)*center/2
	
	if x==N:
		print center
		break
	elif x<N and abs(N-x)<center+1:
		print center+1
		break
	elif x<N:
		left=center+1
	else:
		right=center-1
else:
	print center+1

Solution (Python):
X = int(input())

count, addition = 0, 0
while 1:
    if X <= count:
        break

    addition += 1
    count += addition

print(addition)

Solution (Python):
a = int(input())
i = 1
R = 0
while a > R:
 R = R+i
 i = i+1
print(i-1)

Solution (Python):
X = int(input())
i = 1
ans = 1
while X > ans:
    i += 1
    ans += i
print(i)

Solution (Python):
X = int(input())

for n in range(10000000):
  if X <= n*(n+1)//2:
    print(n)
    import sys
    sys.exit()

Solution (Python):
X = int(input())

t = 1

while X > t * (t + 1) / 2:
    t += 1
print(t)

Solution (Python):
p = int(input())
ii=0
for i in range(50000):
    ii+=i
    if ii>=p:
        print(i)
        break

Solution (Python):
print(int((1+(8*int(input())-7)**0.5)/2))

Solution (Python):
X = int(input())
i = 0
x = 0
while x < X:
    i += 1
    x += i
print(i)

Solution (Python):
import math

X = int(input())
print( math.ceil( (-1 + math.sqrt(1+8*X)) / 2) )

Solution (Python):
def main():
    x = int(input())
    for i in range(x+1):
        if i*(i+1)//2 >= x:
            print(i)
            break
    
    
if __name__ == "__main__":
    main()

Solution (Python):
x=int(input())
k=1
while True:
    if k*(k+1)<=2*x<(k+1)*(k+2):
        break
    k+=1
if x==k*(k+1)//2:
    print(k)
else:
    print(k+1)

Solution (Python):
a=input()
sum=0
time=0
while True:
    time+=1
    sum+=time
    if sum>=a:
        break
print time

Solution (Python):
x = int(input())
sum = 0
n = 1

while True:
    sum += n
    if sum >= x:
        print(n)
        break
    n += 1

Solution (Python):
N=int(input())
for i in range(1,N+1):
    if N <= i*(i+1)//2:
        print(i)
        exit()

Solution (Python):
X=int(input())
s=0
t=0
for i in range (X):
 s+=i+1
 t=i
 if s>=X:
  break
print(t+1)

Solution (Python):
n = int(input())
ans = 0
hoge = 0

while True:
  ans += 1
  hoge += ans
  if hoge >= n:
    break

print(ans)

Solution (Python):
from collections import defaultdict


def main():
    X = int(input())
    for i in range(0, X + 1):
        if (1 + i) * i // 2 >= X:
            print(i)
            return
    print(X)


if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
     
L = 0
for i in range(1, X+1) :
  L += i
  if L >= X :
    print(i)
    break

Solution (Python):
X = int(input())

sum = 0
time = 0
for i in range(X):
    sum += i+1
    time = i
    if sum >= X:
        break
print(time + 1)

Solution (Python):
x = int(input())
count = 1
while x > 0:
    x -= count
    if x <= 0:
        print(count)
    count += 1

Solution (Python):
X = int(input())
t = 0
for i in range(0, 15346906839456839):
    t += i
    
    if(t >= X):
        print(i)
        break

Solution (Python):

import math
import sys
import itertools
import numpy as np

n = int(input())

a = np.arange(100000)
print(np.where(a * (a + 1) // 2 >= n)[0][0])

Solution (Python):
import sys




def f(x):
    for n in range(0, 10 ** 9):
        s = n * (n + 1) / 2
        if s >= x:
            return n


def f2(x):
    a = 0
    b = 10 ** 5
    while b - a > 1:
        n = (a + b) // 2
        s = n * (n + 1) // 2
        if s >= x:
            b = n
        else:
            a = n
    return b

x = int(input())
print(f2(x))

Solution (Python):
X = int(input())

tmp = 0
res = 0
for i in range(1, X+1):
    if tmp >= X:
        break
    res = i
    tmp += i

print(res)

Solution (Python):
num = int(input())
i = 1
bef = 0
while True:
    bef += i-1
    aft = bef + i
    if bef < num <= aft:
        print(i)
        break
    i += 1

Solution (Python):
def solve():
  X = int(raw_input())
  i = maxx = 0
  while maxx < X:
    i += 1
    maxx += i
  return i

if __name__ == '__main__' :
  print solve()

Solution (Python):
def obj(t):
    return t**2 + t

import math
X = int(input())

s = 0
e = 2e9
m = math.floor((s + e) / 2.0)

while(True):
    if (obj(m) < (2 * X)):
        s = m
    else:
        e = m
    if ((e - s) <= 1):
        print(e)
        break
    m = math.floor((s + e) / 2.0)

Solution (Python):
if __name__ == "__main__":
    X = int(input())
    left = 0
    right = 10 ** 100
    while (right - left > 1):
        med = (right + left) // 2
        val = med * med + med - 2 * X
        if val >= 0:
            right = med
        else:
            left = med
    print (right)

Solution (Python):
x = int(input())

podition_range = 0
time = 0
i = 0

while True:
    if - podition_range <= x <= podition_range:
        print(time)
        break
    else:
        i += 1
        time += 1
        podition_range += time

Solution (Python):
X=int(input())
step=1
while X>0:
  X-=step
  if X<=0:
    print(step)
  step+=1

Solution (Python):
import math
print int(math.ceil((-1 + math.sqrt(1 + 8*int(raw_input()))) / 2))

Solution (Python):
X = int(input())

jump = 0
t = 0
while True:
    if X <= jump:
        print(t)
        exit()
    else:
        t += 1
        jump += t

Solution (Python):
import math
N = int(input())
k = int(math.sqrt(N))

sum = 0
ret = 0
for i in range(10 * k) :
    sum += i
    if sum >= N :
        ret = i
        break;
print(i)

Solution (Python):
import sys

def solve():
    x = int(input())

    k = 0

    while k * (k + 1) // 2 < x:
        k += 1

    print(k)
    
if __name__ == '__main__':
    solve()

Solution (Python):
import sys

X = int(input())

if X == 1:
	print(1)
elif X > 1:
	for i in range(2,1000000000):
		if X <= i*(i + 1)/2:
			t = i
			print(i)
			break

Solution (Python):


import sys
import os


X = int(input())

for t in range(1, 10**10):
    
    
    S = t * (t + 1) / 2
    if S >= X:
        print(t)
        break

Solution (Python):
X = int(input())
dismax = 0

for i in range(10**9):
	dismax += i
	if dismax >= X:
		break
print(i)

Solution (Python):

X = int(input())
i = 1
while i >0:
    if X <= i*(i+1)/2:
        print(i)
        break
    i += 1

Solution (Python):

X = int(input())
i = 1
while i >0:
    if X <= i*(i+1)/2:
        print(i)
        break
    i += 1

Solution (Python):
import math
X = int(input())

tmp = 10 ** 9 + 1

i =0
while i < tmp:
    tmp = (-1 + math.sqrt(8*X+1))/2
    if i >= tmp:
        break
    i += 1
    
print(i)

Solution (Python):
import sys

def solve(n):
    ans = 0

    for k in range(1, int(n*(n+1)/2)+1):
        left = k * (k-1) / 2
        right = k * (k + 1) / 2

        

        if (left < n) and (n <= right):
            ans = k
            break

    return ans


def main():
    n = int(sys.stdin.readline())
    ans = solve(n)
    print(ans)

    return 0

if __name__ == '__main__':
    sys.exit(main())

Solution (Python):



import math

X = int(input())
n = int((-1 + math.sqrt(1+8*X)) / 2)
sigma = 0.5 * n*(n+1)

if X != sigma:
    print(n+1)
else:
    print(n)

Solution (Python):
if __name__ == '__main__':
  X = int(input())
  sum = 0
  i = 0
  while sum < X:
    i += 1
    sum += i
  print(i)

Solution (Python):

X = int(raw_input())

ans = 10**8
lo, hi = 1, 10**10
while hi - lo >= 1:
    mi = (hi + lo)/2
    if X - mi <= (mi - 1)*mi/2:
        ans = min(ans, mi)
        hi = mi
    else:
        lo = mi + 1
print ans

Solution (Python):
if __name__ == "__main__":
    X = int(input())
    s = 0
    i = 0
    while True:
        s += i
        if s >= X:
            print(i)
            break
        i += 1

Solution (Python):
n = int(raw_input())
step = 1
pos = 0
while True:
    pos += step
    if pos >= n:
        break
    step += 1
print step

Solution (Python):
X = int(input())
a = 0
while X >0:
    a += 1
    X -= a
print (a)

Solution (Python):


X= int(raw_input())

a = 0
while X >0:
    a += 1
    X -= a
print a

Solution (Python):
import numpy as np
s = 1
X = input()
while X > s*(s+1)/2:
    s += 1
print s

Solution (Python):
s = 1
N = int(input())
while N > s*(s+1)/2:
    s += 1
print(s)

Solution (Python):
import numpy as np

x = int(input())
a = -0.5 + np.sqrt(0.25+2*x)
a = int(np.ceil(a))
print(a)

Solution (Python):
x = abs(int(input()))
total = 0
for i in range(x+1):
    total += i
    if total >= x:
        print(i)
        break

Solution (Python):

INF=10**10

def main():
   X=int(input())
   n=0
   while(True):
      S=n*(n+1)//2
      if S>=X:
          print(n)
          return 0
      n+=1
        
      
if __name__=="__main__":
    main()

Solution (Python):
X =int(input())
total = 0
for i in range(X+1) :
	total += i
	if total >= X :
		print(i)
		break

Solution (Python):



x = int(input())


total = 0
for i in range(x + 1):
    total += i
    if total >= x:
        print(i)
        break

Solution (Python):

X = int(input())
maxdist = 0
for i in range(1,X+1):
    maxdist = maxdist + i
    if maxdist > X:
        print("%d" % i)
        break
    elif maxdist == X:
        print("%d" % i)
        break

Solution (Python):
def main():
    X = int(input())
    ttl = 0
    for i in range(1, X + 1):
        ttl += i
        if X <= ttl:
            print(i)
            return

if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict



def arithmetic_series(a, d, n):
    return n * (2 * a + (n - 1) * d) // 2


def main():
    X = int(input())
    for i in range(10 ** 9):
        if X <= arithmetic_series(1, 1, i):
            print(i)
            return


if __name__ == '__main__':
    main()

Solution (Python):


x = int(input())

t = 0

while True:
    if t*(t+1)/2 >= x:
        print(t)
        break
    t += 1

Solution (Python):
import sys, array, re, functools
input = lambda: sys.stdin.readline()
@functools.lru_cache(maxsize = 10000)

def Main():
  x = int(input())
  lb = -1
  ub = 123456789
  
  while ub - lb > 1:
    mid  = (ub + lb)//2
    s = mid*(mid + 1)//2
    
    if s >= x:
      ub = mid
      
    else:
      lb = mid
  
  print(ub)
if __name__ == '__main__':
  Main()

Solution (Python):
import math

x = math.fabs(int(input()))

i = 0
s = 0

while s < x:
    i += 1
    s += i

print(i)

Solution (Python):
def calc(x):
	tmp = 0
	i = 1
	while True:
		tmp += i
		if tmp >= x:
			return i
		else:
			i += 1

x = int(raw_input())

print calc(x)

Solution (Python):
x=int(input())
total=0
for i in range(44722):
   total+=i
   if total>x-1:
       print(i)
       break

Solution (Python):
X = int(input())
k = 0
i = 0
while(k < X):
    i += 1
    k += i

print(i)

Solution (Python):
X = int(input())
s = 0
for t in range(10**9):
    if s >= X:
        print(t-1)
        break
    s += t

Solution (Python):
from math import sqrt, ceil
y = int(input())
print(ceil(sqrt(y * 2 + 0.25) - 0.5))

Solution (Python):
X = int(input())
t = 0
tsum = 0
tset = []
while X > tsum:
    t += 1
    tsum += t
    tset.append(t)
print(len(tset))

Solution (Python):
X = int(input())
step = 1

while X > 0:
    X -= step
    step += 1

print(step-1)

Solution (Python):
x = int(input())
i = 1

while x > 0:
    x -= i
    i += 1

print(i-1)

Solution (Python):
if __name__ == "__main__":
    a = int(input())
    left = 0
    right = 1 << 50
    while (right - left > 1):
        med = (right + left) // 2
        if (med * (med + 1) >= 2 * a):
            right = med
        else:
            left = med
    print (right)

Solution (Python):
N = int(input())
 
for i in range(1, N + 1):
    if N <= (i * (i + 1) / 2):
        print (str(i))
        break