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())
l = -1
r = 10**10
while r - l > 1:
    m = l + (r-l)//2
    if m*(m+1)//2 > X:
        r = m
    else:
        l = m
    
print(l if l*(l+1)//2 == X else r)

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

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

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

Solution (Python):
n=int(input())
tot=0
for i in range(n+1):
    tot+=i;
    if tot>=n:
        print(i)
        break

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

Solution (Python):
import sys

x = int(sys.stdin.readline().rstrip())

def main():
    n = int((x * 2) ** 0.5)
    res = n if (1 + n) * n // 2 >= x else n + 1
    print(res)

if __name__ ==  '__main__':
    main()

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

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

Solution (Python):




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

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

    print(t)


if __name__ == "__main__":
    main()

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

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

print(ans)

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

x = I()
i = 0
while 1:
    if i*(i+1)//2 >= x:
        print(i)
        quit()
    i += 1

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:
    return a
  return gcd_(a,a % b) 
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""


def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7
def main():
  x = int(input())
  
  ans = 0
  while ans*(ans+1)/2 < x:
    ans += 1
  print(ans)
  
if __name__ == '__main__':
  main()

Solution (Python):
import numpy as np

x = int(input())

numerator = (-1 + np.sqrt(1 + 8 * x))
t = int(numerator // 2)

if numerator % 2 == 0:
    print(t)
else:
    print(t + 1)

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

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

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
from functools import lru_cache
INF = 1 << 60
mod = 1000000007
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


x = int(input())
total = 0
ans = 0
while True:
    if total >= x:
        print(ans)
        break
    ans += 1
    total += ans

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

ok = 10**9 
ng = 0 
def bisearch(function, ok, ng):
    while abs(ok-ng) > 1:
        mid = (ok + ng)//2
        if function(mid):
            ok = mid
        else:
            ng = mid
    return ok

def check(mid):
    return mid*(mid+1)/2 >= X
    
print(bisearch(check, ok, ng))

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

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

Solution (Python):
import sys
x = int(input())
i = 1
while True:
    if i*(i+1)//2 >= x:
        print(i)
        sys.exit() 
    i += 1

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

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

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

print(n)

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

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

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

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

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

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

i=0
isum=0
while isum<x:
    i=i+1
    isum=isum+i

print(i)

Solution (Python):
import math

x = int(input())
x = abs(x)


a = math.ceil((2 * x) ** (0.5))
s = a * (a+1) // 2

while s >= x:
    a -= 1
    s = a * (a+1) // 2

print(a+1)

Solution (Python):
def resolve():

    X=int(input())
    cnt=1
    while True:
        val=cnt*(cnt+1)//2
        if val>=X:
            print(cnt)
            break
        else:
            cnt += 1


resolve()

Solution (Python):
x = int(input())
count = 0
for i in range(1, 10**5):
    x -= i
    count += 1
    if x <= 0:
        print(count)
        exit()

Solution (Python):
import math
X=abs(int(input()))
n=int(math.sqrt(2*X))
if(2*X>n*(n+1) and 2*X<=(n+1)*(n+2)):
  print(n+1)
else:
  print(n)

Solution (Python):
import math

X = int(input())
sqX = math.floor(X**(1/2))
temp = sqX**2
i = 0
while True:
    t = sqX + i
    temp = t*(t+1) // 2
    if temp >= X:
        print(sqX + i)
        break
    i += 1

Solution (Python):
x = int(input())
cnt = 0
total = 0

while x > total:
    cnt += 1
    total = int((1 + cnt) * (cnt/2))
    
print(cnt)

Solution (Python):
x=int(input())
ans=0
cnt=1
while 1:
    ans+=1
    x-=cnt
    if x<=0:
        print(ans)
        exit()
    else:
        cnt+=1

Solution (Python):

import math
import heapq
import bisect
import numpy as np
from collections import Counter, deque


X = int(input())
ans = 0
i = 1
while 1:
    ans += i
    if X <= ans:
        print(i)
        break
    i += 1

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

Solution (Python):
X = int(input())
a = [i for i in range(1, 10**5)]
import bisect
from collections import deque
s = deque([])
s.append(0)
i = 0
while s[i] < 10 ** 9:
    s.append(s[i] + a[i])
    i += 1

print(bisect.bisect_left(s, X))

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

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

if math.sqrt(8*X +1) == math.floor(math.sqrt(8*X +1)):
    print(int(t))
else:
    print(int(t)+1)

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

memo = 0

for i in range(1,n+1):
    memo += i
    if n <= memo:
        print(i)
        break

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

x = ni()

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

print(i)

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

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

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

total = 0
i = 0
while total < X:
    i += 1
    total += i
    
print(i)

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

Solution (Python):



X = int(input())


i = 0
sum_i = 0
while sum_i < abs(X):
    i += 1
    sum_i += i

print(i)

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

for t in range(1000000000):
    if 2 * x <= t * (t + 1):
        print(t)
        break

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

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


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

Solution (Python):
n=int(input())
t=a=1
while n>t: a+=1; t+=a
print(a)

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


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

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

if __name__ == '__main__':
    solve()

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

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

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

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

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

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

Solution (Python):
def main():
    x = int(input())
    k = int(x ** .5)

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


if __name__ == '__main__':
    main()

Solution (Python):

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

Solution (Python):
x=int(input())
for t in range(1,10**5+1):
  if t*(t-1)//2>=x:
    print(t-1)
    exit()

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

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

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

Solution (Python):
import numpy as np
x = abs(int(input()))




n = int(np.floor((2*x)**(1/2)))
m_cand = [n-1,n,n+1,n+2,n+3]


for i in m_cand:
    if (i*(i+1)<=2*x) & ((i+1)*(i+2)>2*x):
        m = i
        break
        
if m*(m+1)/2 == x:
    ans=m
else:
    ans = m+1
print(int(ans))

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

if x <0:
    x = -1 * x
i = 0
ans = 0
while True:
    ans += i
    if ans >=x:
        print(i)
        exit()
    i += 1

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

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

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

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

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

ans, loc = 0, 0

while loc < X:
    ans += 1
    loc = ans/2 * (ans+1)
print(ans)

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

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

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

if __name__ == '__main__':
    resolve()

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

cnt = 0
i = 1

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

print(i-1)

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

cnt = 0

for i in range(1, 100000000):
    cnt += i
    if cnt >= x:
        ans = i
        break

print(ans)

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

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

sum = i = 0
while sum < x:
    i += 1
    sum += i
print(i)

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

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

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

cnt = 0
for i in range(1, 10**10):
    cnt += i
    if x <= cnt:
        print(i)
        exit()

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

print(i)

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

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

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

Solution (Python):
if __name__ == "__main__":
    x = int(input())

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

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

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

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    X=I()
    temp=0
    for i in range(10**7):
        temp+=i
        if temp>=X:
            print(i)
            break

main()

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

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

    for i in count(start=1):
        if i * (i+1) / 2 >= n:
            yield i

print(next(main()))

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

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

    for i in range(n+1):
        if i * (i+1) / 2 >= n:
            yield i

print(next(main()))

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

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

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

main()

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

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

print(ans)

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

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

print(a)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

x = INT()
n = ceil(sqrt(2 * x))
k = inf
ans = 0
for i in range(max(0, n - 100), n + 100):
    tmp = x - i * (i + 1) // 2
    if k > tmp >= 0:
        ans = i
        k = tmp
if k > ans:
    ans += k * 2
elif k != 0:
    ans += 1
print(ans)

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

num=int((2*x)**0.5)-1
for i in range(3):
    if num*(num+1)>=2*x:
        print(num)
        exit()
    num+=1

Solution (Python):
def keisan(A,i):
	if i*(i+1)//2>=X:
		if i*(i-1)//2<X:
			return i
		else:
			return -2
	else:
		return -1

X=int(input())
ans=0
max=(10**9)
min=1
while(1):
	i=(max+min)//2
	if keisan(X,i)==i:
		print(i)
		exit()
	elif keisan(X,i)==-1:
		min=i
	elif keisan(X,i)==-2:
		max=i

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

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

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

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

time = 1
while True:
    if X <= time * (time + 1) // 2:
        print(time)
        exit()
    time += 1

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

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

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

    def is_ok(mid):
        if X <= mid*(mid+1)//2:
            return True
        else:
            return False

    def binary_search_meguru():
        ng = -1
        ok = 10**9 + 1
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search_meguru())


if __name__ == '__main__':
    main()

Solution (Python):
import sys

def solve():
    X = int(input())
    for i in range(1, 10**5):
        if i * (i + 1) // 2 >= X:
            minI = i
            break
    print(minI)
    return 0

if __name__ == "__main__":
    solve()

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

i, a = 0, 0
while a < X:
    i += 1
    a += i

print(i)

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

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

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

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

Solution (Python):
N=int(input())
i=1
buf=0
while True:
 if (buf<N) and (N<=buf+i):
  print(i)
  break
 else:
  buf=buf+i
  i=i+1

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

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

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

Solution (Python):
import math
n = int(input())
tmp = []
for i in range(1,44722):
  if i*(i+1)/2 >= n:
    tmp.append(i)
print(tmp[0])

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    X = I()
    if X == 1:
        print(1)
        return
    nsum = 1
    n = 0
    while nsum < X:
        n += 1
        nsum = (1 + n) * n //2 
    
    
    print(n)
main()

Solution (Python):


x = int(input())

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

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

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

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

Solution (Python):



target = int(input())

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

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

ans = 0

for i in range(1,10**9):
    ans += i
    if ans >= N:
        print(i)
        break

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

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

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

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

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

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

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

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

print(i)

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

Solution (Python):
X = int(input())
t = 0
while True:
    if X <= (t+1)*t /2:
        break
    t += 1
print(t)

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

p = 1
c = 1
while p <= x:
    p += c
    c += 1
print(c-1)

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

Solution (Python):


num = int(input().rstrip())

current = 0

ans = num
for i in range(num + 1):
    current += i
    if current >= num:
        ans = min(ans, i)
        break

print(ans)

Solution (Python):


X = int(input())

i = 1
ans = 0
while X > 0:
    X -= i
    ans += 1
    i += 1
print(ans)

Solution (Python):

X=int(input())

def bin_isOK(index,key):
    if index*(index+1)//2 >= key:
        return True
    else:
        return False


def binary_search(key):
    ng = -1
    ok = 10**9

    while abs(ok - ng) >1:
        mid = (ok + ng)//2

        if bin_isOK(mid,key):
            ok = mid
        else:
            ng = mid
    
    return ok

ans=binary_search(X)
print(ans)

Solution (Python):
x = int(input())
i = 1
while True:
    if 0.5*i*(i+1) >= x:
        break
    else:
        i += 1
print(i)

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

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

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

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

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

Solution (Python):
n = int(input())
c = 0
for i in range(300000):
    c += i
    if c >= n:
        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):
