Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import collections
def main():
    N,X,Y = map(int, input().split())
    # 扱いやすいようにX,Yはインデックス表記にしておく
    X -= 1
    Y -= 1
    # i<jを満たす(i,j)について6通りの場合分けして全最短距離を求められる
    shortest = [[-1]*N for _ in range(N)]
    for i in range(N):
        for j in range(i+1,N):
            # i<=X,Y<=j
            if i<=X and Y<=j:
                shortest[i][j] = min(j-i, X-i+1+j-Y)
            # j<=X
            elif j<=X:
                shortest[i][j] = j-i
            # i<=X<j<=Y
            elif i<=X and X<=j and j<=Y:
                shortest[i][j] = min(j-i, X-i+1+Y-j)
            # X<=i,j<=Y
            elif X<=i and j<=Y:
                shortest[i][j] = min(j-i, i-X+1+Y-j)
            # X<=i<=Y<=j
            elif X<=i and i<=Y and Y<=j:
                shortest[i][j] = min(j-i, i-X+1+j-Y)
            # Y<=i
            else:
                shortest[i][j] = j-i

    coll = [collections.Counter(s) for s in shortest]
    for i in range(1,N):
        count = 0
        for j in range(N):
            count += coll[j].get(i,0)
        print(count)
main()


### FIXED CODE ###

import collections
def main():
    N,X,Y = map(int, input().split())
    # 扱いやすいようにX,Yはインデックス表記にしておく
    X -= 1
    Y -= 1
    # i<jを満たす(i,j)について6通りの場合分けして全最短距離を求められる
    shortest = [[-1]*N for _ in range(N)]
    coll = collections.Counter()
    for i in range(N):
        k1 = abs(X-i)
        for j in range(i+1,N):
            k2 = abs(j-Y)
            shortest[i][j] = min(j-i, k1+1+k2)
        coll += collections.Counter(shortest[i])

    for i in range(1,N):
        print(coll.get(i,0))
        
main()
### BUGGY CODE ###

MOD = 10**9+7

S = input()
N = len(S)
dp = [[0]*4 for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
    s = S[i]
    for j in range(4):
        if s == "?":
            dp[i+1][j] += dp[i][j]*3
        else:
            dp[i+1][j] += dp[i][j]
        if j < 3 and (s == "?" or s == "ABC"[j]):
            dp[i+1][j+1] += dp[i][j]
print(dp[N][3]%MOD)


### FIXED CODE ###

MOD = 10**9+7

S = input()
N = len(S)
dp = [[0]*4 for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
    s = S[i]
    for j in range(4):
        if s == "?":
            dp[i+1][j] += dp[i][j]*3%MOD
        else:
            dp[i+1][j] += dp[i][j]%MOD
        if j < 3 and (s == "?" or s == "ABC"[j]):
            dp[i+1][j+1] += dp[i][j]%MOD
print(dp[N][3]%MOD)
### BUGGY CODE ###

def main():
  n=int(input())
  heights=list(map(int,input().split()))
  assert len(heights)==n
  i=0
  count=0

  while i<n:
    j=i+1
    while j<n:
        if heights[i]+heights[j]==(j-i):
            count+=1
        j+=1
    i+=1
  print(count)
main()

### FIXED CODE ###

def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    from collections import defaultdict
    count = defaultdict(int)
    ans = 0
    for i, a in enumerate(A):
        if i - a in count:
            ans += count[i-a]
        count[i+a] += 1
    print(ans)
 
 
if __name__ == '__main__':
    main()
### BUGGY CODE ###

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
u_light = [[0]*w for _ in range(h)] #上をてらせる数
d_light = [[0]*w for _ in range(h)] #下
l_light = [[0]*w for _ in range(h)] #左
r_light = [[0]*w for _ in range(h)] #右

def count_light(i, j):
    if s[i][j] == '.':
        return 1
    else:
        return -10000

for i in range(w):
    d_light[-1][i] = count_light(-1, i)
    u_light[0][i] = count_light(0, i)
for j in range(1, h):
    for i in range(w):
        d_light[-(j+1)][i] = max(d_light[-j][i], 0) + count_light(-(j+1), i)
        u_light[j][i] = max(u_light[j-1][i], 0) + count_light(j, i)

for i in range(h):
    l_light[i][0] = count_light(i, 0)
    r_light[i][-1] = count_light(i, -1)
for j in range(1, w):
    for i in range(h):
        l_light[i][j] = max(l_light[i][j-1], 0) + count_light(i, j)
        r_light[i][-(j+1)] = max(r_light[i][-j], 0) + count_light(i, -(j+1))

score = 0
tmp_score = 0
for i in range(h):
    for j in range(w):
        tmp_score = u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j]
        if tmp_score > score:
            score = tmp_score
print(score-3) # 3回ダブっているので除去


### FIXED CODE ###

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
u_light = [[0]*w for _ in range(h)] #上をてらせる数
d_light = [[0]*w for _ in range(h)] #下
l_light = [[0]*w for _ in range(h)] #左
r_light = [[0]*w for _ in range(h)] #右

def count_light(i, j):
    if s[i][j] == '.':
        return 1
    else:
        return -10000

for i in range(w):
    d_light[-1][i] = count_light(-1, i)
    u_light[0][i] = count_light(0, i)
for j in range(1, h):
    for i in range(w):
        d_light[-(j+1)][i] = max(d_light[-j][i], 0) + count_light(-(j+1), i)
        u_light[j][i] = max(u_light[j-1][i], 0) + count_light(j, i)

for i in range(h):
    l_light[i][0] = count_light(i, 0)
    r_light[i][-1] = count_light(i, -1)
for j in range(1, w):
    for i in range(h):
        l_light[i][j] = max(l_light[i][j-1], 0) + count_light(i, j)
        r_light[i][-(j+1)] = max(r_light[i][-j], 0) + count_light(i, -(j+1))

score = 0
tmp_score = 0
for i in range(h):
    for j in range(w):
        tmp_score = u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j]
        if tmp_score > score:
            score = tmp_score
