peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
s = str(input())
n = 4
for bit in range(1 << n):
    f = '0'
    for i in range(0,n):
        if bit & (1 << i):
            f += '+-' + s[i]
        else:
            f += '+' + s[i]
    #print(f)
    ans = sum(map(int,f.split('+')))
    if ans == 7:
        f = f.replace('+-','-',4)
        break
if f[:2] == '0+':
    print(f[2:] + '=7')
else:
    print(f[1:] + '=7')
# Judge status: Wrong Answer

n,h=map(int,input().split())
X=[]
for i in range(n):
    a,b=map(int,input().split())
    X.append([a,-b])
    
X.sort(key=lambda x:(x[0],x[1]),reverse=True)
print(X)
cnt=0

for i in range(n):
    if X[i][1]<=X[0][1]:
        h+=X[i][1]
        cnt+=1
        if h<=0:
            break

if h>0:
    cnt+=h//X[0][0]
    
print(cnt)
# Judge status: Accepted
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
        z=s-i-j
        if 0<=z<=k:
            ans+=1
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
nn=[0,0,0]
for i,v in enumerate(a):
    tmp=0
    while v%2==0:
        v//=2
        tmp+=1
    nn[min(tmp,2)]+=1
if nn[1]:
    if nn[0]>(n-nn[1])//2:
        print("No")
    else:
        print("Yes")
else:
    if nn[0]>(n+1)//2:
        print("No")
    else:
        print("Yes")
# Judge status: Wrong Answer
a = int(input())
input_s = input()



if 3200 <= a <5000:
    output_s = ("s")
elif 2800 <= a <3200:
    output_s = ("red")

