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())
s=0
c=0
while s<x:
	c+=1
	s+=c
print(c)

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

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

print(i)

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

Solution (Python):


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

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

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

n = 1
while True:
  if X > n*(n-1)//2 and X <= n*(n+1)//2:
    print(n)
    exit()
  else:
    n += 1

Solution (Python):

x = int(input())
t=0
move=0
while move < x:
    t+=1
    move+=t
print(t)

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

N, = map(int, input().split())

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

Solution (Python):

x = int(input())
for i in range(1, x + 1):
    if i * (i + 1) * 0.5 >= x:
        print(i)
        break

Solution (Python):

N = int(input())

count = 0
i = 0
buff = 0
a = []
ans = 0
while True:
    a.append(buff)
    if buff >= N:
        break
    i += 1
    buff += i
print(i)

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

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

print(i)

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

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

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

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

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

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



if n == X:
	print(i)
	exit()

if n - X < i:
	print(i)
	exit()

j, d = 0, []
while X < n:
	j += 1
	n -= j
	d += [abs(X - n)]



if 0 in d:
	print(i)
	exit()

l, r = d[-1], d[-2]
print(i + min(abs(l), abs(r)) + 1)

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

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

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

def main():
  n=I()
  c=1
  sm=1
  while True:
    if sm>=n:
      return c
    c+=1
    sm+=c

print(main())

Solution (Python):
import math
X = int(input())
a = int((2*X)**0.5)
if((a+1)*a//2<X):
    a+=1
print(a)

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

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

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

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

Solution (Python):




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

Solution (Python):
import sys

x = int(input())

for t in range(x+1):
    if int(t*(t+1)/2) >= x:
        print(t)
        sys.exit()

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

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

Solution (Python):
a = int(input())
time = 0
d = 0
while(1):
  if a <= d:
    print(time)
    break
  time += 1
  d += time

Solution (Python):

"""解答
1 + 2 + 3 + ... + t >= X
のとき、Xを満たす和を作れるので、このときのtが答え。

なぜなら、左辺の和がXを超えた場合、
・1を引く（t=1のときジャンプしない）
・2を引く（t=2のときジャンプしない）
・3を引く（t=3のときジャンプしない）
...
という風にできるから。

左辺は、和の公式で (1+t)*t/2 で求まる。
よって、
(1+t)*t/2 >= X
t^2 + t - 2X >= 0

2次方程式の解の公式より、
t = -1±√(1+4*2X)/2

計算量はO(1)
"""
import math

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

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

    print(t)
        

if __name__ == "__main__":
    solve()

Solution (Python):

"""解答
1 + 2 + 3 + ... + t >= X
のとき、Xを満たす和を作れるので、このときのtが答え。

なぜなら、左辺の和がXを超えた場合、
・1を引く（t=1のときジャンプしない）
・2を引く（t=2のときジャンプしない）
・3を引く（t=3のときジャンプしない）
...
という風にできるから。

左辺は、和の公式で (1+t)*t/2 で求まる。
よって、
(1+t)*t/2 >= X
t^2 + t - 2X >= 0

2次方程式の解の公式より、
t = -1±√(1+4*2X)/2

計算量はO(1)
"""
import math

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

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

    print(t)
        

if __name__ == "__main__":
    solve()

Solution (Python):



X = int(input())

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

Solution (Python):
X=int(input())
N=0
M=0
while M<X:
    N+=1
    M+=N
print(N)

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

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

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())
t=1
while x>0:
    x-=t
    t+=1
print(t-1)

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

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

print(n)

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

print(i)

Solution (Python):

"""
C - Go Home
https://atcoder.jp/contests/abc056/tasks/arc070_a

"""
import sys


def solve(X):
    def is_reachable(n):
        if ((1+n)*n)//2 >= X:
            return True
        return False

    ub, lb = 10**5, 0
    while ub - lb > 0:
        mid = (ub + lb) // 2
        if is_reachable(mid):
            ub = mid
        else:
            lb = mid + 1
    return ub