print(score-3) # 3回ダブっているので除去
### BUGGY CODE ###

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

X = [0]
V = [0]
for _ in range(N):
    x, v = map(int, input().split())
    X.append(x)
    V.append(v)
X.append(C)

ans = 0
for a in range(N+1):
    for b in range(a+1, N+2):
        # O -> A -> B
        a1 = sum(V[:a+1])+sum(V[b:])-2*X[a]-(C-X[b])

        # O -> B -> A
        a2 = sum(V[:a+1])+sum(V[b:])-X[a]-2*(C-X[b])

        ans = max(ans, a1, a2)

print(ans)

### FIXED CODE ###

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

X = [0]
V = [0]
sV = [0]
Amax1 = [0]
Amax2 = [0]
for _ in range(N):
    x, v = map(int, input().split())
    X.append(x)
    V.append(v)
    sV.append(sV[-1]+v)
    Amax1.append(max(Amax1[-1], sV[-1]-x))
    Amax2.append(max(Amax2[-1], sV[-1]-2*x))
X.append(C)

ans = 0
for b in range(1, N+2):
    # O -> A -> B
    a1 = Amax2[b-1]+sV[-1]-sV[b-1]-(C-X[b])

    # O -> B -> A
    a2 = Amax1[b-1]+sV[-1]-sV[b-1]-2*(C-X[b])

    ans = max(ans, a1, a2)

print(ans)
### BUGGY CODE ###

