CodeEff/ECCO huggingface dataset:
# Original solution
x=int(eval(input()))
num,i=0,0
while num<x:
    i+=1
    num+=i
print(i)

# Optimized solution
x=int(eval(input()))

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

print(t)
# Original solution
n = int(eval(input()))
 
dx =[0, 1]
 
l = [0]
i = 0
 
while(n not in l):
    i += 1
    l = list(set(l))
    for j in range(len(l)):
        a = l[0]
        l.remove(l[0])
        for k in range(2):
            l.append(a + dx[k]*i)
 
 
print(i)


# Optimized solution
import math
n = int(eval(input()))
print((math.ceil((-1+(1+8*n)**(1/2))/2)))
# Original solution
X=int(eval(input()))
#幅
from collections import deque
def dfs_2(start,goal):
  q = deque([])   # スタック
  q.append([start])
  flg = 0
  while flg==0:
    p = q.popleft()         # スタック取りだし（先頭）
    jp = len(p)
#    if p[-1]-jp == goal or p[-1]+jp == goal:
    if p[-1]+jp == goal:
      return jp
    else:
      p0 = [p[-1]]
      pp = [p[-1]+jp]
#      pm = [p[-1]-jp]
      q.append(p+pp)# スタック追加
#      q.append(p+pm)
      q.append(p+p0)

print((dfs_2(0,X)))

# Optimized solution
X=int(eval(input()))
s=0
for t in range(X+1):
  s+=t
  if s>=X:
    print(t)
    break
# Original solution
import bisect
x = int(eval(input()))
xx = x//2
a = []
s = 0
for i in range(xx):
	s += i+1
	a.append(s)
	#print (s)

r = bisect.bisect_left(a, x)
print((r+1))


# Optimized solution
import bisect
x = int(eval(input()))
xx = x//2
a = []
s = 0
for i in range(x+1):
	if (i * (i+1))/2 >= x:
		print(i)
		exit()
# Original solution
int_x = int(eval(input()))

li_dist = list()
for i in range(1, int_x + 1):
    if len(li_dist) == 0:
        li_dist = [i, -i, 0]
    else:
        li_dist = [x + y for x in [i, -i, 0] for y in li_dist]

    if int_x in li_dist:
        print(i)
        exit(0)




# Optimized solution
x = int(eval(input()))

w = 0
for i in range(1, x + 1):
    w += i
    if w >= x:
        print(i)
        exit(0)