def main(args):
    X = int(input())
    ans = solve(X)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

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

print(i)

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math

mod = 10**9+7


X = int(input())
position = 0
cnt = 0
for i in range(1,mod):
    cnt += 1
    position += i
    if position >= abs(X):
        break

print(cnt)

Solution (Python):
X = int(input())
s = 0
for i in range(10**5):
    if s < X <= s + i:
        break
    s += i
print(i)

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

Solution (Python):
import bisect
a,i=[0],1
while a[-1]<10**9:
    a.append(i*(i+1)//2)
    i+=1
print(bisect.bisect_left(a,int(input())))

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

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

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

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

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

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

print(ans)

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

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

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

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

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

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

print(i)

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

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

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

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

Solution (Python):
X = int(input())
cnt = 0
for t in range(0, X+1):
    if t*(t+1)/2 >= X:
        break
    else:
        cnt += 1
print(cnt)

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

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

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

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

print(count)

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

Solution (Python):
def read_input():
    x = int(input())
    return x

def sumup(y):
    return y*(y+1)/2

def submit():
    x = read_input()

    for i in range(1, x + 1):
        if x <= sumup(i):
            print(i)
            break


if __name__ == '__main__':
    submit()

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

sum = 0
import sys
for i in range (1,10**5):
    sum += i
    if sum >= X:
        print(i)
        sys.exit()

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

Solution (Python):
import numpy
print(int(numpy.ceil((2*int(input())+1/4)**0.5-1/2)))

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

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

Solution (Python):


x = int(input())

def answer(x):
    for i in range(x):
        if(i*(i+1)//2 < x):
            continue
        else:
            return i

result = answer(x)

if(result == None):
    print(x)
else:
    print(answer(x))

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

k = 1
while True:
    if k*(k-1)/2 < X <= k*(k+1)/2:
        break
    k += 1

print(k)

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

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

print(tim)

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

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

check = 0
for i in range(int(1e5)):
    check += i
    if X <= check:
        ans = i
        break

print(ans)

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

c = 0
dist = 0

while dist < X:
    c += 1
    dist += c

print(c)

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

c = 0
dist = 0
while True:
    c += 1
    dist += c
    if dist >= X:
        break

print(c)

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

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

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

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

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

Solution (Python):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-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 pf(s): return print(s, flush=True)

N=_I()


def ans(n):
	return 1/2*n*(n-1)

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

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n= f()[0]
    ans = 0
    k = 1
    for i in range(1, int(1e5)):
        ans += i
        k = i
        if ans>= n:
            break
    print(k)

solve()

Solution (Python):
X = int(input())
c = 0
for i in range(1, 1000000000):
    c += i
    if c > X:
        print(i)
        exit()
    elif c == X:
        print(i)
        exit()

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

Solution (Python):
x = int(input())
count = 0
max_d = 0
jump = 1
while max_d < x:
    max_d += jump
    jump += 1
    count += 1
print(count)

Solution (Python):
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

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

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


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

Solution (Python):
n = int(input())
st = 1
pt = 1
if n == 1:
    print(1)
else:
    while st < n:
        st = pt * (pt+1)//2
        pt += 1
    print(pt-1)

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N = int(input())

    i = 1
    cnt = 0
    while cnt < N:
        cnt += i
        i += 1

    return i - 1


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

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    X = int(input().rstrip())
    i = 0
    sum = i
    while True:
        if X <= sum: 
            ans = i
            break
        else:
            i+=1
            sum += i

    print(ans)
    
if __name__ == '__main__':
    main()

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

left = 0    
right = X   
mid = X
while left + 1 < right:
    mid = (left + right) // 2
    if mid * (mid+1) // 2 >= X:
        right = mid
    else:
        left = mid
        mid += 1

print(mid)

Solution (Python):
X = int(input())
l = [(i+1)*i//2 for i in range(1,10**5)]
def bs_left(l, target): 
    low, high = 0, len(l)
    while low < high:
        mid = (low+high)//2
        if l[mid] < target:
            low = mid+1
        else:
            high = mid
    if low == len(l):
        return -1
    return low
id = bs_left(l,X)

print(id+1)

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

Solution (Python):


x = int(input())

length = 0
for i in range(10000000000):
    length += i
    if length >= x:
        print(i)
        break

Solution (Python):
X = int(input())
Flag = True
count = 0
ret = 0
while Flag:

    count += 1
    ret += count
    if ret >= X:
        print(count)
        Flag = False

Solution (Python):




X = int(input())
n = 0
c = 0
while True:
    if n >= X:
        break
    else:
        c += 1
        n += c

print(c)

Solution (Python):
def go_home(X: int) -> int:
    t = 1
    while t * (t + 1) // 2 < X:
        t += 1
    return t


if __name__ == "__main__":
    X = int(input())
    ans = go_home(X)
    print(ans)

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

Solution (Python):
Acsum=[]
acsum=0
for i in range(5*10**4):
  acsum+=i
  Acsum.append(acsum)
def binarysearch(x):
  ng=-1
  ok=5*10**4
  while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if Acsum[mid]>=x:
      ok=mid
    else:
      ng=mid
  return ok
n=abs(int(input()))
print(binarysearch(n))

Solution (Python):
Acsum=[]
acsum=0
for i in range(10**5):
  acsum+=i
  Acsum.append(acsum)
def binarysearch(x):
  ng=-1
  ok=10**5
  while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if Acsum[mid]>=x:
      ok=mid
    else:
      ng=mid
  return ok
n=int(input())
print(binarysearch(n))

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

for i in range(max(1, int(X**0.5)-1) ,X+1):
  
  if i*(i+1) >= 2*X:
    print(i)
    exit()

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

Solution (Python):
print(int((2*int(input())+1/4)**0.5+0.5-10**(-5)))

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

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

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

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

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

cnt=0

for i in range(1,10**8):
    cnt+=i
    if cnt>=x:
        print(i)
        break

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

Solution (Python):
import math
X=int(input())
for t in range(X+1):
    if t*(t+1)//2>=X:
        print(t)
        break

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

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

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

Solution (Python):


"""
Created on 2019/3/24
Solved on 2019/3/
@author: shinjisu
"""



def getInt(): return int(input())
def zeros(n): return [0]*n
def zeros2(n, m): return [zeros(m) for i in range(n)] 
class Debug():
    def __init__(self):
        self.debug = True
 
    def off(self):
        self.debug = False
 
    def dmp(self, x, cmt=''):
        if self.debug:
            if cmt != '':
                print(cmt, ':  ', end='')
            print(x)
        return x


def prob():
    d = Debug()
    d.off()
    X = getInt()
    d.dmp((X), 'X')
    sm = 0
    for i in range(1, 10**9+1):
        sm += i
        if X <= sm:
            break
    return i


ans = prob()
if ans is None:
    pass
elif type(ans) == tuple and ans[0] == 1:  
    for elm in ans[1]:
        print(elm)
else:
    print(ans)

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

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

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

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

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

Solution (Python):
def main():
    X = int(input())
    total = 0
    i = 0
    while total < abs(X):
        i += 1
        total += i
    print(i)


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):

X=int(input())
s=0
for i in range(10**5):
	if s>=X:
		print(i-1)
		break
	else:
		s+=i

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

ans = 0

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

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

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

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
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007






x = I()
a = 0
i = 1
while a < x:
    a += i
    i += 1
print(i-1)

Solution (Python):
X = int(input())
def f(i):
    return i*(i+1)/2

for i in range(1,10**1000000):
    if  f(i) >= X:
        print(i)
        break

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

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

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

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

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

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

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

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

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

Solution (Python):
ans = (int(input())*8 + 1)**0.5 - 1
if not ans.is_integer():
    ans += 2
print(int(ans//2))

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

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

Solution (Python):
y=int(input())*2
a=[x*(x+1) for x in range(100000) if x*(x+1)<y]
print(len(a))

Solution (Python):


















import collections
import math


x = int(input())

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

X = int(input())

ans = float('inf')
pos = 0
time = 0
while pos < X:
    time += 1
    pos = (time)*(time+1)//2

diff = pos - X
print(time)

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

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

Solution (Python):
x = int(input())
posi = 0
for n in range(1, 10**5):
    posi += n
    if x <= posi:
        print(n)
        break

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

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

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

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

Solution (Python):
x = int(input())
time = 0
leap = 0
while leap < x:
    time += 1
    leap += time
print(time)

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

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

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

time=0
Dear=0
while True:
    Dear+=time
    if Dear>=X:
        print(time)
        exit(0)
    time+=1

Solution (Python):
x = int(input())
leap = 0
time = 0
while leap < x:
    time += 1
    leap += time
print(time)

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

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


def solve(X):
    n = 1
    while True:
        if n*(n-1)//2 < X <= n*(n+1)//2:
            return n
        n += 1

print(solve(X))

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

Solution (Python):
a = int(input())
s = 0
if a < 3:print(a)
else:
    for i in range(1,a):

        s+=i
        if s-i < a <= s:
            print(i)
            break

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

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

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

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

print(i)

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())

t=1
k=0
i=0

while k==0:
    i+=t
    t+=1
    if i>=x:
        k=1

print(t-1)

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

Solution (Python):
X = int(input())
for i in range(1, 10**6):
    if X <= 0.5 * i * (i + 1):
        print(i)
        break

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

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

Solution (Python):
from sys import stderr, setrecursionlimit
from functools import reduce
from operator import add
from math import sqrt, ceil
setrecursionlimit(2147483647)
def f(): return [int(i) for i in input().split()]
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)


'''
n秒間で移動できる最大距離はn(n+1)/2

1 -> 1(r)
2 -> 2(n->r)
3 -> 2(r->r)
4 -> 3(l->r->r)
5 -> 3(n->r->r)
6 -> 3(r->r->r)
7 -> 4(n->n->r->r)
8 -> 4(r->n->r->r)
9 -> 4(n->r->r->r)
10 -> 4(r->r->r->r)
11 -> 5(n->r->n->r->r)
12 -> 5(n->n->r->r->r)


これを満たす最小のnっぽい。
n(n+1)/2=xを解くと、n>0よりx=ceil((-1+sqrt(1+8x))/2)
'''

print(ceil((-1+sqrt(1+8*int(input())))/2))

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

Solution (Python):
def main():
    x = int(input())
    pos = 0
    for i in range(x + 1):
        pos += i
        if pos >= x:
            print(i)
            return


if __name__ == '__main__':
    main()

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

t = (-1+sqrt(8*x+1))/2
a = int(t)

if a == t:
    print(a)
else:
    print(a+1)

Solution (Python):
import bisect
from math import sqrt
x = int(input())
a = [1]
s = 1
for i in range(2, 2*int(sqrt(x))):
    s += i
    a.append(s)

if x in a:
    print(a.index(x) + 1)
    exit()

print(bisect.bisect_right(a, x)+1)

Solution (Python):

x = int(input())
sum_x = 0
for n in range(1, 10 ** 9 + 1):
    sum_x += n
    if sum_x >= x:
        print(n)
        break

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

for time in range(1,10**5):
  if time == 1 and time == a:
      print(time)
      break
  else:
    summ = int(time * (time + 1) / 2)
    if summ >= a:
      print(time)
      break
    else:
      continue

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

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


t = int(math.sqrt(2*X))
while True:
    if t*(t-1) < 2*X:
        t += 1
    else:
        break

print(t-1)

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

r = 1
num = 0

while num < X:
    num += r
    r += 1

print(r-1)

Solution (Python):
X = int(input())
for i in range(10**5):
  if i * (i + 1) / 2 >= X:
    print(i)
    exit()

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

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

i = 0
while True:
    if n <= int((i*(i+1))/2):
        print(i)
        exit()
    else:
        i += 1

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

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

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

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

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

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

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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


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

    s = 0
    a = 0

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

    print(a)


main()

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