x = int(input())
cnt=0
cumsum=0
i=1
while True:
    cumsum+=i
    cnt+=1
    i+=1
    if x<=cumsum:
        break
print(cnt)

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

for i in range(1, x+1):
    now += i
    if 0 <= now-x <= i * (i-1)//2:
        print(i)
        break

Solution (Python):
import sys
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x = int(readline())
i = 0
res = 0
while x > res:
    res += i
    i += 1

print(i-1)

Solution (Python):
from math import ceil, sqrt


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


if __name__ == '__main__':
    main()

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

Solution (Python):

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

Solution (Python):
x = int(input())
t = int((x * 2) ** 0.5)
min_d = int(t * 0.5 * (t + 1))
if min_d < x:
  print(t + 1)
else:
  print(t)

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

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

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

time=0
pos =0

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

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

Solution (Python):
n = int(input())
cnt = 0
p = 0
for i in range(n+1000):
    cnt += i
    if cnt >= n:
        p = i
        break
print(p)

Solution (Python):
import numpy as np
X = int(input())
arr = np.arange(1, 100000)
arr = arr * (arr + 1) / 2


ans = np.nonzero(arr >= X)[0].min() + 1
print(ans)

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

for i in range(1,10**9):
    
    if 0.5*i*(i+1) >= x:
        ans = i
        break
