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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np

X = INT()
ans = 0
tmp = 0
for i in range(1, 45721):
	ans += i
	if ans == X:
		print(i)
		break
	elif X < ans:
		print(i)
		break

Solution (Python):
x = int(input())
time = 0
 
for i in range(1,10**10):
  time += i
  if time >= x:
    print(i)
    exit()

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

ans = (-1 + (1+8*X)**0.5)/2
print(math.ceil(ans))

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

total = 1
i = 1
while True:
  if total >= X:
    print(i)
    exit()
  else:
    i += 1
    total += i

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



if __name__ == "__main__":
    main()

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

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

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

for i in range(10 ** 9):
    if (i * (i + 1)) // 2 >= X:
        print(i)
        exit()

Solution (Python):

X =int(input())
for t in range(10**9):
    if t * (t+1)/2 >=X:
        print(t)
        exit()

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

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

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

Solution (Python):
n=int(input())
p=int(-0.5+(2*n+0.25)**0.5)
q=p*(p+1)//2
print(p if q==n else p+1)

Solution (Python):
import sys
X = int(input())
a = 0
if X <= 2:
    print(X)
else:
    for i in range(1,X):
        a += i
        if a >= X:
            print(i)
            sys.exit()

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

ans = 0
check = 0
for i in range(1, 10**7):
    ans += i
    check += 1
    if X <= ans:
        print(check)
        break

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

t=0
dis=0
while dis<x:
    t+=1
    dis+=t

print(t)

Solution (Python):
x=int(input())
tmp=0
for i in range(10**9):
    tmp+=i
    if x<=tmp:
        print(i)
        break

Solution (Python):
import math

X = int(input())

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

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

Solution (Python):
print(round((2*int(input()))**0.5))

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