n, k = map(int, input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = max(h)
for i in range(n-k+1):
  tmp = h[i:i+k]
  if ans > (max(tmp) - min(tmp)):
    ans = max(tmp) - min(tmp)
    
print(ans)
  

### FIXED CODE ###

n, k = map(int, input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = h[n-1]
for i in range(n-k+1):
  if ans > (h[i+k-1]-h[i]):
    ans = h[i+k-1]-h[i]
print(ans)
### BUGGY CODE ###

import sys
stdin = sys.stdin
from collections import deque

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n, k = na()
h = na()

inf = 10**10
dp = [inf] * n
dp[0] = 0
for i in range(n-1):
    for j in range(1, k+1):
        if i + j <= n - 1:
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
#print(dp)
print(dp[n-1])

### FIXED CODE ###

import sys
stdin = sys.stdin
from collections import deque

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n, k = na()
h = na()

inf = 10**10
dp = [inf] * n
dp[0] = 0
for i in range(n-1):
    for j in range(1, k+1):
        if i + j <= n - 1:
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
#print(dp)
print(dp[n-1])
### BUGGY CODE ###

from math import sqrt
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
N = int(input())

ans = 0
for i in range(1, N+1):
    ans += len(make_divisors(i))*i
print(ans)

### FIXED CODE ###

N = int(input())

ans = 0
for i in range(1, N+1):
    y = N//i
    
    ans += y*(y+1)*i//2



print(ans)
### BUGGY CODE ###

import numpy as np

n = int(input())
a = list(map(int, input().split()))

a.sort()
arrived = [a.pop()]
comfort = [arrived[0]]
score = 0

for i in range(n - 1):
    x = a.pop()
    max_index = np.argmax(comfort)
    score += comfort[max_index]

    arrived.insert(max_index + 1, x)
    comfort[max_index] = min(arrived[max_index], x)
    comfort.insert(max_index + 1, min(x, arrived[max_index + 1]))

print(score)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)

score = - a[0]
for i in range(n):
    score += a[i // 2]
print(score)
### BUGGY CODE ###

N = int(input())
a = [int(i) for i in input().split()]

b = list(set(a))

ans = 0
for i in b:
    tmp = a.count(i)
    if tmp < i:
        ans += tmp
    else:
        ans += tmp - i

print(ans)


### FIXED CODE ###

from collections import Counter as ct

N = int(input())
a = [int(i) for i in input().split()]
c = ct(a)

ans = 0
for i, j in c.items():
    if i <= j:
        ans += j - i
    else:
        ans += j

print(ans)
### BUGGY CODE ###

from sys import stdin

a,b = [int(x) for x in stdin.readline().rstrip().split()]

if a > b:
    print(b//2)
    exit()

while True:
    if a*2 < b:
        a += 1
        b -= 2
    else:
        break
print(min(a,b//2))

### FIXED CODE ###

from sys import stdin

a,b = [int(x) for x in stdin.readline().rstrip().split()]

if a > b//2:
    print(b//2)
else:
    print((b+2*a)//4)
### BUGGY CODE ###

n,y = map(int,input().split())

for i in range(y//10000+1):
    for j in range((y-10000*i)//5000+1):
        for k in range((y-10000*i-5000*j)//1000+1):
            if i*10000+j*5000+k*1000==y and i+j+k==n:
                print(i,j,k);exit()
else:
    print(-1,-1,-1)

### FIXED CODE ###

n,y = map(int,input().split())

for i in range(n+1):
    for j in range(n+1-i):
        k=n-i-j
        if 10000*i+5000*j+1000*k==y:
            print(i,j,k);exit()
print(-1,-1,-1)
### BUGGY CODE ###

s = input()
S = []
A = []
B = []
for i in range(len(s)):
  S.append(s[i])
Q = int(input())
flag = 0
for _ in range(Q):
    q = list(input().split())
    if q[0] == "1":
        flag += 1
    else:
        if flag % 2 == 0:         
            if q[1] == "1":
                A.insert(0,q[2])
            else:
                B.append(q[2])
        else:
            if q[1] == "1":
                B.append(q[2])
            else:
                A.insert(0,q[2])
if flag%2 == 0:
    A = "".join(A)
    B = "".join(B)
    S = "".join(S)
    print(A+S+B)
else:
    S = S[::-1]
    S = "".join(S)
    A = A[::-1]
    A = "".join(A)
    B = B[::-1]
    B = "".join(B)
    print(B+S+A)

### FIXED CODE ###

S = input()
Q = int(input())
flag = 0
H = ""
for _ in range(Q):
    q = list(input().split())
    if q[0] == "1":
        flag += 1
    else:
        if flag%2 == 0:
            if q[1] == "1":
                H = H+q[2]
            else:
                S = S+q[2]
        else:
            if q[1] == "1":
                S = S+q[2]
            else:
                H = H+q[2]
H = H[::-1]
H = H+S
if flag%2 == 0:
    print(H)
else:
    H = H[::-1]
    print(H)
### BUGGY CODE ###

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

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

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

        if x == y:
            return

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

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

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

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

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

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

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

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

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

def resolve():
    N, M = list(map(int, input().split()))
    uf = UnionFind(N)
    for i in range(M):
        a, b = list(map(int, input().split()))
        uf.union(a-1, b-1)
    maxnum = 0
    for _, v in uf.all_group_members().items():
        maxnum = max(maxnum, len(v))
    print(maxnum)

if '__main__' == __name__:
    resolve()

### FIXED CODE ###

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

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

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

        if x == y:
            return

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

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

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

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

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

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

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

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

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

def resolve():
    N, M = list(map(int, input().split()))
    uf = UnionFind(N)
    for i in range(M):
        a, b = list(map(int, input().split()))
        uf.union(a-1, b-1)
    maxnum = 0
    for v in uf.parents:
        if v < 0:
            maxnum = max(maxnum, -v)
    print(maxnum)

if '__main__' == __name__:
    resolve()
### BUGGY CODE ###

N, Q = map(int,input().split())
S = input()
for i in range(Q):
  l, r = map(int,input().split())
  a = S[l-1:r]
  print(a.count('AC'))

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
N, Q = map(int,input().split())
S = input()
nums = [0] * (N + 1)
for i in range(N):
  nums[i+1] = nums[i] + (1 if S[i:i+2]=='AC' else 0)
    
for j in range(Q):
  l, r = map(int,input().split())
  print(nums[r-1] - nums[l-1])
### BUGGY CODE ###

from collections import deque

def bfs(maze, visited, s, h, w):
  queue = deque(s)
  #　返り値
  va = 0
  while queue:
    y,x = queue.popleft()
    for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
      new_y, new_x = y+j, x+k
      if new_x < 0 or new_x >= w or new_y < 0 or new_y >=h :
        continue
      if maze[new_y][new_x] == "." and visited[new_y][new_x] == -1:
        #　移動回数の計算
        visited[new_y][new_x] = visited[y][x] + 1
        va = max(va,visited[new_y][new_x])
        queue.append([new_y, new_x])
  return va
############

h,w = map(int,input().split())

maze = [['' for j in range(w)] for i in range(h)]
for i in range(h) :
  m1 = input()
  for j in range(w) :
    maze[i][j] = m1[j]

visited = [[-1]*(w) for _ in range(h)]
ans = []
s = []
s_append = s.append
for sy in range(h) :
  for sx in range(w):
    if maze[sy][sx] == '#' :
      s_append([sy,sx])
      maze[sy][sx] = '.'
      visited[sy][sx] = 0

print(bfs(maze, visited, s, h, w))

### FIXED CODE ###

from collections import deque

def bfs(maze, visited, s, h, w):
  queue = deque(s)
  #　返り値
  va = 0
  while queue:
    y,x = queue.popleft()
    for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
      new_y, new_x = y+j, x+k
      if new_x < 0 or new_x >= w or new_y < 0 or new_y >=h :
        continue
      if maze[new_y][new_x] == "." and visited[new_y][new_x] == -1:
        #　移動回数の計算
        visited[new_y][new_x] = visited[y][x] + 1
        va = max(va,visited[new_y][new_x])
        queue.append([new_y, new_x])
  return va
############

h,w = map(int,input().split())

maze = [['' for j in range(w)] for i in range(h)]
for i in range(h) :
  m1 = input()
  for j in range(w) :
    maze[i][j] = m1[j]

visited = [[-1]*(w) for _ in range(h)]
ans = []
s = []
s_append = s.append
for sy in range(h) :
  for sx in range(w):
    if maze[sy][sx] == '#' :
      s_append([sy,sx])
      maze[sy][sx] = '.'
      visited[sy][sx] = 0

print(bfs(maze, visited, s, h, w))
### BUGGY CODE ###

from itertools import combinations
n,k = map(int,input().split())
P = list(map(int,input().split()))

ans = float('inf')
for t in combinations(range(n),k):
    res = 0
    for i in range(k):
        res+=P[t[i]]
    ans = min(res,ans)
    
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
P = list(map(int,input().split()))

P.sort()
ans = 0
for i in range(k):
    ans+=P[i]
    
print(ans)
### BUGGY CODE ###

n = int(input())
x = list(map(int, input().split()))
sx = sorted(x)
mae = sx[n//2-1]
usiro = sx[n//2]
for i in x:
    if sx.index(i)+1 <= n//2:
        print(usiro)
    else:
        print(mae)

        

### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))
sx = sorted(x)
mae = sx[n//2-1]
usiro = sx[n//2]
for i in x:
    if i<=mae:
        print(usiro)
    else:
        print(mae)
### BUGGY CODE ###

steps, limit = map(int, input().split())
heights = [int(height) for height in input().split()]
costs = [0] * steps
def search(step, num):
    least = float("inf")
    for i in range(1,num+1):
        how_many = costs[step-i] + abs(heights[step-i] - heights[step])
        if how_many < least:
            least = how_many
    costs[step] = least
for i in range(1,steps):
    if i < limit:
        search(i, i)
    else:
        search(i, limit)
print(costs[steps-1])

### FIXED CODE ###

import numpy as np
steps, limit = map(int, input().split())
heights = [int(height) for height in input().split()]
heights = np.array(heights, np.int)
costs = np.array([0] * steps, np.int)
def search(step, num):
    costs[step] = min(costs[step-num:step] + abs(heights[step-num:step] - heights[step]))
for i in range(1,steps):
    if i < limit:
        search(i, i)
    else:
        search(i, limit)
print(costs[steps-1])
### BUGGY CODE ###

import sys
input=sys.stdin.readline
inf=10**9+7
n,m,l=map(int,input().split())
D=[[inf]*(n+1) for _ in range(n+1)]
for _ in range(m):
    a,b,c=map(int,input().split())
    D[a][b]=c
    D[b][a]=c

for k in range(1,n+1):
    for i in range(1,n+1):
        for j in range(1,n+1):
            D[i][j]=min(D[i][j],D[i][k]+D[k][j])

DD=[[inf]*(n+1) for _ in range(n+1)]
for x in range(1,n+1):
    for y in range(1,n+1):
        if D[x][y]<=l:
            DD[x][y]=1

for k in range(1,n+1):
    for i in range(1,n+1):
        for j in range(1,n+1):
            DD[i][j]=min(DD[i][j],DD[i][k]+DD[k][j])

q=int(input())
for _ in range(q):
    s,t=map(int,input().split())
    if DD[s][t]==inf:
        print(-1)
    else:
        print(DD[s][t]-1)

### FIXED CODE ###

import sys
input=sys.stdin.readline
inf=10**9+7
n,m,l=map(int,input().split())
D=[[inf]*(n+1) for _ in range(n+1)]
for _ in range(m):
    a,b,c=map(int,input().split())
    D[a][b]=c
    D[b][a]=c

for k in range(1,n+1):
    for i in range(1,n+1):
        for j in range(1,n+1):
            D[i][j]=min(D[i][j],D[i][k]+D[k][j])

DD=[[inf]*(n+1) for _ in range(n+1)]
for x in range(1,n+1):
    for y in range(1,n+1):
        if D[x][y]<=l:
            DD[x][y]=1

for k in range(1,n+1):
    for i in range(1,n+1):
        for j in range(1,n+1):
            DD[i][j]=min(DD[i][j],DD[i][k]+DD[k][j])

q=int(input())
for _ in range(q):
    s,t=map(int,input().split())
    if DD[s][t]==inf:
        print(-1)
    else:
        print(DD[s][t]-1)
### BUGGY CODE ###

s = input()
k = int(input())
subs = []

for i in range(len(s)):
    for j in range(len(s)):
        subs.append(s[i:i+j+1])

subs = sorted(list(set(subs)))
print(subs[k-1])


### FIXED CODE ###

s = input()
k = int(input())
subs = []

for i in range(len(s)):
    for j in range(k):
        subs.append(s[i:i+j+1])

subs = sorted(list(set(subs)))
print(subs[k-1])
### BUGGY CODE ###

S = input()
S = S[::-1]
L = [0]
i = 0
for x in S:
    tmp = L[-1] + 10 ** i * int(x) % 2019
 #   print(tmp % 2019)
    L.append(tmp % 2019)
    i += 1
L = sorted(L[1::])
def counter(array):
    from collections import Counter
    return list(Counter(array).most_common())
c = counter(L)
from math import factorial
def comb(n,r):
    if n == 1: return 0
    return  n * (n - 1) // 2
ans = 0
for x in c:
    if x[0] == 0: ans += x[1]
    ans += comb(x[1],2)
#print(L,c)
print(int(ans))

### FIXED CODE ###

S = input()
S = S[::-1]
L = [0]
i = 0
for x in S:
    tmp = L[-1] + pow(10, i , 2019) * int(x) 
    L.append(tmp % 2019)
    i += 1
L = sorted(L[1::])
def counter(array):
    from collections import Counter
    return list(Counter(array).most_common())
c = counter(L)
from math import factorial
def comb(n,r):
    if n == 1: return 0
    return  n * (n - 1) // 2
ans = 0
for x in c:
    if x[0] == 0: ans += x[1]
    ans += comb(x[1],2)
print(int(ans))
### BUGGY CODE ###

import math
from functools import lru_cache

@lru_cache(maxsize=None)
def gcd(a, b, c):
    return math.gcd(math.gcd(a, b), c)


k = int(input())
answer = 0
for a in range(1, k + 1):
    for b in range(1, k + 1):
        for c in range(1, k + 1):
            ary = [a, b, c]
            ary.sort()
            answer += gcd(ary[0], ary[1], ary[2])

print(answer)


### FIXED CODE ###

import math
from functools import lru_cache

@lru_cache(maxsize=None)
def gcd(x, y):
    return math.gcd(x, y)


k = int(input())
answer = 0
ary = []
for a in range(1, k + 1):
    for b in range(1, k + 1):
        if a >= b:
            ary.append(gcd(b, a))
        else:
            ary.append(gcd(a, b))

h = {}
for a in ary:
    if a not in h:
        h[a] = 0
    h[a] += 1
# print(h)

for x in h.keys():
    for c in range(1, k + 1):
        answer += gcd(x, c) * h[x]
print(answer)
### BUGGY CODE ###

n = int(input())
a = list(input().split())
q = int(input())
b = list(input().split() for i in range(q))

for i in range(q):
    j = b[i][0]
    k = b[i][1]
    a = [(k if a[i] == j else a[i])for i in range(n)]
    l = [int(i) for i in a]
    print(sum(l))

### FIXED CODE ###

import collections
n = int(input())
a = list(map(int,input().split()))
q = int(input())
l = [list(map(int,input().split())) for i in range(q)]
b,c = [list(i) for i in zip(*l)]
x = collections.Counter(a)
y = sum(a)
for i in range(q):
    if b[i] in x:
        y -= x[b[i]] * b[i]
        y += x[b[i]] * c[i]
        x[c[i]] += x[b[i]]
        x[b[i]] = 0
    print(y)
### BUGGY CODE ###

import math

N = int(input())
S = [0]*N
kaisuu = [0]*N
solution = []
index = 0

for i in range(N):
  tmp = input()
  
  if (tmp in S) == False:
    S[index] = tmp
    kaisuu[index] = 1
    index += 1
  
  if (tmp in S) == True:
    index_tmp = S.index(tmp)
    kaisuu[index_tmp] += 1
  
max_ = max(kaisuu)

for i in range(N):
  if kaisuu[i] == max_:
    solution.append(S[i])

solution.sort()

for i in solution:
  print(i)

### FIXED CODE ###

import collections

N = int(input())
solution = []
S = []

for i in range(N):
  tmp = input()
  S.append(tmp)
  
c = collections.Counter(S)

d = c.most_common()

max_ = d[0][1]

for i,k in enumerate(d):
  if d[i][1] == max_:
    solution.append(d[i][0])
    
solution.sort()

for i in solution:
  print(i)
### BUGGY CODE ###

n,k = map(int,input().split())
lis = list(map(int,input().split()))
tmp = 0
for i,l in enumerate(lis):
    if i+k <= len(lis):
        if (sum(lis[i:i+k])+k)/2 > tmp:
            tmp = (sum(lis[i:i+k])+k)/2
#print(new_lis)
print(tmp)

### FIXED CODE ###

n,k = map(int,input().split())
li = list(map(int,input().split()))
new_li = [0]
for l in li:
    new_li.append(new_li[-1]+(l+1)/2)
# print(new_li)
# [0, 1.0, 2.5, 4.0, 6.5, 9.5]
tmp_li = []
for i,n in enumerate(new_li):
    if i < k-1:
        continue
    tmp_li.append(new_li[i] - new_li[i-k])
    #print(i,i-k)
print(max(tmp_li))