print(ans)

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

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

a = 0
ans = 0

for i in range(1, 10**9+1):
  a += i

  if a >= N:
    ans = i
    break

print(ans)

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

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

num=int((2*x)**0.5)-1
for i in range(3):
    if num*(num+1)>=2*x:
        print(num)
        exit()
    num+=1

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

Solution (Python):
n=int(input())
a=[1]
i=0
count=2
while(a[i]<n):
    a.append(a[i]+count)
    count+=1
    i+=1

print(count-1)

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

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

Solution (Python):
import bisect
x = int(input())
a = [0]
b = 1
while b <= 45000:
	c = b*(b+1)//2
	a.append(c)
	b += 1
d = bisect.bisect_left(a,x)
print (d)

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

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

def calc(n):
    a=(n*(n+1))//2
    a=int(a)
    return a
n=0
tmp=0
while(1):
    n+=1
    a=calc(n)
    if X<=a:
        ans=n
        print(ans)
        exit()

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

i = 0
sum = 0

while(1):
    i += 1
    sum += i
    if sum < x:
        continue
    else:
        break

print(i)

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

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

print(t)

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

Solution (Python):
from math import sqrt, floor

def solve(x):
    n = floor(sqrt(2 * x))
    return n if x <= n * (n + 1) // 2 else n + 1

_x = int(input())
print(solve(_x))

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    x=II()
    inf=10**9
    st=int(x**0.5)-1
    for i in range(st,inf):
        if(i+1)*i//2>=x:
            print(i)
            break

main()

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
a = int(n ** (1/2))
ans = 0

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

print(a)

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

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

j = 0
t = 0
while True:
  t += 1
  j = j + t
  if j >= n:
    break
    
print(t)