ans = (-1+(8*x+1)**0.5)/2
ans = -(-ans//1)

print(int(ans))

Solution (Python):
import sys
import math

X = int(sys.stdin.readline().strip())


max_t = int(math.sqrt(2*X)) + 1

for i in range(max_t + 1):
    if i * (i+1) >= 2 * X:
        break

print(i)

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

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    x = ii()
    for i in range(x+1):
        if i * (i + 1) // 2 >= x:
            print(i)
            exit()


if __name__ == "__main__":
    main()

Solution (Python):
from itertools import accumulate

X = int(input())

csum = accumulate([i+1 for i in range(100000)])

for i,s in enumerate(csum):
    if s >= X:
        print(i+1)
        break

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    x=int(input())
    cnt=1
    while cnt*(1+cnt)//2<x:
        cnt+=1
    print(cnt)
resolve()

Solution (Python):
x=int(input())
r=10**9 
l=0
while r-l>1:
    mid=(r+l)//2 
    if x<=mid*(mid+1)//2:
        r=mid
    else:
        l=mid

print(r)

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

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

def Main(X):
    if X <= 2:
        return X
    ans = 0
    for i in range(1, X):
        ans += i
        if ans >= X:
            return i
    
print(Main(X))

Solution (Python):


X = int(input())
position = 0
count = 0
while position < X:
    count += 1
    position += count
print(count)

Solution (Python):


X = int(input())
position = 0
count = 0
while position < X:
    count += 1
    position += count
if position == X:
    print(count)
else:
    print(count )

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

cnt = 0
dist = 0

while X > dist:
    dist += (cnt + 1)
    cnt += 1
print(cnt)

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

Solution (Python):

def main():
    n = int(input())
    pos = 0
    count = 0
    while pos < n:
        count += 1
        pos += count
    print(count)


if __name__ == '__main__':
    main()

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

ans = 0
for i in range(1, x+1):
    ans = (i * (i+1)) / 2
    if ans >= x:
        print(i)
        break

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    s=0
    for i in range(10**7):
        s+=i
        if s>=X:
            print(i)
            exit()

if __name__ == '__main__':
    main()

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

a_i = 0
n = 1
while a_i < X:
    a_i = a_i + n
    ans = n
    n += 1

print(ans)

Solution (Python):
from math import sqrt
x = int(input())
t = 0
while t>=0:
  if 2*x <= t**2+t:
    print(t)
    break
  t += 1

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




tar = (-1 + (1 + 8 * x) ** 0.5) * 0.5
ans = math.ceil(tar)

print(ans)

Solution (Python):
import bisect
x = int(input())
A = [n*(n+1)//2 for n in range(10**5)]
 
print(bisect.bisect_left(A,x))

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

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

if (sqrt(1 + 8*x) - 1)%2 == 0:
    x_ = (sqrt(1 + 8*x) - 1)//2 
else:
    x_ = (sqrt(1 + 8*x) - 1)//2 +1

print(int(x_))

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

if (sqrt(1 + 8*x) - 1)%2 == 0:
    x_ = (sqrt(1 + 8*x) - 1)//2 
else:
    x_ = (sqrt(1 + 8*x) - 1)//2 +1

print(int(min(x, x_)))

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

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

Solution (Python):
import numpy as np
import bisect
X = int(input())
A = np.cumsum(range(1, 10 ** 5))
idx = bisect.bisect_left(A, X)
print(idx + 1)

Solution (Python):

import numpy as np
import bisect
X = int(input())
A = np.cumsum(range(1, 10 ** 5))
if np.any(A == X):
    print(A.tolist().index(X) + 1)
else:
    idx = bisect.bisect_left(A, X)
    print(idx + 1)

Solution (Python):
x = int(input())
t = 1
while 1:
    if x <= t*-~t//2:
        print(t)
        exit()
    t += 1

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

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

Solution (Python):


import numpy as np
import math
import sys
from collections import defaultdict
input = sys.stdin.readline
s= int(input())

ans = 0
for i in range(100000000):
    ans +=i
    if ans >= s:
        print(i)
        sys.exit()

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

Solution (Python):
"""
異なる数の足し算で
行ける最大の距離を一秒ずつ算出し，こした時がその値
つまり，そこまでの内で一つを除けば辿りつくはず

数列の和を求めていく
"""

X = int(input())
count = 0
ans = 0
for i in range(1,X+1):
    count += i
    ans += 1
    if count >= X:
        print(ans)
        exit()

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

distance = 0
count = 0

i = 1
while distance < x:
    distance += i
    count += 1
    i += 1

print(count)

Solution (Python):
from itertools import accumulate
from math import pow

X = int(input())

for t, max_d in enumerate(accumulate(range(int(pow(10, 9))))):
    if max_d >= X:
        print(t)
        break

Solution (Python):
x = int(input())
for i in range(0,100000):
    ix = i*(i+1)/2
    if x <= ix :
        print(i)
        exit()
    else:
        pass

Solution (Python):

import collections
import itertools as it
import math

 

x  = int(input())






sum_ = 0
for i in range(x+1):
    sum_ += i

    if sum_ >= x:
        print(i)
        break

Solution (Python):


X = int(input())

ans = 0
for i in range(1, 10**9):
    ans += i
    if ans >= X:
        print(i)
        exit()

Solution (Python):

"""
Created on Wed May 13 14:22:58 2020

@author: shinba
"""

import bisect
x = int(input())
A = [n*(n+1)//2 for n in range(10**5)]

print(bisect.bisect_left(A,x))

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

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

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

Solution (Python):
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy





sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


tMOD = 998244353


def main():
    x = ni()

    cnt = 0
    total=0
    while total < x:
        cnt += 1
        total += cnt

    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
X = X if X > 0 else -X

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

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

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

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

Solution (Python):
x = int(input())
count = 0
ans = 0
for i in range(x+1):
    count+=i
    if count >= x:
        print(i)
        exit()

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

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

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

cnt = 0
for i in range(1, x+1):
  cnt += i
  if cnt >= x:
    print(i)
    quit()

Solution (Python):
X = int(input())
a = 0
i = 0

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

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

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

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

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

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

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

Solution (Python):
X=int(input())
ans=int((2*X)**(1/2))
while True:
  if (ans+1)*ans>=2*X:
    print(ans);exit()
  ans+=1

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

Solution (Python):
x=int(input())
v=0
for i in range(10**9):
    v+=i
    if v>=x:
        print(i)
        exit()

Solution (Python):

x = int(input())

l = 0
r = x
ans = float('inf')
while l <= r:
    mid = (l + r) // 2
    if (mid + 1) * mid // 2 >= x:
        ans = min(ans, mid)
        r = mid - 1
    else:
        l = mid + 1
print(ans)

Solution (Python):
n = int(open(0).read())
i = 0
while i*(i+1)//2 < n:
    i += 1
print(i)

Solution (Python):
X = int(input())
for n in range(10 ** 5):
    if (n - 1) * n // 2 < X <= n * (n + 1) // 2:
        print(n)
        break

Solution (Python):
X = int(input())
t = 0
i=1
nums = []
while t<X:
    t += i
    nums.append(i) 
    i += 1
ans = nums[-1]
print(ans)

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

Solution (Python):
X = int(input())
count = 0
if X == 1:
  ans = 1
else:
  for i in range(1,X+1):
    count += i
    if X - count <= i+1:
      ans = i+1
      break
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline


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

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


if __name__ == "__main__":
    main()

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7

x = int(input())
li = []
i = 1
while True:
    a = (1/2)*(i)*(i+1)
    if a>x:
        break
    li.append(int(a))
    i += 1
li.append((1/2)*(i+1)*(i+2))
if x == 1:
    print(1)
    sys.exit()
elif x == 2:
    print(2)
    sys.exit()
else:
    for i in range(len(li)-1):
        if x>li[i] and x<=li[i+1]:
            print(i+2)
            sys.exit()

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

ans = 0
for i in range(10**5):
    ans += i
    if ans >= x:
        print(i)
        exit()

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

    l = [int(x) for x in range(1, int(8*x**0.5+1)+3)]
    for i in range(len(l)):
        if l[i]*(l[i]+1)//2 >= x:
            return i+1


print(solve())

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

t = 0
while True:
    t += 1
    if t*(t+1) >=2*n:
        print(t)
        exit()

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7



def main():
    X = int(readline())
    X *=2
    i = 1
    while True:
        if i**2 + i >= X:
            print(i)
            break
        else:
            i += 1
if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
c = 0
plus = 1
while c < X:
    c += plus
    plus += 1
print(plus-1)

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

Solution (Python):
from math import factorial
X = int(input())
for i in range(1, 10**5):
    if X <= (i*(i+1))//2:
        print(i)
        break

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





left=0
right=x
while right-left>1:
  mid=(left+right)//2
  if (mid**2+mid)/2==x:
    right=mid
    break
  if (mid**2+mid)/2<x:
    left=mid
  else:
    right=mid
print(right)

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

Solution (Python):
x = int(input())
ok = 10**5
ng = 0
while abs(ok-ng)>1:
    mid = (ok+ng)//2
    if mid*(mid+1)//2>=x:
        ok = mid
    else:
        ng = mid
print(ok)

Solution (Python):
X = int(input())
a = 1
c = 1
while a < X:
    c += 1
    a += c
print(c)

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

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

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

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

Solution (Python):
x=int(input())
total=0
i=0
while total<abs(x):
  i+=1
  total+=i

print(i)

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

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

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

Solution (Python):
import math
def main():
    X = int(input())
    T = math.ceil((-1 + math.sqrt(8*X+1))/2)  
    print(T)
            
if __name__ == "__main__":
    main()

Solution (Python):
import math
def myAnswer(X:int) -> int:
   return
def modelAnswer(X:int) -> int:
   return math.ceil(((-1 + (8*X +1)**0.5)/2))
def main():
   X = int(input())
   print(modelAnswer(X))
if __name__ == '__main__':
   main()

Solution (Python):
import math

x = int(input())

num = 1

while num**2+num < 2*x:
    num += 1

print(num)

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

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

if n == 1:
  print(1)
  sys.exit()
l, r = 0, n*2
while r-l > 1:
  key = (r+l)//2
  if (key)*(key+1)//2 >= n:
    r = key
  else:
    l = key

print(r)

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

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

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

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

i = 1
koho_sum = i
while koho_sum < X:
    i += 1
    koho_sum += i
print(i)

Solution (Python):
def create_koho(X):
    koho = [1]
    koho_sum = 1
    i = 1
    while koho_sum < X:
        i += 1
        koho.append(i)
        koho_sum += i

    return koho


X = int(input())
koho = create_koho(X)
nokori = X
ans = 0
for i in reversed(koho):
    if nokori >= i:
        nokori -= i
        ans += 1

print(len(koho))

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

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

if '__main__' == __name__:
    resolve()

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

ans = 0
num = 1
tmp = 0
while tmp<X:
    tmp += num
    num += 1
    ans += 1

print(ans)

Solution (Python):
n = int(input())
count = 0
point = 0
width = 1
while True:
    count += 1
    point += width
    if point >= n:
        break
    width += 1
print(count)

Solution (Python):
from math import sqrt,ceil
x = int(input())
t = 1
while t*(t+1)//2<x:
    t += 1
print(t)

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

Solution (Python):
X = int(input())
t = 0 
sum_x = 0
while sum_x < X:
  t += 1
  sum_x += t 
print(t)

Solution (Python):
X = int(input())
ans = 0
dist = 1

while 1:
  ans += dist
  if ans >= X:
    break
  else:
    dist += 1
print(dist)

Solution (Python):
import sys

X = int(input())

t = 1
while t*(t+1)*0.5 < X:
    t = t + 1

print(t)

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

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

    
    


if __name__ == '__main__':
    main()

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

def calc(n):
    return n*(n+1)//2

for i in range(1,X+1):
    if calc(i)>=X:
        print(i)
        exit()

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

count = 1
num = 0
while True:
    num += count
    if x<=num:
        print(count)
        exit()
    else:
        count += 1

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

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

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

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

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

Solution (Python):
import sys
input=sys.stdin.readline
n = int(input())
num=0
for i in range(1,n+1):
    num+=i
    if num>=n:
        print(i)
        exit(0)

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

Solution (Python):
x = int(input())
cur = 0
for i in range(x+1):
    cur += i
    if cur >= x:
        print(i)
        exit()

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

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

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

Solution (Python):
x=int(input())
if x==1:
  print(1)
  exit(0)
for i in range(1,100001):
  t=i*(i+1)//2
  s=(i+1)*(i+2)//2
  if t<x<=s:
    print(i+1)
    exit(0)

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    X = int(input())
    sum = 0
    i = 1
    while sum <= 10**9:
        sum += i
        if sum >= X:
            print(i)
            exit()
        i += 1

if __name__ == '__main__':
  main()

Solution (Python):
from math import ceil, sqrt


def main():
    x = int(input())
    print(ceil((-1 + sqrt(1 + 8 * x)) / 2))


if __name__ == '__main__':
    main()

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

Solution (Python):
x=int(input())
ans=0
for i in range(1000000000):
  ans+=i
  if ans>=x:
    print(i)
    exit()

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

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

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

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

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

t=0
a=0
while a<x:
  t+=1
  a+=t

print(t)

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


def main():
    x = int(input())
    total = 0
    i = 1
    cnt = 0
    while total < x:
        total += i
        i += 1
        cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  


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

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

a = 1
now = 0
while True:
    now += a
    a += 1
    if now >= x:
        print(a - 1)
        exit()

Solution (Python):
n = int(input())
t = 1
tt = 1
ans = 1
while True:
    if n <= tt:
        print(ans)
        exit()
    else:
        t += 1
        tt += t
        ans += 1

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

n = math.ceil((-1+math.sqrt(1+8*X))/2)

print(n)

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

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

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

print(n)

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

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

Solution (Python):
x = int(input())
cou = 1
kyo = 0
while True:
    kyo += cou
    if kyo >= x:
        print(cou)
        exit()
    cou += 1

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

t=int(((-1+(8*x+1)**0.5)-10**(-10))/2)+1
print(t)

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

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

    
if __name__ == '__main__':
    main()

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

ans = 0
sum = 0
while sum < x:
    ans += 1
    sum += ans

print(ans)

Solution (Python):
x = int(input())
ans = 1
s = 1
while x >ans:
    s += 1
    ans += s
print(s)

Solution (Python):
X=int(input())
N=int(-0.5+(0.25+2*X)**0.5)

for k in range(N+2):
    if 0.5*N*(N-1)<X<=0.5*N*(N+1):
        print(N)
        break
    N+=1

'''
count=0
x=[[0]]
for k in range(0,1000000):
    if X in x[k]:
        print(k)
        break
    x.append(list(set(x[k])))
    for j in range(len(x[k])):
        x[k+1].append(x[k][j]+k+1)
        x[k+1].append(x[k][j]-k-1)
    x[k+1]=list(set(x[k+1]))
'''

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

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

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



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

if (n-1)*n < 2*x:
    print(n)
else:
    print(n-1)

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

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

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

Solution (Python):
def main():
    import sys
    x=int(input())
    cnt=0
    if x==1:
        print(1)
        sys.exit()
    if x==2:
        print(2)
        sys.exit()
    for i in range(1,x):
        if cnt<x:
            cnt+=i
        else:
            t=i-1
            break
    print(t)

if __name__=='__main__':
    main()

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(x+1):
    if (i*(i+1)) / 2 >= x:
        print(i)
        quit()

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

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

Solution (Python):
def main():
  X = int(input())
  i = 1
  while True:
    if X <= i * (i + 1) // 2:
      print(i)
      break
    i += 1
  return

if __name__ == '__main__':
  main()

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

ans = 0
time = 0

while ans < x:
    time += 1
    ans += time

print(time)

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

Solution (Python):
import sys
n = int(input())
tmp = 0
INF = 10*11
for i in range(1,1000000000):
    if (1+i)*i//2 >=n:
        print(i)
        sys.exit()

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

Solution (Python):
n = int(input())
tmp = 0
num_list = []
for i in range(1,10**9):
    if tmp < 10**9:
        tmp += i
        num_list.append(tmp)
    else:
        break
for i in range(len(num_list)):
    if num_list[i] >= n:
        print(i+1)
        break

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

cnt = 0
i = 0
while True:
    i += 1
    cnt += i
    if cnt >= N:
        print(i)
        break

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

Solution (Python):
n = int(input())
i = 0
d = 0
while True:
    i += 1
    d += i
    if d >= n:
        break

print(i)

Solution (Python):
data=int(input())
count=0
i=1
while(count<data):
    count+=i
    i+=1
print(i-1)

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

t = 0
i = 1
while True:
    t += i
    if t >= X:
        print(i)
        break
    else:
        i += 1

Solution (Python):
X = int(input())
cnt = 0
for i in range(0, 10 ** 9 + 1):
    cnt += i
    if cnt >= X:
        ans = i
        break

print(ans)

Solution (Python):
def slove(x):
    t = 1
    ans = t
    while ans <x:
        t += 1
        ans += t
    return t
if __name__ == "__main__":
    x = int(input())
    print(slove(x))

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

x = int(read())
cnt = 0
for i in range(45000):
    cnt += i
    if cnt >= x:
        print(i)
        exit()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

import itertools

x = int(read())
cumsum = list(itertools.accumulate([i for i in range(45000)]))
for i in range(45000):
    if cumsum[i] >= x:
        print(i)
        exit()

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

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

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

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

print(t)

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

n=1

while (n*(n-1)>=2*X) or (2*X > n*(n+1)):
  if (n*(n-1)< 2*X) and (2*X <= n*(n+1)):
    break
  n+=1

print(n)

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())
i = 1
while True:
    if i * (i + 1) >= 2 * X:
        break
    else:
        i += 1

print(i)