Harryxun/stf_run huggingface dataset:
n = int(input())
a = sorted([int(input()) for _ in range(n)])

if n % 2 == 0:
    ans1 = 2 * (sum(a[n // 2:]) - sum(a[:n // 2]))
    ans1 += a[n // 2] + a[n // 2 + 1]
    ans2 = 2 * (sum(a[n // 2 - 1:]) - sum(a[:n // 2 - 1]))
    ans2 += a[n // 2 - 1] + a[n // 2]
    print(max(ans1, ans2))
elif n % 2 == 1:
    ans = 2 * (sum(a[n // 2 + 1:]) - sum(a[:n // 2 + 1]))
    print(ans + a[n // 2] + a[n // 2 - 1])


### FIXED CODE ###

n = int(input())
a = sorted([int(input()) for _ in range(n)])

if n % 2 == 0:
    ans = 2 * (sum(a[n // 2:]) - sum(a[:n // 2]))
    ans += a[n // 2 - 1] - a[n // 2]
    print(ans)
elif n % 2 == 1:
    ans = 2 * (sum(a[n // 2 + 1:]) - sum(a[:n // 2]))
    print(max(ans + a[n // 2] - a[n // 2 + 1],
              ans - a[n // 2] + a[n // 2 - 1]))
N=int(input())
H=list(map(int,input().split()))

countlist=[]
count=0

for i in range(N-1):
    if  H[i]>=H[i+1]:
      count+=1
    else:
      countlist.append(count)
      count=0
else:
  countlist.apend(count)
print(max(countlist))

### FIXED CODE ###

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

count_list = []
count = 0

for i in range(N-1):
  if H[i] >= H[i+1]:
    count += 1
  else:
    count_list.append(count)
    count = 0
else:
  count_list.append(count)
    
print(max(count_list))
N = int(input())
D = list(map(int, input().split()))
D.sort()

count = 0
cur = 0
for i in range(10**5 + 1):
    if cur == N / 2:
        count += 1
    if cur > N / 2:
        break
    if D[cur] < i:
        cur += 1
        while D[cur - 1] == D[cur]:
            cur += 1
print(count)


### FIXED CODE ###

N = int(input())
D = list(map(int, input().split()))
D.sort()

ans = D[int(N / 2)] - D[int((N / 2) - 1)]
print(ans)
A = list(map(int, input().split()))
N = int(input())
count = 0
for a in A:
 if (a % 2 == 0 and a % 3 != 0) and (a % 2 == 0 and a % 5 != 0):
   count = count + 1

if count >= 1 :
 print('DENIED')
else:
 print('APPROVED')

### FIXED CODE ###

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

for i in A:
    i = int(i)
    if i % 2 == 0:
        if i % 3 !=0 and i % 5 !=0:
            print("DENIED")
            exit()
print("APPROVED")
List=list(input().upper().split())
for s in List:
  print(n[0],end="")

### FIXED CODE ###

List=list(input().upper().split())
for s in List:
  print(s[0],end="")
S = input()

mod = 10**9+7
N = len(S)
ans = 0

memo = {}
for i in range(1000):
    s = str(i).zfill(3)
    memo[s] = [0 for _ in [0]*13]
    memo[s][i%13] = 1

def rep_Q_count(s):
    memo[s] = [0 for _ in [0]*13]
    for q in range(10):
        s2 = s.replace("?",str(q),1)
        for i,n in enumerate(memo[s2]):
            memo[s][i] += n

for i in range(100):
    s = str(i).zfill(2)
    rep_Q_count(s+"?")
    rep_Q_count(s[0]+"?"+s[1])
    rep_Q_count("?"+s)
for i in range(10):
    s = str(i)
    rep_Q_count(s+"??")
    rep_Q_count("?"+s+"?")
    rep_Q_count("??"+s)
rep_Q_count("???")

s0 = S[N-3:N]
dp = memo[s0][:]
for i in range(1,(N-1)//3+1):
    s = S[max(0,N-(i+1)*3):N-i*3].zfill(3)
    j = i%2
    tmp = memo[s]
    dp2 = [0]*13
    for k,n in enumerate(tmp):
        for l,m in enumerate(dp):
            dp2[(l+k*((-1)**j))%13] += n*m
    dp = dp2
    for i in range(13):
        dp[i] %= mod
print(dp[5])

### FIXED CODE ###

S = input()

mod = 10**9+7
N = len(S)
ans = 0

memo = {}
for i in range(1000):
    s = str(i).zfill(3)
    memo[s] = [0 for _ in [0]*13]
    memo[s][i%13] = 1

def rep_Q_count(s):
    memo[s] = [0 for _ in [0]*13]
    for q in range(10):
        s2 = s.replace("?",str(q),1)
        for i,n in enumerate(memo[s2]):
            memo[s][i] += n

for i in range(100):
    s = str(i).zfill(2)
    rep_Q_count(s+"?")
    rep_Q_count(s[0]+"?"+s[1])
    rep_Q_count("?"+s)
for i in range(10):
    s = str(i)
    rep_Q_count(s+"??")
    rep_Q_count("?"+s+"?")
    rep_Q_count("??"+s)
rep_Q_count("???")

s0 = S[max(0,N-3):N].zfill(3)
dp = memo[s0][:]
for i in range(1,(N-1)//3+1):
    s = S[max(0,N-(i+1)*3):N-i*3].zfill(3)
    j = i%2
    tmp = memo[s]
    dp2 = [0]*13
    for k,n in enumerate(tmp):
        for l,m in enumerate(dp):
            dp2[(l+k*((-1)**j))%13] += n*m
    dp = dp2
    for i in range(13):
        dp[i] %= mod
print(dp[5])
N, X = map(int, input().split())
x = list(map(int, input().split()))

xdef = [abs(x[i]-X) for i in range(N)]
def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z

if N == 1:
  print(xdef[0])
else:
  tmp = gcd(xdef[0], xdef[1])
  for i in range(1,N):
    gcd = gcd(tmp,xdef[i])
  print(gcd)

### FIXED CODE ###

N, X = map(int, input().split())
x = list(map(int, input().split()))

xdef = [abs(x[i]-X) for i in range(N)]
def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z

if N == 1:
  print(xdef[0])
else:
  tmp = gcd(xdef[0], xdef[1])
  for i in range(1,N):
    tmp = gcd(tmp,xdef[i])
  print(tmp)
import sys
import math

def input():
    return sys.stdin.readline().strip()

def iinput():
    return int(input())

def finput():
    return float(input())

def tinput():
    return input().split()

def rinput():
    return map(int, tinput())

def rlinput():
    return list(rinput())

def pro(k, l, n):
    if l < n:
        if k == 0:
            return(n - l)
        return (n - l + 2)
    if l == n:
        if k == 0:
            return 0
        elif k == 1:
            return 1
        return 3
    else:
        l -= n - 1
        if l == k:
            return 1
        elif l > k:
            return 0
        if l < k - 1:
            return 2
        else:
            return 3
            

def rt(k, l , n):
    if k < n:
        if l == 0:
            return (k * 2 + n)
        return (n + k * 2 - 1)
    elif k == n:
        if l == 1:
            return (k * 3 - 2)
        elif l == 0:
            return (k * 3)
        return (k * 3 - 3)
    else:
        k -= n - 1
        if k == l:
            return (n * 3 - 2)
        elif k > l:
            return (n * 3)
        if k < l - 1:
            return ((n - 1) * 3 - 1)
        else:
            return ((n - 1) * 3)



def main():
    a = iinput()
    print(q ** 3)
    
    
    


main()



### FIXED CODE ###

n = int(input())#waiting_for_pudging
print(n**3)#pudging
#accepted
n, m, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

p, q = 0, 0
ans = 0
key = 0
while key <= k:
  if p == n and q == m:
    break
  elif p == n:
    if key+b[q] <= k:
      ans += 1
      key += b[q]
      q += 1
    else:
      break
  elif q == m:
    if key+a[p] <= k:
      ans += 1
      key += a[p]
      p += 1
    else:
      break
  else:
    if a[p] < b[q]:
      if key+a[p] <= k:
        ans += 1
        key += a[p]
        p += 1
      else:
        break
    elif a[p] > b[q]:
      if key+b[q] <= k:
        ans += 1
        key += b[q]
        q += 1
      else:
        break
    else:
      if a[p] + key > k:
        break
      if a[p+1] <= b[q+1]:
        ans += 1
        key += a[p]
        p += 1
      else:
        ans += 1
        key += b[q]
        q += 1

print(ans)

### FIXED CODE ###

n, m, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [0]+[int(x) for x in input().split()]

count = sum(a)
p = n-1
ans = 0
judge = True
for i in range(m+1):
  flag = False
  count += b[i]
  while count > k and judge:
    count -= a[p]
    p -= 1
    if p == -1:
      if count > k:
        flag = True
      else:
        judge = False
      break
  if count > k:
    break
  if flag:
    break
  sub = p+1+i
  if ans < sub:
    ans = sub
print(ans)
a=input()
b=input()
for i in range(0,len(a)):
  if a==b[i:]+b[:i] : 
    print("Yes")
    exit(0)
print("No")

### FIXED CODE ###

a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))
A, B = map(int,input().split())

def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            if i != n // i:
                divisors.add(n//i)
    return divisors

lst_A = make_divisors(A)
lst_B = make_divisors(B)
cmn_lst = lst_A & lst_B
m = max(cmn_lst)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = set()
for i, v in enumerate(hurui):
    if v == 1:
        cand.add(i)
print(len(cand & cmn_lst))

### FIXED CODE ###

from math import gcd
A, B = map(int,input().split())
max_cmn_div = gcd(A, B)

# 約数列挙関数
def make_divisor(n):
    divisor = []
    for i in range(1, int(n**(1/2))+1):
        if n % i == 0:
            divisor.append(i)
            if i != n//i:
                divisor.append(n//i)
    return divisor

def check_prime(n):
    for i in range(2, int(n**(1/2))+1):
        if n % i == 0:
            return 0
    return 1

cmn_div = make_divisor(max_cmn_div)
ans = 0
for i in cmn_div:
    if check_prime(i):
        ans += 1
print(ans)
n, m = map(int, input().split())
h = list(map(int, input().split()))
p = [False] + [True]*n
A = []
B = []
for i in range(m):
    a, b = map(int,input().split())
    A.append(a)
    B.append(b)

for i in range(m):
    if h[A[i] - 1] > h[B[i] - 1]:
        p[B[i]] = False
    elif h[A[i] - 1] < h[B[i] - 1]:
        p[A[i]] = False
    else:
        p[A[i]] = False
        p[B[i]] = False
    print(p)
ans = [i for i in range(n + 1) if p[i]]

print(len(ans))


### FIXED CODE ###

n, m = map(int, input().split())
h = list(map(int, input().split()))
p = [False] + [True]*n
A = []
B = []
for i in range(m):
    a, b = map(int,input().split())
    A.append(a)
    B.append(b)

for i in range(m):
    if h[A[i] - 1] > h[B[i] - 1]:
        p[B[i]] = False
    if h[A[i] - 1] < h[B[i] - 1]:
        p[A[i]] = False
    if h[A[i] - 1] == h[B[i] - 1]:
        p[A[i]] = False
        p[B[i]] = False
    
ans = [i for i in range(n + 1) if p[i]]

print(len(ans))
import math
N = int(input())
t = []
for i in range(n):
  t.append(list(map(int,input().split())))
at = []
for i in range(N):
    for j in range(N):
        ea = math.sqrt((t[i][0] - t[j][0])**2 + (y[i][1] - y[j][1])**2)
        at.append(ea)
da = 0
for ag in at:
    da += ag
avg = da * math.factorial(N - 1) / math.factorial(N)
print(avg)


### FIXED CODE ###

import math
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
at=[]
for i in range(N):
    for j in range(N):
        ea = math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
        at.append(ea)
da = 0
for ag in at:
    da += ag
avg = da * math.factorial(N - 1) / math.factorial(N)
print(avg)
import numpy as np
import collections

N = int(input())
V = np.array(list(map(int, input().split())))

if N == len(np.where(V == V[0])[0]):
    print(N // 2)
else:
    v0 = [V[i] for i in range(0, N - 1, 2)]
    v1 = [V[i] for i in range(1, N, 2)]
    v0_items = dict(collections.Counter(v0).items())
    v1_items = dict(collections.Counter(v1).items())
    v0_max_key = max(v0_items, key=v0_items.get)
    v1_max_key = max(v1_items, key=v1_items.get)
    if v0_max_key == v1_max_key:
        count = v0_items.pop(v0_max_key)
        count = (N // 2) - v1_items.pop(v1_max_key)
        tmp1 = v0_items.pop(v0_max_key)
        tmp2 = v1_items.pop(v1_max_key)
        count += max(tmp1, tmp2)
        
    else:
        count = (N // 2) - max(collections.Counter(v0).values())
        count += (N // 2) - max(collections.Counter(v1).values())
        print(count)

### FIXED CODE ###

import numpy as np
import collections

N = int(input())
V = np.array(list(map(int, input().split())))

if N == len(np.where(V == V[0])[0]):
    print(N // 2)
else:
    v0 = [V[i] for i in range(0, N - 1, 2)]
    v1 = [V[i] for i in range(1, N, 2)]
    v0_items = dict(collections.Counter(v0).items())
    v1_items = dict(collections.Counter(v1).items())
    v0_max_key = max(v0_items, key=v0_items.get)
    v1_max_key = max(v1_items, key=v1_items.get)
    
    if v0_max_key == v1_max_key:
        count = v0_items.pop(v0_max_key)
        count = (N // 2) - v1_items.pop(v1_max_key)
        tmp1 = v0_items.pop(max(v0_items, key=v0_items.get))
        tmp2 = v1_items.pop(max(v1_items, key=v1_items.get))
        count += (N // 2) - max(tmp1, tmp2)
        print(count)
    else:
        count = (N // 2) - max(collections.Counter(v0).values())
        count += (N // 2) - max(collections.Counter(v1).values())
        print(count)
ct=[]
for i in range(N):
    ct.append(list(map(int, input().strip().split(' '))))
    
tle=True
c=100000000

for i in range(N):
    if ct[i][1]<=T:
        tle=False
        c=min(c,ct[i][0])
        
if tle:
    print('TLE')
else:
    print(c)

### FIXED CODE ###

N, T=map(int,input().strip().split(' '))

ct=[]
for i in range(N):
    ct.append(list(map(int, input().strip().split(' '))))
    
tle=True
c=100000000

for i in range(N):
    if ct[i][1]<=T:
        tle=False
        c=min(c,ct[i][0])
        
if tle:
    print('TLE')
else:
    print(c)
import math

def make_prime_list_2(num):
    if num < 2:
        return []
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def search_divisor_num(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = int(math.floor(math.sqrt(num)))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num

n = int(input())
print(search_divisor_num(math.factorial(n)) % (pow(10,9) + 7))

### FIXED CODE ###

import math
import collections

def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    factor.append(n)
    return factor

n = int(input())
c = collections.Counter([])
for num in range(2, n+1):
  prime_list = trial_division(num)
  c.update(prime_list)
res = 1
for prime, count in c.most_common():
  if(prime > 1):
    res = res * (count + 1)
print(res % (pow(10,9) + 7))
import math
n = int(input())
a = list(map(int, input().split(' ')))
nok = a[0]
mod = int(1e9 + 7)
for i in range(1, n):
    nok = nok * a[i] // math.gcd(nok, a[i])
ans = 0
for i in range(0, n):
    ans += nok // a[i]
print (ans % mod)

### FIXED CODE ###

def gcd(x, y): 

    while(y): 
        x, y = y, x % y 
    
    return x 

n = int(input())
a = list(map(int, input().split(' ')))
nok = a[0]
mod = int(1e9 + 7)
for i in range(1, n):
    nok = nok * a[i] // gcd(nok, a[i])
ans = 0
for i in range(0, n):
    ans += nok // a[i]
print (ans % mod)
N=int(input())
li = list(map(int,input().split()))	
num = [0]*100000000
for l in li:
    if num[l] == 0:
        num[l] = 1
    elif num[l] == 1:
        print("NO")
        break
else:
    print("YES")





### FIXED CODE ###

N=int(input())
li = list(map(int,input().split()))	
num = {}
for l in li:
    if str(l) not in num :
        num[str(l)] = 1
    elif num[str(l)]==1:
        print("NO")
        break
else:
    print("YES")
a,b = input().split()
plus = a + b
mai  = a - b
kake = a * b

print(max(plus,mai,kake))

### FIXED CODE ###

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

plus = a + b 

mai = a - b

kake = a * b 

print(max(plus,mai,kake))
a,b,c=map(int,input().split())
print(a[0].upper()+b[0].upper()+c[0].upper())

### FIXED CODE ###

a,b,c=map(str,input().split())
print(a[0].upper()+b[0].upper()+c[0].upper())
import sys
sys.setrecursionlimit(10000000)

def neighbor(N, edges):
    neighbor_list = [[] for _ in range(N)]
    for i in range(N):
        for vs in edges:
            if i + 1 in vs: # vsは頂点i+1が含まれるedge
                neighbor_list[i] += vs
        neighbor_list[i] = list(set(neighbor_list[i]))
        neighbor_list[i].remove(i + 1)
        
    return neighbor_list

def neighbor2(N, edges):
    nlist = neighbor(N, edges)
    nneighbor_list = [[] for _ in range(N)]
    for i in range(N):
        nneighbor_list[i] += nlist[i]
        for e in nlist[i]:
            nneighbor_list[i] += nlist[e - 1]
        nneighbor_list[i] = list(set(nneighbor_list[i]))
        nneighbor_list[i].remove(i + 1)
    return nneighbor_list
        
        
def combination(N, K, nnlist):
    combi = 1
    clist = [False]*N
    for v in range(N):
        print(combi)
        combi *= (K - len([t for t in nnlist[v] if clist[t-1]]))
        clist[v] = True
    return combi

def paint(N, K, nlist, nnlist, clist, vlist, combi):
    vlist_next = []
    for v in vlist:
        #nnlistの中で塗られている頂点の数を数え、色候補数Kから引く
        combi *= (K - len([t for t in nnlist[v - 1] if clist[t - 1]])) 
        clist[v - 1] = True #頂点vを塗る
        vlist_next += [t for t in nlist[v - 1] if not clist[t - 1]]
    return combi, vlist_next, clist


if __name__ == '__main__':
    N, K = map(int, input().split())
    edges = [None]*(N-1)
    
    for i in range(N-1):
        edges[i] = list(map(int, input().split()))
    
    nlist = neighbor(N, edges)
    nnlist = neighbor2(N, edges)
    
    vlist_next = [1]
    combi = 1
    clist = [False]*N
    for i in range(N):
        print(combi, vlist_next, clist)
        combi, vlist_next, clist = paint(N, K, nlist, nnlist, clist=clist, vlist=vlist_next, combi=combi)
        if len(vlist_next) == 0:
            break
    
    print(combi%1000000007)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

def neighbor(N, edges):
    neighbor_list = [[] for _ in range(N)]
    for a, b in edges:
        neighbor_list[a-1] += [b-1]
        neighbor_list[b-1] += [a-1]
        
    return neighbor_list


def paint(K, nlist, now_num, from_num, case_num):
        mod = 1000000007
        if  from_num == -1:
            can_use_color = K - 1
        else:
            can_use_color = K - 2
        
        if len(nlist[now_num]) - 1 > can_use_color:
            return 0
        
        for child in nlist[now_num]:
            if child == from_num:
                continue
            else:
                case_num *= can_use_color
                can_use_color -= 1
                case_num %= mod
        
        for child in nlist[now_num]:
            if child == from_num:
                continue
            else:
                case_num = paint(K, nlist, child, now_num, case_num)
        return case_num%mod
            

if __name__ == '__main__':
    N, K = map(int, input().split())
    edges = [None]*(N-1)
    
    for i in range(N-1):
        edges[i] = list(map(int, input().split()))
    
    nlist = neighbor(N, edges)


    print(paint(K, nlist, 0, -1, K))
from itertools import count, repeat

h = int(input().split()[0])
a0 = repeat('.')
r0 = list(range(w))
for i in range(h):
  a = input()
  r = [i]
  for x, y, z, u in zip(a0, '.' + a, a, r0):
    r.append(min(u + (x + z == '.#'), r[-1] + (y + z == '.#')))
  a0 = a
  r0 = r[1:]
print(r[-1])


### FIXED CODE ###

h, w = map(int, input().split())
a0 = '.' * w
r0 = [200] * w
for i in range(h):
  a = input()
  r = [i * 200]
  for x, y, z, u in zip(a0, '.' + a, a, r0):
    r.append(min(u + (x + z == '.#'), r[-1] + (y + z == '.#')))
  a0 = a
  r0 = r[1:]
print(r[-1])
from sys import stdin

def main():
    global lista
    n = int(stdin.readline())
    lista = [int(x) for x in stdin.readline().strip().split()]

    inx = 0
    inx  = cuenta(inx)
    flag = lista[inx] >= lista[inx+1];
    cont = 0
    tempc = 0
    while(inx < len(lista)-1):
        if flag:
            if(lista[inx] >= lista[inx+1]):
                flag = True
                tempc+=1
            else:
                tempc=0
                cont+=1
                flag = inx < len(lista)-2 and lista[inx+1] >= lista[inx+2];
        else:
            if(lista[inx] <= lista[inx+1]):
                flag = False
                tempc+=1
            else:
                tempc=0
                cont+=1
                flag = inx < len(lista)-2 and lista[inx+1] >= lista[inx+2];
        inx+=1
    print(cont+1)

def cuenta(i):
    while(i < len(lista)-1 and lista[i] == lista[i+1]):
        i+=1
    return i

main()



### FIXED CODE ###

from sys import stdin

def main():
	N = int(stdin.readline().strip())
	array = [int(x) for x in stdin.readline().strip().split()]
	ans,i= 0,0
	while i+1 < N:
		if array[i] < array[i+1]:
			ans+=1
			while i+1 < N and array[i] <= array[i+1]:
				i+=1
			i+=1
		elif array[i] > array[i+1]:
			ans+=1
			while i+1 < N and array[i] >= array[i+1]:
				i+=1
			i+=1
		else:
			i+=1
	if i+1 == N or ans == 0:
		ans+=1
	print(ans)
main()
N = input()
M = input()
sumA = 0
for i in range(int(M)):
    sumA += int(input())
playday = int(N)-sumA
if playday >= 0:
    print(playday)
else:
    print(-1)

### FIXED CODE ###

N = input()
A = input()
M = [int(x) for x in N.split(' ')]
B = [int(x) for x in A.split(' ')]
for i in range(M[1]):
     M[0] = M[0] - B[i]
if M[0] >= 0:
    print(M[0])
else:
    print(-1)
import heapq
n,X,Y = map(int,input().split())

def dijkstra_heap(s,edge):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    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

E = []
for i in range(n-1):
    E.append([i,i+1,1])
E.append([X-1,Y-1,1])

edge = [[] for i in range(n)]
#edge[i] : iから出る道の[重み,行先]の配列
for i in range(w):
    for e in E:
        x,y,z = map(int,e)
        edge[x].append([z,y])
        edge[y].append([z,x])

for i in range(1,n):
    cnt = 0
    for j in range(n):
        tmp = dijkstra_heap(j,edge)
        for t in tmp[j:]:
            if t==i:
                cnt += 1
    print(cnt)

### FIXED CODE ###

N, X, Y = map(int, input().split())
ans = [0]*(N-1)
for i in range(1, N):
    for j in range(i+1, N+1):
        d = min(j-i, abs(X-i)+abs(j-Y)+1)
        ans[d-1] += 1

print(*ans, sep='\n')
A, B, C, D = map(int, input().split())
ans = 0
for i in range(1, 101)
if A <= i and i <= B amd C <= i and i <= D:
  ans += 1
print(ans)

### FIXED CODE ###

A, B, C, D = map(int, input().split())
ans = 0
for i in range(0, 101):
  if A <= i and i < B and C <= i and i < D:
    ans += 1
print(ans)
N=int(input())

if N == 0:
  print(0)
  exit()

ans = 0
i = 1
while True:
  m = N//i-1
  q,r = divmod(N,m)
  if q == r:
    ans += m
  if m<N**.5:
    break
  i += 1
  
print(ans)

### FIXED CODE ###

N=int(input())

if N == 1:
  print(0)
  exit()

ans = 0
i = 1
while True:
  m = N//i-1
  q,r = divmod(N,m)
  if q == r:
    ans += m
  if m<N**.5:
    break
  i += 1
  
print(ans)
n = int(input())

from scipy.special import comb


def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

print(num2alpha(n).lower())

### FIXED CODE ###

a=input()
if a.islower()==True:
  print("a")
else:
  print("A")
x = input()
x = x.split()
x = x.split(\n)
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')


### FIXED CODE ###

k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')