# Original solution
def main():
    x = int(eval(input()))

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


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    x = int(eval(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()
# Original solution
import bisect
x = int(eval(input()))
a = [1]
s = 1
for i in range(2, x+1):
    s += i
    a.append(s)

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

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



# Optimized solution
import bisect
from math import sqrt
x = int(eval(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))
# Original solution
import bisect
from math import sqrt
x = int(eval(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))



# Optimized solution
from math import sqrt
x = int(eval(input()))

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

if a == t:
    print(a)
else:
    print((a+1))
# Original solution
x=int(eval(input()))
import math
print((math.ceil((-1+math.sqrt(1+8*x))/2)))

# Optimized solution
x=int(eval(input()))
import math
print((math.ceil((-1+math.sqrt(1+8*x))/2)))
#{1,2,3,..n}はΣｋなので 1/2n(n+1)=xを解くとできる
# Original solution
from math import ceil
x = int(eval(input()))
n = (2 * x + 0.25) ** 0.5 - 0.5
print((ceil(n)))

# Optimized solution
print((int((2*int(eval(input()))+1/4)**0.5+0.5-10**(-5))))
# Original solution
def main():
	X = int(eval(input()))
	cur = 0
	p = 0
	for _ in range(X):
		if cur == p:
			cur += 1
			p = 1
		else:
			p += 1
	print(cur)


if __name__ == '__main__':
    main()

# Optimized solution
def main():
	X = int(eval(input()))
	i = 1
	while (i*(i+1))//2 < X:
		i += 1
	print(i)


if __name__ == '__main__':
    main()
# Original solution
x = int(eval(input()))
temp = 0
for i in range(x+1):
    temp += i
    if temp >= x:
        print(i)
        exit()


# Optimized solution
x = int(eval(input()))
for i in range(10**6):
    if i*(i+1)//2 >= x:
        print(i)
        exit()
# Original solution
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(eval(input()))
koho = create_koho(X)
nokori = X
ans = 0
for i in reversed(koho):
    if nokori >= i:
        nokori -= i
        ans += 1

print((len(koho)))


# Optimized solution
X = int(eval(input()))

i = 1
koho_sum = i
while koho_sum < X:
    i += 1
    koho_sum += i
print(i)
# Original solution
# -*- coding: utf-8 -*-
X = int(eval(input()))

sumX = []
sum = 0
for i in range(1,X+1):
    sum += i
    sumX.append(sum)

# print(sumX)

for i in range(X):
    j = X - i 
    if X > sumX[j-1]:
        print((j+1))
        exit()

print((1))


# Optimized solution
# -*- coding: utf-8 -*-
X = int(eval(input()))

# sumX = []
sum = 0
for i in range(1,X+1):
    sum += i
    # print("sum=",sum)
    if sum >= X:
        print(i)
        # print("i=", i)
        break
# Original solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

x = int(eval(input()))
i, pos = 0, set([0])

while True:
    inner = False
    new_pos = set()
    for p in pos:
        if p + i == x or p - i == x:
            inner = True
            break
        new_pos.add(p)
        new_pos.add(p + i)
        new_pos.add(p - i)

    if inner:
        print(i)
        break

    pos = new_pos
    i += 1


# Optimized solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

x = int(eval(input()))


total = 0
for i in range(x + 1):
    total += i
    if total >= x:
        print(i)
        break
# Original solution
X = int(eval(input()))

def jump(s, t):
    ns = set()
    for n in s:
        ns.add(n - t)
        ns.add(n)
        ns.add(n + t)
    return ns

def main():
    t = 0
    curr = set([0])
    while X not in curr:
        t += 1
        curr = jump(curr, t)
    print(t)

if __name__ == '__main__':
    main()

# Optimized solution
X = int(eval(input()))

def main():
    t = 0
    curr = 0
    while curr < X:
        t += 1
        curr += t
    print(t)

if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
ls = [e for e in range(n+1)]
if (int((2*n)**(1/2))+1)*(int((2*n)**(1/2)))/2 < n:
    print((int((2*n)**(1/2))+1))
else:
    print((int((2*n)**(1/2))))

# Optimized solution
n = int(eval(input()))
if (int((2*n)**(1/2))+1)*(int((2*n)**(1/2)))/2 < n:
    print((int((2*n)**(1/2))+1))
else:
    print((int((2*n)**(1/2))))
# Original solution
import sys

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

def main():
    l = 0
    r = x + 1
    while l + 1 < r:
        m = (l + r) // 2
        if (1 + m) * m // 2 >= x:
            r = m
        else:
            l = m
    return r

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

# Optimized solution
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()
# Original solution
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    from itertools import accumulate
    S = [i for i in accumulate(list(range(1, N+1)))]

    def is_ok(mid):
        if N <= S[mid]:
            return True
        else:
            return False

    def binary_search_meguru():
        left = -1
        right = N
        while right - left > 1:
            mid = left + ((right - left) // 2)
            if is_ok(mid):
                right = mid
            else:
                left = mid
        return right

    ans = binary_search_meguru() + 1
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    from itertools import accumulate
    S = [i for i in accumulate(list(range(1, min(N+1, 100000))))]

    def is_ok(mid):
        if N <= S[mid]:
            return True
        else:
            return False

    def binary_search_meguru():
        left = -1
        right = len(S)
        while right - left > 1:
            mid = left + ((right - left) // 2)
            if is_ok(mid):
                right = mid
            else:
                left = mid
        return right

    ans = binary_search_meguru() + 1
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    from itertools import accumulate
    S = [i for i in accumulate(list(range(1, min(N+1, 100000))))]

    def is_ok(mid):
        if N <= S[mid]:
            return True
        else:
            return False

    def binary_search_meguru():
        left = -1
        right = len(S)
        while right - left > 1:
            mid = left + ((right - left) // 2)
            if is_ok(mid):
                right = mid
            else:
                left = mid
        return right

    ans = binary_search_meguru() + 1
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    from itertools import accumulate
    S = [i for i in accumulate(list(range(1, min(N+1, 44725))))]

    def is_ok(mid):
        if N <= S[mid]:
            return True
        else:
            return False

    def binary_search_meguru():
        left = -1
        right = len(S)
        while right - left > 1:
            mid = left + ((right - left) // 2)
            if is_ok(mid):
                right = mid
            else:
                left = mid
        return right

    ans = binary_search_meguru() + 1
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
X = int(eval(input()))
ans = 0
for i in range(1,X+1):
    if ans + i <= X:
        ans += i
    else:
        print(i)
        exit()
    if ans == X:
        print(i)
        exit()

# Optimized solution
X = int(eval(input()))
ans = 0
for i in range(1,X+1):
    ans += i
    if X <= ans:
        print(i)
        exit()
# Original solution
import sys

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

    t = 1

    while calc_sum(t) < x:
        t += 1

    print(t)

def calc_sum(t):
    return t * (t + 1) // 2

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

if __name__ == '__main__':
    solve()


# Optimized solution
import sys

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

    k = 0

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

    print(k)
    
if __name__ == '__main__':
    solve()
# Original solution
X = int(eval(input()))

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


# Optimized solution
X = int(eval(input()))
cnt = 0
for i in range(0, 10 ** 9 + 1):
    cnt += i
    if cnt >= X:
        ans = i
        break

print(ans)
# Original solution
X = int(eval(input()))
len = 0
flag = False
for i in range(1,X+1):
    if flag:
        break
    for j in range(i):
        len += 1
        if len >= X:
            flag = True
            ans = i
            break
print(ans)

# Optimized solution
import math
X = int(eval(input()))
print((math.ceil((-1+(8*X+1)**(1/2))/2)))
# Original solution
num = int(eval(input()))
i = 1
while True:
    bef = sum(range(1,i))
    i += 1
    aft = sum(range(1,i))
    if bef < num <= aft:
        print((i-1))
        break


# Optimized solution
num = int(eval(input()))
i = 1
bef = 0
while True:
    bef += i-1
    aft = bef + i
    if bef < num <= aft:
        print(i)
        break
    i += 1
# Original solution
from collections import deque
N = int(eval(input()))

Q = deque()
Q.append(0)
i = 1
f = False
while Q:
  Q2 = Q
  Q = []
  for t in Q2:
    if t+i == N or t-i == N:
      print (i)
      f = True
      break
    Q.append(t-i)
    Q.append(t)
    Q.append(t+i)
  if f: break
  i += 1


# Optimized solution
import math
X = int(eval(input()))
t = math.ceil((-1 + (1 + 8 * X) ** 0.5)/2)
print (t)
# Original solution
x = int(eval(input()))
d = {0: None}
i = 0
while(True):
    flag = False
    i += 1
    d_keys = list(d.keys())
    for di in d_keys:
        xx = [di - i, di + i]
        if x in xx:
            flag = True
            break
        else:
            d[xx[0]] = None
            d[xx[1]] = None
    if flag:
        break
print(i)


# Optimized solution
x = int(eval(input()))
xx = 0
i = 1
while(True):
    xx += i
    if xx >= x:
        print(i)
        break
    else:
        i += 1
# Original solution
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

X = int(eval(input()))

ans = float('inf')


def bfs(s, g):
    Q = [[s, 0]]

    while Q:
        p = Q.pop(0)
        time = p[1]
        cur = p[0]
        if abs(cur) > X:
            continue
        if cur == g:
            return time
        else:
            time += 1
            Q.append([cur+time, time])
            Q.append([cur-time, time])
            Q.append([cur, time])


print((bfs(0, X)))


# Optimized solution
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

X = int(eval(input()))

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

diff = pos - X
print(time)
# Original solution
X = int(eval(input()))
ans = pow(10, 9)
for t in range(X + 1):
  if t*(t+1) / 2 >= X and t < ans:
    ans = t
print(ans)

# Optimized solution
X = int(eval(input()))
ans = pow(10, 9)
for t in range(X + 1):
  if t*(t+1) / 2 >= X and t < ans:
    ans = t
    break
print(ans)
# Original solution
def main():
    x=int(eval(input()))
    ans=abs(x)
    L=[0]
    for i in range(1,10**9):
        P=L[:]
        for l in L:
            P.append(l+i)
            P.append(l-i)
        if x in P:
            print(i)
            break
        L=P[:]
main()

# Optimized solution
def main():
    x=int(eval(input()))
    for i in range(1,10**9):
        if x>i*(i+1)//2: continue
        print(i)
        break
main()
# Original solution
import queue
q = queue.Queue()
x = int(eval(input()))


start_position = 0
start_time = 0


def k():
    while q.not_empty:
        position, time = q.get()
        if position == x:
            return time
        else:
            q.put((position - (time + 1), time + 1))
            q.put((position + (time + 1), time + 1))
            q.put((position, time + 1))


q.put((start_position, start_time))

print((k()))

# Optimized solution
x = int(eval(input()))

podition_range = 0
time = 0
i = 0

while True:
    if - podition_range <= x <= podition_range:
        print(time)
        break
    else:
        i += 1
        time += 1
        podition_range += time
# Original solution
import queue
x = int(eval(input()))

q = queue.Queue()
q.put((0,0))
d = dict()
d[0] = 0
while not q.empty():
    s,t = q.get()
    if s==x:
        break
    if not d.__contains__(s-(t+1)):
        q.put((s-(t+1),t+1))
        d[s-(t+1)]=t+1
    if not d.__contains__(s+t+1):
        q.put((s+t+1,t+1))
        d[s+t+1]=t+1
    q.put((s,t+1))
print((d[x]))


# Optimized solution
x = int(eval(input()))
s = 0
i = 0
for i in range(1,10**9):
    s += i
    if s>=x:
        break
print(i)
# Original solution
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(eval(input()))))/2)))

# Optimized solution
import math;print((math.ceil((-1+(1+8*int(eval(input())))**(1/2))/2)))
# Original solution
#!/usr/bin/env python3
n = int(eval(input()))
for i in range(10**5):
    if n <= i*(i+1)/2: 
        print(i)
        break
    

# Optimized solution
#!/usr/bin/env python3
n = int(eval(input()))
#for i in range(10**5):
for i in range(int((2*n)**(1/2))-1,int((2*n)**(1/2))+2) :
    if n <= i*(i+1)/2: 
        print(i)
        break
# Original solution
import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs= sys.stdin.buffer.readlines
#rstrip().decode('utf-8')

#import numpy as np
#import operator
import bisect
#from heapq import heapify,heappop,heappush
#from math import gcd
#from fractions import gcd
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from itertools import accumulate
#from itertools import groupby
#from itertools import permutations
#from itertools import combinations
#from scipy.sparse import csr_matrix
#from scipy.sparse.csgraph import floyd_warshall
#from scipy.sparse.csgraph import csgraph_from_dense
#from scipy.sparse.csgraph import dijkstra
#sys.setrecursionlimit(10**7)

#map(int,input().split())

def main():
    X=int(eval(input()))
    li=[i*(i+1)//2 for i in range(10**5) if i*(i+1)//2<10**9]
    print((bisect.bisect_left(li,X)))


if __name__ == '__main__':
    main()

# Optimized solution
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(eval(input()))
def FI(): return int(eval(input()))
def MI(): return list(map(int,input().split()))
def MF(): return list(map(float,input().split()))
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()


def main():
	n=II()
	for i in range(10**10):
		if (i*(i+1))//2>=n:
			print(i)
			exit()




if __name__ == "__main__":
	main()
# Original solution
import queue

if __name__ == "__main__":
    X = int(eval(input()))
    q = queue.Queue()
    qq = queue.Queue()
    q.put((0, 0))
    while True:
        x, t = q.get()
        if x == X :
            print(t)
            break
        t += 1
        q.put((x, t))
        q.put((x+t, t))
        q.put((x-t, t))

# Optimized solution
if __name__ == "__main__":
    X = int(eval(input()))
    s = 0
    i = 0
    while True:
        s += i
        if s >= X:
            print(i)
            break
        i += 1
# Original solution
# ABC 056 C
X =int(eval(input()))
L = [int(i) for i in range(X+1)]
from itertools import accumulate
for ind,val in enumerate(list(accumulate(L))):
    if val >=X:
        print(ind)
        exit()

# Optimized solution
# ABC 056 C
X =int(eval(input()))
for t in range(10**9):
    if t * (t+1)/2 >=X:
        print(t)
        exit()
# Original solution
X = int(eval(input()))

ans = 0
loc = 0
while loc < X:
    ans += 1
    for i in range(ans):
        loc += 1
print(ans)

# Optimized solution
X = int(eval(input()))

ans, loc = 0, 0

while loc < X:
    ans += 1
    loc = ans/2 * (ans+1)
print(ans)
# Original solution
X = int(eval(input()))
t = 1
max_t = (t* (t+1)) // 2

# t=1で1 t=2で 2,3 t= 3で 4, 5, 6  t=4で 7,8,9,10  t=5で 11,12,13,14,15までいける

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

# Optimized solution
x = int(eval(input()))
check = 0
for i in range(1, 1+x):
  check += i
  if check >= x:
    print(i)
    break
# Original solution
X = int(eval(input()))
for i in range(1, 10**6):
    if X <= 0.5 * i * (i + 1):
        print(i)
        break

# Optimized solution
X = int(eval(input()))

ans = 0
check = 0
for i in range(1, 10**7):
    ans += i
    check += 1
    if X <= ans:
        print(check)
        break
# Original solution
X = int(input().strip())
states = {0}
for i in range(1,X+1):
  next_set = {s+i for s in states}
  if X in next_set:
    print(i)
    break
  states |= next_set

# Optimized solution
X = int(input().strip())
now_max = 0
for i in range(1,X+1):
  now_max += i
  if X <= now_max:
    print(i)
    break
# Original solution
import sys
input = sys.stdin.readline

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

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

main()

# Optimized solution
import sys
input = sys.stdin.readline

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

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

print((next(main())))
# Original solution
x = int(eval(input()))

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

# Optimized solution
def main():
    x = int(eval(input()))

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

    # [1,t]総和がXを超えるとき
    # 超過分に相当する距離のジャンプが区間に含まれる


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok
# Original solution
x=int(eval(input()))

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

print(i)

# Optimized solution
x=int(eval(input()))

t=int(((-1+(8*x+1)**0.5)-10**(-10))/2)+1
print(t)
# Original solution
x=int(eval(input()))
a=0
i=1
while a<x:
    a+=i
    if a>=x:
        print(i)
        exit()
    i+=1

# Optimized solution
x=int(eval(input()))
a=0
for i in range(1,10**9):
    a+=i
    if a>=x:
        print(i)
        exit()
# Original solution
X = int(eval(input()))
P = {0}
i=1
while True:
    Q = {0}
    for p in P:
        Q.add(p+i)
        Q.add(p-i)
    P = P.union(Q)
    if X in P:
        print(i)
        break
    i = i+1

# Optimized solution
X = int(eval(input()))
a = 0
while X >0:
    a += 1
    X -= a
print (a)