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

X,Y=map(int,input().split())
print(X+Y//2-1)
for i in range(20**7):
  i+=1


### FIXED CODE ###

X,Y=map(int,input().split())
print(X+Y//2)
### BUGGY CODE ###

from functools import reduce
from math import gcd

log = {}
K = int(input())
sum_gcd = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            key = str(sorted([a, b, c]))
            if key in log:
                sum_gcd += log[key]
            else:
                result = gcd(gcd(a, b), c)
                sum_gcd += result
                log[key] = result
print(sum_gcd)


### FIXED CODE ###

from math import gcd

log = {}
K = int(input())
sum_gcd = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            sum_gcd += gcd(gcd(a, b), c)
print(sum_gcd)
### BUGGY CODE ###

s = input()
a = int(s)%2019
mod_N = [0]*2019
mod_N[a] += 1
for i in range(len(s)):
  a = (a-int(s[i])*10**(len(s)-i-1))%2019
  mod_N[a] += 1
ans = 0
for i in mod_N:
  ans += i*(i-1)//2
print(ans)


### FIXED CODE ###

s = input()
a = 0
mods = [0]*2019
mods[a] += 1
r = 1
for i in s[::-1]:
  a = (a+int(i)*r)%2019
  r = r*10%2019
  mods[a] += 1
ans = 0
for i in mods:
  ans += i*(i-1)//2
print(ans)
### BUGGY CODE ###

from collections import Counter

H=int(input())
input_list=[input() for _ in range(H)]
ans_list=[]
list_set=set(input_list)
max_appeard=Counter(input_list).most_common(1)[0][1]
for item in list_set:
    if Counter(input_list)[item] == max_appeard:
        ans_list.append(item)
ans_list.sort()
for item in ans_list:
  print (item)

### FIXED CODE ###

from collections import defaultdict

H=int(input())
d = defaultdict(int)
for _ in range(H):
    d[input()] += 1
max_appeard=max(d.items(), key=lambda x: x[1])[1]
ans=[k for k,v in d.items() if v == max_appeard]
ans.sort()
for item in ans:
  print (item)
### BUGGY CODE ###

import sys
from collections import Counter
input = sys.stdin.readline

def main():
    n=int(input())
    s=list(input())
    q=int(input())
    for i in range(q):
        a,b,c=map(str,input().split())
        if a=='1':
            s[int(b)-1]=c
        else:
            print(len(Counter(s[int(b)-1:int(c)])))

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from bisect import bisect_left,bisect_right,insort
#input = sys.stdin.readline

def main():
    n=int(input())
    s=list(str(input()))
    p=[[] for _ in range(26)]
    for i,S in enumerate(s):
        p[ord(S)-ord('a')].append(i)
    q=int(input())
    for i in range(q):
        a,b,c=map(str,input().split())
        if a=='1':
            b=int(b)-1
            if s[b]==c:
                continue
            else:
                insl=bisect_left(p[ord(s[b])-ord('a')],b)
                p[ord(s[b])-ord('a')].pop(insl)
                insort(p[ord(c)-ord('a')],b)
                s[b]=c
        else:
            b,c=int(b)-1,int(c)-1
            cnt=0
            for i in range(26):
                insl=bisect_left(p[i],b)
                if insl>=len(p[i]):
                    continue
                elif p[i][insl]<=c:
                    cnt+=1
            print(cnt)

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

#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, M_a: int, M_b: int, a: "List[int]", b: "List[int]", c: "List[int]"):
    M = (max(a+b)+1)*N
    DP = [[INF]*(M) for _ in range(M)]
    for aa, bb, cc in zip(a, b, c):
        DP_next = [DP[i][:] for i in range(M)]
        DP_next[aa][bb] = min(cc, DP_next[aa][bb])
        for i in range(1, M):
            for j in range(1, M):
                if i+aa < M and j + bb < M and DP[i][j] > 0:
                    DP_next[i+aa][j+bb] = min(DP[i][j]+cc, DP_next[i+aa][j+bb])
        DP = DP_next

    m = INF
    for i in range(1, M//M_a):
        anum = M_a*i
        bnum = M_b*i
        if anum >= M or bnum >= M:
            break
        if DP[anum][bnum] != 0:
            if m > DP[anum][bnum]:
                m = DP[anum][bnum]
    if m == INF:
        print(-1)
    else:
        print(m)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M_a = int(next(tokens))  # type: int
    M_b = int(next(tokens))  # type: int
    a = [int()] * (N)  # type: "List[int]"
    b = [int()] * (N)  # type: "List[int]"
    c = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, M_a, M_b, a, b, c)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, M_a: int, M_b: int, a: "List[int]", b: "List[int]", c: "List[int]"):
    M = (max(a+b)+1)*N
    DP = [[INF]*(M) for _ in range(M)]
    for aa, bb, cc in zip(a, b, c):
        DP_next = [DP[i][:] for i in range(M)]
        DP_next[aa][bb] = min(cc, DP_next[aa][bb])
        for i in range(1, M):
            if M <= i + aa:
                break
            for j in range(1, M):
                if M <= j+bb:
                    break
                DP_next[i+aa][j+bb] = min(DP[i][j]+cc, DP_next[i+aa][j+bb])
        DP = DP_next

    m = INF
    for i in range(1, M//M_a):
        anum = M_a*i
        bnum = M_b*i
        if anum >= M or bnum >= M:
            break
        m = min(DP[anum][bnum], m)
    if m == INF:
        print(-1)
    else:
        print(m)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M_a = int(next(tokens))  # type: int
    M_b = int(next(tokens))  # type: int
    a = [int()] * (N)  # type: "List[int]"
    b = [int()] * (N)  # type: "List[int]"
    c = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, M_a, M_b, a, b, c)


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

## TLEなのはわかっておる...

import numpy as np
from collections import deque

N = int(input())

# 6^6 < 1e5 < 6^7
# 9^5 < 1e5 < 9^6
# に注目すると大きい金額から引き出してみる全探索で良さそう


drawable = [6, 6**2, 6**3, 6**4, 6**5, 6**6, 9, 9**2, 9**3, 9**4, 9**5, 9**6]
drawable = sorted(drawable, reverse=True)
solver = []

def main():
    dq = deque()
    dq.append((N,0))
    while dq:
        rest, cnt = dq.popleft()
        for draw in drawable:
          rest_afterdraw = rest - draw
          if rest_afterdraw < 0:
            continue
          else:
            if rest_afterdraw < 6:
              solver.append(cnt + rest_afterdraw + 1) 
            else:
              dq.append((rest_afterdraw,cnt+1))

if N < 6:
  print(N)
  exit()
              
main()
print(min(solver))




### FIXED CODE ###

## 解説を見た
## まず9のべき乗の引き出しを行い、その後(最適に)6のべき乗の引き出しを行う
## 9のべき乗の引き出しは全通り行い、残金を全列挙する
## それぞれの残金を6進数で表し、各桁の総和が「6で引き出すコスト」となる

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

def Base_n_to_10(X,n):
    out = 0
    for i in range(1,len(str(X))+1):
        out += int(str(X)[-i])*(n**(i-1))
    return out


N = int(input())

after_draw_9 = []
for i in range(N // 9 + 1):
  cost_9 = sum(map(int, Base_10_to_n(9*i,9)))
  after_draw_9.append((N-9*i, cost_9))
#print(after_draw_9)

solver = []
for i in range(len(after_draw_9)):
  cost_6 = sum(map(int, Base_10_to_n(after_draw_9[i][0], 6)))
  solver.append(after_draw_9[i][1] + cost_6)
  
#print(solver)
print(min(solver))
### BUGGY CODE ###

import copy

h, w = list(map(int, input().split()))
black_list = []
white_list = []
for i in range(h):
  for j, val in enumerate(list(input())):
    if val == "#":
      black_list.append([i,j])
    else:
      white_list.append([i,j])
max_val = 0
for white in white_list:
  min_val = w*h
  for black in black_list:
    diff = abs(white[0]-black[0]) + abs(white[1]-black[1])
    if diff < min_val:
      min_val = diff
  if max_val < min_val:
    max_val = min_val
print(max_val)

### FIXED CODE ###

# python には結構厳しいTLE・・・python以外のお勉強時間ないよ～( ;∀;)
# . から見た # の最大距離の方が楽ではあるが・・・
# 嫌いだけど def main も使ってみた．
from collections import deque
import copy
 
def main():
  H, W = list(map(int, input().split()))
  L = [[j=="#" for j in input()] for i in range(H)]
  q = deque([(i, j) for i in range(H) for j in range(W) if L[i][j]])
  cands = [(0, -1), (0, 1), (-1, 0), (1, 0)]
  result = 0
  while True:
    nq = deque()
    while q:
      i, j = q.popleft()
      if i > 0 and not L[i-1][j]:
        L[i-1][j] = True
        nq.append((i-1, j))
      if j > 0 and not L[i][j-1]:
        L[i][j-1] = True
        nq.append((i, j-1))
      if i < H-1 and not L[i+1][j]:
        L[i+1][j] = True
        nq.append((i+1, j))
      if j < W-1 and not L[i][j+1]:
        L[i][j+1] = True
        nq.append((i, j+1))
    if nq:
      q = copy.copy(nq)
    else:
      break    
    result += 1
  print(result)
 
if __name__ == "__main__":
  main()
### BUGGY CODE ###

from collections import deque


n = int(input())
graph = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    graph[a - 1] += [b - 1]
    graph[b - 1] += [a - 1]



def dfs(graph, start, goal):
    que = deque([start])
    pre = [-1] * n
    while que:
        cur = que.popleft()
        for nxt in graph[cur]:
            if nxt == pre[cur]:
                continue
            pre[nxt] = cur
            if nxt == goal:
                break
            que.append(nxt)
    return pre




pre = dfs(graph, 0, n-1)
route = [n-1]
while route[0]!=0:
    route = [pre[route[0]]] + route

limit_num = (len(route) - 1) // 2
black_node = route[limit_num]
white_node = route[limit_num + 1]
graph[black_node].remove(white_node)


def dfs_cnt(graph, start):
    que = deque([start])
    pre = [-1] * n
    while que:
        cur = que.popleft()
        for nxt in graph[cur]:
            if nxt == pre[cur]:
                continue
            pre[nxt] = cur
            que.append(nxt)
    cnt = len([i for i in pre if i!=-1])+1
    return cnt


black_cnt = dfs_cnt(graph, 0)
white_cnt = n - black_cnt


if black_cnt > white_cnt:
    print('Fennec')
else:
    print('Snuke')

### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
graph = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b = LI()
    graph[a - 1] += [b - 1]
    graph[b - 1] += [a - 1]




f_que = deque([0])
s_que = deque([n - 1])
visited = [0] * n
visited[0] = 1
visited[n - 1] = 1
f_cnt = s_cnt = 0
while f_que or s_que:
    f_tmp = deque()
    for cur in f_que:
        for nxt in graph[cur]:
            if visited[nxt]:
                continue
            f_tmp += [nxt]
            visited[nxt] = 1
            f_cnt += 1
    f_que = f_tmp
    s_tmp = deque()
    for cur in s_que:
        for nxt in graph[cur]:
            if visited[nxt]:
                continue
            s_tmp += [nxt]
            visited[nxt] = 1
            s_cnt += 1
    s_que = s_tmp


if s_cnt >= f_cnt:
    print('Snuke')
else:
    print('Fennec')
### BUGGY CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]
# print(A)
for i, v in enumerate(A):
  mylist = A[:]
  mylist[i:i+1] = []
  # print(mylist)
  print(max(mylist))

### FIXED CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]
B = A[:]
B.sort(reverse=True)
# print(A)
fmax = B[0]
smax = B[1]
for i in A:
  if i == fmax:
    print(smax)
  else:
    print(fmax)
### BUGGY CODE ###

def main():
    n, k = map(int, input().split())
    s = set()
    # lr = []
    for _ in range(k):
        l, r = map(int, input().split())
        # lr.append(tuple(map(int, input().split())))
        for tmp in range(l, r+1):
            s.add(tmp)
    mod = 998244353
    
    dp = [0]*n
    dp[0] = 1
    
    for i in range(1, n):
        # for l, r in lr:
        for ss in s:
            if i-ss >= 0:
                dp[i] += dp[i-ss]
        dp[i] %= mod
    
    print(dp[-1]%mod)


main()

### FIXED CODE ###

n, k = map(int, input().split())
lr = []
for _ in range(k):
    lr.append(tuple(map(int, input().split())))
mod = 998244353

dp = [0]*n
dp[0] = 1

acc = [0]*n
acc[0] = 1

for i in range(1, n):
    for l, r in lr:
        if 0 <= i-r and i-l < i:
            dp[i] += acc[i-l]-acc[i-r-1]
        elif i-r < 0 and i-l < i:
            dp[i] += acc[i-l]
        elif i-r < 0 and i <= i-l:
            dp[i] += acc[i-1]
        elif 0 < i-r and i <= i-l:
            dp[i] += acc[i-1]-acc[i-r-1]
    acc[i] = acc[i-1]+dp[i]%mod

print(dp[-1]%mod)
### BUGGY CODE ###

s=input()
x,y=map(int, input().split())
h=[(1,0),(0,1),(-1,0),(0,-1)]
nh=0
p={(0,0,0)}
for k in s:
    np=set()
    for i,j,ho in p:
        if k=='F':
            np.add((i+h[ho][0],j+h[ho][1],ho))
        else:
            np.add((i,j,(ho+1)%4))
            np.add((i,j,(ho+3)%4))
    p=np
ans='No'
for i,j,ho in p:
    if i==x and j==y:ans='Yes'
print(ans)

### FIXED CODE ###

s=input()
x,y=map(int, input().split())
sl=[len(i) for i in s.split('T')]
a,b={0:1},{0:1}
for i in sl[2::2]:
    if i==0:continue
    a2={}
    for j in a.keys():
        a2[j+i]=1
        a2[j-i]=1
    a=a2
for i in sl[1::2]:
    if i==0:continue
    b2={}
    for j in b.keys():
        b2[j+i]=1
        b2[j-i]=1
    b=b2
if x-sl[0] in a and y in b:print('Yes')
else:print('No')
### BUGGY CODE ###

A , B , M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = []
for i in range(A):
    for j in range(B):
        x = a[i] + b[j]
        ans.append(x)
for i in range(M):
    q = list(map(int, input().split()))
    x = a[q[0]-1] + b[q[1]-1] - q[2]
    ans.append(x)
print(min(ans))

### FIXED CODE ###

A , B , M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = [min(a) + min(b)]
for i in range(M):
    q = list(map(int, input().split()))
    x = a[q[0]-1] + b[q[1]-1] - q[2]
    ans.append(x)
print(min(ans))
### BUGGY CODE ###

N,M = map(int, input().split())
L = []
C = []
for i in range(M):
    L.append([int(l) for l in input().split()])
    C.append([int(c) for c in input().split()])
    
dp = [[10**8+1 for j in range(2**N)] for i in range(M+1)]

for i in range(M+1):
    dp[i][0] = 0

    
for i in range(1, M+1):
    temp = 0
    for k in range(len(C[i-1])):
        temp += 2**(C[i-1][k]-1)
    if i == 1:
        for j in range(1, 2**N):
            if j | temp == temp:
                dp[i][j] = L[i-1][0]
                l = i+1
                while l <= M:
                    dp[l][j] = dp[i][j]
                    l += 1

    else:
        for j in range(2**N):
            dp[i][temp | j] = min(dp[i-1][temp | j], dp[i-1][j]+L[i-1][0], dp[i][temp | j])
            l = i+1
            while l <= M:
                dp[l][temp | j] = dp[i][temp | j]
                l += 1


if dp[-1][-1] >= 10**8+1:
    print(-1)
else:
    print(dp[-1][-1])

### FIXED CODE ###

N,M = map(int, input().split())
L = []
C = []
for i in range(M):
    L.append([int(l) for l in input().split()])
    C.append([int(c) for c in input().split()])
    
dp = [10**8+1 for j in range(2**N)]
dp[0] = 0

for i in range(1, M+1):
    temp = 0
    for k in range(len(C[i-1])):
        temp += 2**(C[i-1][k]-1)
    for j in range(2**N):
        if i == 1:
            if j | temp == temp and j != 0:
                dp[j] = L[i-1][0]

        else:
            dp[temp | j] = min(dp[temp | j], dp[j]+L[i-1][0])
      
if dp[-1] >= 10**8+1:
    print(-1)
else:
    print(dp[-1])
### BUGGY CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]
ans = 0
now = -1
while A:
  now = -1
  B = []
  cnt = 0
  used = [0 for _ in range(N)]
  for i in range(len(A)):
    a = A[i]
    if now < a:
      now = a
    else:
      B.append(a)
  A = B[:]
  ans += 1
print(ans)

### FIXED CODE ###

import bisect
N = int(input())
A = [int(input()) for _ in range(N)]
b = []
for a in A[::-1]:
  idx = bisect.bisect_right(b, a)
  if len(b) <= idx:
    b.append(a)
  else:
    b[idx] = a

print(len(b))
### BUGGY CODE ###

N,K =map(int,input().split())
S =input()
lis = [[],[]]
if S[0]=="0":
    lis[1].append(0)
st = []
j = S[0]
su = 0
for i in S:
    if i ==j:
        su += 1
    else:
        lis[int(j)].append(su)
        st.append(j)
        j = i
        su = 1
lis[int(j)].append(su)
st.append(j)
if j=="0":
    lis[1].append(0)
if len(lis[0])<=K:
    print(N)
else:
    ans = 0
    for i in range(len(lis[0])+1-K):    
        foo = sum(lis[0][i:i+K]) + sum(lis[1][i:i+K+1])
        if ans < foo:
            ans = foo
    print(ans)


### FIXED CODE ###

N,K =map(int,input().split())
S =input()
lis = [[],[]]
if S[0]=="0":
    lis[1].append(0)
j = S[0]
su = 0
for i in S:
    if i ==j:
        su += 1
    else:
        lis[int(j)].append(su)
        j = i
        su = 1
lis[int(j)].append(su)
if j=="0":
    lis[1].append(0)
if len(lis[0])<=K:
    print(N)
else:
    ans = 0

    ans = sum(lis[0][0:K]) + sum(lis[1][0:K+1])
    foo = ans
    for i in range(len(lis[0])-K):
        foo += lis[0][K+i] -lis[0][i] +lis[1][K+1+i] -lis[1][i]
        if ans < foo:
            ans = foo
    print(ans)
### BUGGY CODE ###

n = int(input())
a = []
for i in range(n):
  a.append(int(input()))

for j in range(n):
  b = a.copy()
  aj = a[j]
  b.remove(a[j])
  print(max(b))
  


### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
b = a.copy()
m = max(a)
b2 = b.remove(m)
mb = max(b)
for j in a:
  if j < m:
    print(m)
  elif j == m:
    print(mb)
### BUGGY CODE ###

N = input()
ans = 0
for i in range(len(N)):
    for j in range(i+3,len(N)):
        if int(N[i:j+1])%2019 == 0:
            ans += 1
print(ans)

### FIXED CODE ###

import sys
import math
import itertools
import collections
from collections import deque
from collections import defaultdict

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
MOD2 = 998244353
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def combinations_count(n, r):
    if n == 1:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    S = SI()
    
    ls = []
    len_S = len(S)
    rem = 0

    for s in range(len_S-1,-1,-1):
        rem = (rem+int(S[s])* pow(10, len_S-s-1, 2019))%2019
        ls.append(rem)
    
    import collections

    cls = collections.Counter(ls)
    clsv= list(cls.values())

    ans = 0

    for p in clsv:
        ans += combinations_count(p,2)
    ans += cls[0]
    print(ans)



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

def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def main():
    H, N = read_values()
    M = [read_list() for _ in range(N)]

    dp = [10 ** 12] * (H + max(M, key=lambda m: m[0])[0] + 10)
    dp[0] = 0
    for h in range(H + 1):
        for a, b in M:
            dp[h + a] = min(dp[h + a], dp[h] + b)
    
    print(min(dp[H:]))


if __name__ == "__main__":
    main()


### FIXED CODE ###

def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def main():
    H, N = read_values()
    M = [read_list() for _ in range(N)]

    dp = [10 ** 12] * (H + max(M, key=lambda m: m[0])[0] + 10)
    dp[0] = 0
    for h in range(H + 1):
        for a, b in M:
            dp[h + a] = min(dp[h + a], dp[h] + b)
    
    print(min(dp[H:]))


if __name__ == "__main__":
    main()
### BUGGY CODE ###

n,k,*a=map(int,open(0).read().split())
for i in range(n-k):
    if sum(a[i+1:k+i+1])>sum(a[i:k+i]):
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n,k,*a=map(int,open(0).read().split())
multiple=1
#for i in range(k):
#    multiple*=a[i]
for j in range(n-k):
    if a[j+k]>a[j]:
        print('Yes')
    else:
        print('No')
#    multiple=multiple*a[j+k]/a[j]
### BUGGY CODE ###

# Problem B - Training Camp

# input process
N = int(input())

# initialization
frac_num = 1
INF = 10**9 + 7

for i in range(1, N+1):
    frac_num = frac_num * i

print(frac_num%INF)


### FIXED CODE ###

# Problem B - Training Camp

# input process
N = int(input())

# initialization
frac_num = 1
INF = 10**9 + 7

for i in range(1, N+1):
    frac_num = (frac_num * i) % INF

print(frac_num%INF)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
import collections

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

def bfs(i, j):
    dist = [-1]*N
    dist[i] = 0
    que = collections.deque([])
    que.append(i)
    
    while len(que) != 0:
        v = que.popleft()
        for nv in graph[v]:
            if dist[nv] != -1:continue
            dist[nv] = dist[v]+1
            que.append(nv)
    return dist[j]

graph = {}
for i in range(N):
    graph[i] = set()

for i in range(N-1):
    graph[i].add(i+1)
    graph[i+1].add(i)
graph[X-1].add(Y-1)
graph[Y-1].add(X-1)

ans = [0]*N
for i in range(N):
    for j in range(i+1,N):
        d = bfs(i,j)
        ans[d] += 1
for i in range(N):
    if i == 0:continue
    print(ans[i])

### FIXED CODE ###

import sys
input = sys.stdin.readline
import collections

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

def dist(i,j):
    return min(abs(j-i), abs(X-i)+1+abs(j-Y))

ans = [0]*N
for i in range(N):
    for j in range(i+1, N):
        d = dist(i+1,j+1)
        ans[d] += 1
for i in range(N):
    if i == 0:
        continue
    print(ans[i])
### BUGGY CODE ###

class AC:
    @staticmethod
    def inputStr(char):
        return input().split(char)
    
    @staticmethod
    def inputInt(char):
        a = input().split(char)
        for i in range(len(a)):
            a[i] = int(a[i])
        return a

inp = AC.inputInt(" ")
takahashi = inp[0]
aoki = inp[1]
K = inp[2]

for i in range(K):
    if takahashi > 0 :
        takahashi = takahashi -1
    elif aoki > 0 :
        aoki = aoki-1

print(str(takahashi) + " " + str(aoki))

### FIXED CODE ###

A,B,K = map(int,input().split(" "))
if A+B < K:print(0,0)
elif A > K:print(A-K,B)
elif A  <= K:print(0,A+B-K)
# Kenparさん、写経させていただきました。ありがとうございます。
# こんな解法があったなんて・・・
### BUGGY CODE ###

import decimal

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

S = 0
reg = 0

for i in range(n-k+1):
    if S < sum(p[i:i+k]):
        S = sum(p[i:i+k])
        reg = i
        

ans = 0
for j in range(k):
    ans += 1 / 2 * (p[reg + j] + 1)

print(ans)

### FIXED CODE ###

n , k = map(int, input().split())
p = list(map(int, input().split()))
p_accu = [p[0] + 1]

if k == 1:
    print((max(p) + 1 ) / 2 )
    exit()
elif k == n:
    print((sum(p) + n ) / 2 )
    exit()

for i in range(1, n):
    p[i] += p[i-1] + 1
    p_accu.append(p[i])

S = p_accu[k-1]

for i in range(n - k):
    if S < p_accu[i+k] - p_accu[i]:
        S = p_accu[i+k] - p_accu[i]
    
print(S/2)