print(output_s)
# Judge status: Wrong Answer
n = int(input())
a = sorted(list(map(int,input().split())))
sum_a = 0
for i in range(n):
    sum_a += a[len(a)//2-1+i]
print(sum_a)
# Judge status: Accepted
def count_up(d, cut):
    ARC = len([1 for i in d if i >= cut])
    ABC = len(d) - ARC
    if ABC == ARC:
        return True
    return False

N = int(input())
d = list(map(int, input().split()))
d.sort()
print(d[N//2] - d[N//2 - 1])
# Judge status: Wrong Answer
input()
a=1
b=map(int,input().split())
for i in b:
  a*=i
  if a>10**18:
    a=-1
    break
print(a)
# Judge status: Accepted
n=int(input())
a1=list(map(int,input().split()))
a2=list(map(int,input().split()))
ans=0
for i in range(n):
    top=sum(a1[:i+1])
    bottom=sum(a2[i:])
    tmp=top+bottom
    ans=max(tmp,ans)
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
total = sum(A)
least = total * (1 / (4 * M))

count = 0
for a in A:
    if a >= least:
        count += 1

if count >= M:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
lst = [abs(int(i)) for i in input().split()]
r = 100 ** 2

if len(set(lst)) == 1:
    print(0)
    exit()

for i in range(max(lst)):
    temp = 0
    for j in lst:
        temp += (i - j) ** 2
        
    if temp < r:
        r = temp
        
print(r)
# Judge status: Accepted
def pathnumber(N, M) : 
  path = [0] * (N + 1)
  for i in range(M) : 
    x, y = tuple(map(int, input().split()))
    path[x] += 1 
    path[y] += 1
  return path

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

path = pathnumber(N, M)

for i in range(1, N + 1) : 
  print(path[i])
# Judge status: Wrong Answer
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = list()
D.append(0)
count = 1
for i in range(1,N):
    Dplus=D[i-1]+L[i-1]
    D.append(Dplus)
    #print(D[i])
    if D[i]<=X:
        count+=1
    else:
        break
print(count)
# Judge status: Wrong Answer
OFFSET = 96
def main():
    n = int(input())
    ans = []
    while n!=0:
        n,mod = divmod(n,26)
        ans.append(chr(mod+OFFSET))
    print(''.join(ans)[::-1])
    return

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
from collections import Counter
n,k,q = map(int, input().split())
a = [int(input()) for _ in range(q)]


ans = ["No"] * n
for key,val in Counter(a).items():
    if val + k - q > 0:
        ans[key-1] = "Yes"

[print(i) for i in ans];
# Judge status: Accepted
import sys
N = int(input())
A = list(map(int, input().split()))
m = 1
if 0 in A:
    print(0)
    sys.exit()

for item in A:
    m *= item
    if m > 10 ** 18:
        print("-1")
        sys.exit()
print(m)
# Judge status: Accepted
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

#import math
mod = 10**9+7



def main():
  w,a,b = map(int,input().split())
  if a > b:
    a,b = b,a
  if a+w >=b:
    print(0)
  else:
    print(abs(a+w-b))
  
if __name__ == '__main__':
  main()
# Judge status: Accepted
w, a, b = map(int, input().split())
if a + w < b:
    print(b - a- w)
elif b + w < a:
    print(a - b - w)
else:
    print(0)
# Judge status: Accepted
n=int(input())

s=input()

l=[1 for i in range(26)]

for i in range(n):
    l[ord(s[i])-ord("a")]+=1


pr=1
for i in range(26):
    pr=pr*l[i]
    pr=pr%(10**9+7)

print(pr-1)
# Judge status: Accepted
line = str(input())
if "7" in line:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    it = map(int, sys.stdin.read().split())
    N = next(it)
    A = list(it)

    A.sort()
    if N ==2:
        print(A[-1])
        return

    print(sum(A)-A[0]-A[1]+A[-2])

if __name__ == "__main__":
    resolve()
# Judge status: Accepted
n, m = map(int, input().split())
x = [0]*m
for i in range(n):
    a = list(map(int, input().split()))
    for b in a[1:]:
        x[b-1] += 1
print(x.count(n))
# Judge status: Accepted
from math import gcd
from functools import reduce
 
def gcd_list(numbers):
    return reduce(gcd, numbers)

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


X = [0]*N
Y = [0]*N
X[0] = A[0]
Y[-1] = A[-1]
ans = [0]*N
for i in range(1,N):
  X[i] = gcd(X[i-1],A[i])
  Y[N-i-1] = gcd(Y[N-i],A[N-i-1])
for i in range(1,N-1):
  ans[i] = gcd(X[i-1],Y[i+1])
ans[0],ans[-1] = gcd_list(A[1:]),gcd_list(A[:-1])
print(max(ans))
# Judge status: Accepted
n = int(input())
s = input()
if n % 2 == 0:
    if s[0:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
# Judge status: Wrong Answer
a,b,c = map(int,input().split())

if a<c<b:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
wordlist = []
for i in range(n):
    word = str(input())
    if word in wordlist:
        print('No')
        exit()
    if wordlist and wordlist[-1][-1] != word[0]:
        print('No')
        exit()
    wordlist.append(word)
print('Yes')
# Judge status: Wrong Answer
## coding: UTF-8
from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product

s = input().split()
t = [int(p) for p in s]

#print(t)
A = t[0]
B = t[1]
K = t[2]



a = max(0, A - K)
#print(a)

b = min(B, B - K + A)
#print(b)
print('{} {}'.format(a, b))
# Judge status: Accepted
def main():
    from bisect import bisect_right
    n=int(input())
    num=list(map(int,input().split()))
    num.sort()
    
    i=bisect_right(num,num[-1]//2)
    if i==0:
        ans=num[0]
    else:
        if num[-1]>num[i]+num[i-1]:
            ans=num[i]
        else:
            ans=num[i-1]
    print(num[-1],ans)

if __name__=='__main__':
    main()
# Judge status: Accepted
n,m=map(int, input().split())
a=[int(x) for x in input().split()]
a=[-1*x for x in a]

import heapq

heapq.heapify(a)

for i in range(m):
    max_value = heapq.heappop(a) #最大値の取得
    heapq.heappush(a, (max_value/2)) #半額にして-1倍してからキューに戻す

a=[-1*x for x in a]
a=[int(x) for x in a]
print(sum(a))
# Judge status: Wrong Answer
N = int(input())
li = list(map(int, input().split()))

li.sort()

sum = 0
for i in li[:-2]:
    sum = i + sum

Nmax = li[-1]
if N <= 2 or li[0] < 1:
    print("No")
elif Nmax >= sum:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

k = sum(B)-sum(A)
cb = sum([a-b for b,a in zip(B,A) if b<a])
ca = sum([(b-a+1)//2 for b,a in zip(B,A) if b>a])
if ca<=k and cb<= k:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

s = s()
a = ["SAT", "FRI", "THU","WED","TUE","MON","SUN"]
x = a.index(s) + 1
print(x)
# Judge status: Accepted
n,m = map(int,input().split())
stu = [list(map(int,input().split())) for _ in range(n)]
che = [list(map(int,input().split())) for _ in range(m)]
ans = []

for i in range(n):
    x = 10**9
    for j in range(m):
        man = abs(stu[i][0] - che[j][0]) + abs(stu[i][1] - che[j][1])
        if man < x:
            c_num = j + 1
            x = man
    ans.append(c_num)
for k in ans:
    print(k)
# Judge status: Accepted
L = []
R = []
N, M = map(int, input().split())
for _ in range(M):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)

if max(L) <= min(R):
    print(min(R) - max(L) + 1)
else:
    print(0)
# Judge status: Accepted
n,m = map(int,input().split())
ans = [0] * n
for i in range(m):
    a,b = map(int,input().split())
    ans[a-1] += 1
    ans[b-1] += 1
for i in range(n):
    print(ans[i])
# Judge status: Accepted
from collections import deque
n,k,q=map(int,input().split())
a=deque([k-q]*n)
for i in range(q):
    point=int(input())
    a[point-1] += 1
for _ in range(len(a)):
  if a.popleft() > 0:
      print("Yes")
  else:
      print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

b = [0] * n
for i,data in enumerate(a):
  b[data-1] = str(i+1)

print(' '.join(b))
# Judge status: Accepted
n = int(input())

for i in range(n,1000):
    
    s = list(str(i))
    if s[0] == s[1] == s[2]:
        break    

print(i)
# Judge status: Accepted
K=int(input())
A,B=map(int,input().split())
result=0
for i in range(1000):
  tmp=K*i
  if A<=tmp<=B:
    result=1
    break
  if tmp>B:
    break
if result==1:
  print("OK")
else:
  print("NG")
# Judge status: Accepted
from sys import stdin
from sys import setrecursionlimit
from itertools import accumulate
import bisect

n,m,k = map(int,stdin.readline().rstrip().split())
a = list(map(int,stdin.readline().rstrip().split()))
b = list(map(int,stdin.readline().rstrip().split()))

aa = [0]+list(accumulate(a))
bb = [0]+list(accumulate(b))
ma = 0

for i,j in  enumerate(aa):
    if j > k:
        break
    nowa = i
    nowb = bisect.bisect(bb,k-j)-1
    ma = max(ma,nowa+nowb)

print(ma)
# Judge status: Accepted
n,a=int(input()),list(map(int,input().split()))
print(*[a[1::2][::-1]+a[::2],a[::2][::-1]+a[1::2]][n%2],sep=' ')
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
print(sum(a[:k]))
# Judge status: Accepted
si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
lmii = lambda: list(map(int, input().split()))
smii = lambda: sorted(map(int, input().split()))


N = ii()
A = smii()

ans = 0
for i in range(N, N * 3, 2):
    ans += A[i]

print(ans)
# Judge status: Accepted
S,T = map(str,input().split())
A,B = map(int,input().split())
U = input()

if S == U:
  A -= 1
else:
  B -= 1
print(A,B)
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [input() for _ in range(n)]

x = int(input())

if x == 3 or x == 5 or x == 7:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()

last = ""
tmp = ""
ans = 0
for s in S:
    tmp += s
    if tmp == last:
        continue
    # print(tmp)
    last = tmp
    tmp = ""
    ans += 1
print(ans)
# Judge status: Accepted
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 main():
    a,b,c=MI()
    if a<=c<=b:print("Yes")
    else:print("No")
main()
# Judge status: Accepted
from collections import Counter
s = input()
S = [int(x) for x in list(str(s))]
if sum(S) == 0 or sum(S) == len(S)*1:
    print(0)
else:
    cnt = Counter(s)
    v = cnt.values()

    print(min(v)*2)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
""" A, B = map(float, input().split())
y = False
z = 1
while y == False:
  if  z % A != 0 or z % B != 0:
    z += 1
  else:
    y = True
print(z) """

A, B = map(int, input().split())
if A > B:
  a = A
  b = B
else:
  a = B
  b = A
for i in range(1,b):
  if float(a * i) % float(b) == 0:
    print(a * i)
    break
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
while len(a) > 1:
  m = min(a)
  a = [a[i]%m for i in range(len(a)) if a[i]%m > 0]
  a.append(m)
print(m)
# Judge status: Accepted
a,b,c=map(int,input().split())
if b-a==c-b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
numbers = input().split()
numA = int(numbers[0])
numB = int(numbers[1])
if numA <= 9 and numB <= 9:
  print(numA * numB)
else:
  print(-1)
# Judge status: Accepted
S = input()
T = input()

for i in range(len(S)):
  S = S[1:] + S[0]
  if T == S:
    print('Yes')
    exit(0)
print('No')
# Judge status: Accepted
a=list((input()))
print('YES' if a.count(('5'))==2 and a.count(('7'))==1 else 'NO')
# Judge status: Wrong Answer
s = input()
print((s.index('A')+s[s.index('A'):].index('Z')) - s.index('A') + 1)
# Judge status: Accepted
n=int(input())
d=list(map(int,input().split()))
mx=max(d)
l=[0]*(10**5)
mx=0
for i in range(n):
    if (i==0 and d[i]!=0) or (i!=0 and d[i]==0):
        print(0)
        exit()
    l[d[i]]+=1
    mx=max(mx,d[i])
t=1
ans=1
for i in range(1,mx+1):
    ans *= t**l[i]
    t=l[i]

print(ans%998244353)
# Judge status: Accepted
s = input()
if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
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
    a,b,c=MI()
    K=I()
    cnt=0
    while b<=a:
        b*=2
        cnt+=1
        
    while c<=b:
        c*=2
        cnt+=1
        
    if cnt<=K:
        print("Yes")
    else:
        print("No")

main()
# Judge status: Wrong Answer
N = int(input())

L = [2,1]

if N < 3:
    ans = L[N-1]
else:
    old_L = L[0]
    new_L = L[1]
    for _ in range(1, N):
        tmp = old_L + new_L
        old_L = new_L
        new_L = tmp
    ans = new_L

print(ans)
# Judge status: Accepted
from math import ceil
N, K = [int(i) for i in input().split()]
mod = 10 ** 9 + 7
ans = 0
n = m = 0
for i in range(1, N + 2):
    n += N + 1 - i
    m += i - 1
    if i >= K:
        ans += n - m + 1
        ans %= mod
print(ans)
# Judge status: Wrong Answer
X= int(input())

#素因数分解。
pf={}
m=X
for j in range(0,1000):
    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:pf[m]=1
    #print(pf)

    if (len(pf)==1) and (list(pf.values())[0]==1):
        #print(m)
        break
    else:
        m =m+1
        
print(m)
# Judge status: Accepted
N,M = map(int,input().split())
ac,wa = 0,0
was = [0]*(N+1)
acs = [0]*(N+1)
for i in range(M):
    p,S = input().split()
    p = int(p)
    if S=="AC":
        if acs[p]==0:
            ac+=1
            wa+=was[p]
            acs[p]=1
    else:
        was[p] += 1
print(ac,wa)
# Judge status: Accepted
k=int(input())

if k%2==0:
    print((k//2)**2)
else:
    print((k//2)*(k//2+1))
# Judge status: Accepted
a =list(input())

from collections import Counter
a=Counter(a)

for i in a.items():
    if i[1]%2 != 0:
        print('No')
        exit()

print('Yes')
# Judge status: Accepted
n = int(input())
nums = list(map(int, input().split()))

ans = 0
maximum = 0
for num in nums:
    maximum = max(maximum, num)
    ans += maximum - num

print(ans)
# Judge status: Accepted
s = input()
a,b = 0,0
for i in range(len(s)):
    if s[i] == '0':
        a += 1
    else:
        b += 1

if a == 0 or b == 0:
    print(0)
else:
    print(min(a,b)*2)
# Judge status: Accepted
N = int(input())

# N人目にN個のキャンディーをあげる際に必要なキャンディーの合計数の式
# 等差級数の和 をxとする
x = ( N * ( N + 1 )) // 2
print(x)
# Judge status: Accepted
def gcd(a, b):
    if a < b:
        return gcd(b, a)
    while b > 0:
        a, b = b, a % b
    return a
a, b = map(int, input().split())
print(a*b//gcd(a, b))
# Judge status: Wrong Answer
x, n = map(int, input().split())
if n == 0:
  print(x)
else:
  p = list(map(int, input().split()))
  p.sort()
  p1 = {i for i in range(p[-1])}
  p = set(p)
  p2 = p1 - p
  p2 = list(p2)
  absv = x
  for i in range(len(p2)):
    if absv > abs(x - p2[i]):
      absv = abs(x - p2[i])
  print(x - absv)
# Judge status: Wrong Answer
w,h,n = map(int,input().split())
lists = [list(map(int,input().split())) for i in range(n)]
plx = 0
ply = 0
prx = w
pry = h
for x,y,a in lists:
    if a == 1:
        plx = x
    elif a == 2:
        prx = x
    elif a == 3:
        ply = y
    elif a == 4:
        pry = y
px = (prx - plx)
py = (pry - ply)
ans = px * py
if ans <= 0:
    ans = 0
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
ans=a-1
if a<=b:
  print(a)
else:
  print(a-1)
# Judge status: Accepted
import sys
a=sys.stdin.readline()
res=[i for i in a.split()]
r1,r2=float(res[0]),float(res[1])
v1,v2=r1.is_integer(),r2.is_integer()
if v1==v2==True:
    N,D=int(r1),int(r2)
    if 1<=(N and D)<=20:
        w=2*D+1
        print(int((N+w-1)//w))
# Judge status: Accepted
S = input()

ans = [0] * (len(S)+1)

for i in range(len(S)):
    if S[i] == "<":
        ans[i+1] = ans[i]+1
# print(ans)

for i in range(len(S)):
    if S[len(S)-i-1] == ">":
        ans[len(S)-i-1] = max(ans[len(S)-i-1], ans[len(S)-i]+1)
# print(ans)

print(sum(ans))
# Judge status: Wrong Answer
N, M = map(int, input().split())
ans = ((N * (N - 1)) / 2) + ((M * (M - 1)) / 2)
print(ans)
# Judge status: Accepted


import numpy as np

a,b,c,d=map(int,input().split())
print(max(0,min(b,d)-max(a,c)))
# Judge status: Wrong Answer
N = int(input())
C = []
for i in range(N):
    C.append("".join(sorted(input(i))))
B = set(C)
ans = 0
for j in B:
    t = C.count(j)
    if t > 1:
        ans += int(t*(t-1)/2 )
# 1->0, 2->1, 3->3, 4->6, 5->10 :: nC2
    
print(ans)
# Judge status: Accepted
h, a = map(int,input().split())
if h%a==0:
    print(h//a)
else:
    print(h//a+1)
# Judge status: Accepted
N, K = map(int, input().split())
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

print(len(Base_10_to_n(N, K)))
# Judge status: Wrong Answer
s=input()
f=0
l=['dream' ,'dreamer', 'erase','eraser']
while(f==0):
    if(s[:7] in l):
        s=s[7:]
    elif(s[:6] in l):
        s=s[6:]
    elif(s[:5] in l):
        s=s[5:]
    else:
        f=1
        break
if(len(s)==0):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M = lr()
X = np.array(lr())
X.sort()
if N >= M:
    print(0); exit()

Xdiff = np.abs(np.diff(X))
Xdiff.sort()
need = M - N
answer = Xdiff[:need].sum()
print(answer)
# Judge status: Accepted
# import math
# import statistics
# a=input()
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(i)
e1,e2,e3 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))

if e1<=e3<=e2 or e2<=e3<=e1:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

for i in range(100):
    c = [i for i in a if i % 2 == 0]
    if(len(c) != n):
        break
print(i)
# Judge status: Wrong Answer
K=int(input())
[A,B]=list(map(int,input().split()))
flg=0
for n in range(A,B+1):
  if n%K==0:
    print("OK")
    flg==1
    break
if flg==0:print("NG")
# Judge status: Wrong Answer
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
n  = int(input())
#  = map(int, input().split())
l  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

l = sorted(l)[::-1]

ans = 0
for i1 in range(len(l)-2):
    a = l[i1]
    for i2 in range(i1+1, len(l)-1):
        b = l[i2]
        l_ = [l[i3] for i3 in range(i2+1, len(l[i2+1:]))]

print(ans)
# Judge status: Accepted
import math

a, b, x = map(int, input().split())

if x > a * a * b / 2:
    theta = math.degrees(math.atan(2 * (b - x / (a ** 2)) / a))
else:
    theta = 90 - math.degrees(math.atan((2 * x) / (a * b * b)))
    
print(theta)
# Judge status: Accepted
A, B = input().split(' ')

Bt = B[0]+B[2]+B[3]
Bt = int(Bt)
ans1=int(A)*int(Bt)
print(ans1//100)
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())

num = n//max(h,w) if (n//max(h,w)+1)==n else (n//max(h,w)+1)

if (n%max(h,w)==0):
  print((n//max(h,w)))
else:
  print((n//max(h,w)+1))
# Judge status: Accepted
def main():
    a = input()
    if a.isupper():
        print("A")
    else:
        print("a")
if __name__ == '__main__':
    main()
# Judge status: Accepted
S=input()
if S[2]==S[3] and S[4]==S[5]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s = input()

n = int(len(s))

n1 = int ( (n - 1 ) / 2 )
n2 = int ( (n + 1 ) / 2 )

s1 = s[0:n1]
s2 = s[n2:n]

def if_kai( st ):
  ret = True
  nn = len(st)
  nn1 = int ( (nn - 1 ) / 2 )
  for i in range(nn1+1):
    if st[i] != st[nn-i-1] :
       ret = False
       break
  return ret      

if if_kai( s ) and if_kai( s1 ) and if_kai( s2 ) :
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, k = map(int, input().split())
MOD = 10**9+7

ans = 0
for i in range(k, n+2):
  ll = 0
  lr = i - 1
  rl = n-(i-1)
  rr = n
  lsum = lr*(lr+1)//2 - ll*(ll+1)//2
  rsum = rr*(rr+1)//2 - rl*(rl-1)//2
  ans += rsum - lsum + 1
  ans %= MOD
  #print(rsum, lsum)
  
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(lambda x:int(x)%2,input().split()))
ans=[0]*n
for i in range(n,0,-1):
    b=n//i
    c=0
    for j in range(1,b+1):
        c+=ans[j*i-1]
    if (c-a[i-1])%2==1:
        ans[i-1]=1

print(sum(ans))
ans1=[]
for i,v in enumerate(ans):
    if v==1:
       ans1.append(i+1)
if len(ans1)>0:
    print(' '.join(map(str,ans1)))
# Judge status: Accepted
s,c = map(int,input().split())
if c-2*s >= 0:
    print(s + (c-2*s)//4)
else:
    print(c//2)
# Judge status: Accepted
import sys
input = sys.stdin.readline
a,b,x=map(int,input().split())
print("YES" if a<=x<=a+b else "NO")
# Judge status: Accepted
n = int(input())
s = input()

d = [0]*(n+1)
for i in range(1, n+1):
    d[i] = s[:i].count('(') - s[:i].count(')')

x = min(d)

s = '('*(-x) + s + ')'*(d[n]-x)
print(s)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    a, b, k = map(int, input().split())
    cnt = 0
    for i in range(min(a,b), 0, -1):
        if a%i==0 and b%i==0:
            cnt += 1
        if cnt == k:
            print(i)
            return
        
if __name__ == '__main__':
    main()
# Judge status: Accepted
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()