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

def factorize(a):
    x=2
    ret=[]
    while x<=a:
        while a%x==0:
            a//=x
            ret.append(x)
        x+=1
    return ret

def gcd(a,b):
    tmp=a
    a=max(a,b)
    b=min(tmp,b)
    if(a%b==0):
        return b
    return gcd(b,a%b)

a,b=map(int,input().split())
print(len(set(factorize(gcd(a,b))))+1)


### FIXED CODE ###

def factorize(a):
    x=2
    ret=[]
    rt_a=a**0.5
    while x<=a:
        if(x>=rt_a):
            ret.append(a)
            break
        if(a%x==0):
            ret.append(x)
        while a%x==0:
            a//=x
        x+=1
    return ret

def gcd(a,b):
    tmp=a
    a=max(a,b)
    b=min(tmp,b)
    if(a%b==0):
        return b
    return gcd(b,a%b)

a,b=map(int,input().split())
print(len(set(factorize(gcd(a,b))))+1)
### BUGGY CODE ###

n=int(input())
a=[]
for i in range(n):
  word=input()
  if word not in a:
    a.append(word)
print(len(a))



### FIXED CODE ###

n=int(input())
a=[]
 
for i in range(n):
  word=input()
  a.append(word)
print(len(set(a)))
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
l = []
for i in range(n):
  if a[i] < 2*10**5-1:
    l.append((i, a[i]))
count = 0
for i in range(len(l)-1):
  for j in range(i+1, len(l)):
    if l[j][0]-l[i][0] == l[j][1]+l[i][1]:
      count += 1
print(count)

### FIXED CODE ###

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

lr = [[0,0] for i in range(n)]

for i in range(n):
  l = i+a[i]
  if l < n:
    lr[l][0] += 1
  r = i-a[i]
  if r > 0:
    lr[r][1] += 1
count = 0
for i in range(n):
  count += lr[i][0] * lr[i][1]
print(count)
### BUGGY CODE ###

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

gakki_sum = 1
gakki_sum_new = 1
for j in range(K):
        gakki_sum *= A[j]

for i in range( K+1, N+1):
    for j in range(K):
        gakki_sum_new *= A[i-K+j]
    if gakki_sum < gakki_sum_new:
        print("Yes")
    else:
        print("No")
    gakki_sum = gakki_sum_new
    gakki_sum_new = 1


### FIXED CODE ###

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

for i in range(K, N):
    
    if A[i-K] < A[i]:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

x=int(input())
i=1
if 1<=x<=179:
	while True:
		if 360/x==int(360/x):
			print(int(360/x))
			break
		else:
			i+=1



### FIXED CODE ###

x=int(input())
i=1
if 1<=x<=179:
	while True:
		if 360*i%x==0:
			print(int(360*i/x))
			break
		else:
			i+=1
### BUGGY CODE ###

import sys
readline = sys.stdin.buffer.readline

H, W = list(map(int, readline().split()))
CH, CW = list(map(int, readline().split()))
DH, DW = list(map(int, readline().split()))
S = []
for _ in range(H):
    S.append(list(input()))

import heapq
seen = set()
queue = [(0, CH-1, CW-1)]

while queue:
    move, row, col = heapq.heappop(queue)

    if (row, col) in seen:
        continue
    # print(row, col, S[row][col], move, queue)
    if row == DH-1 and col == DW-1:
        print(move)
        sys.exit(0)

    seen.add((row, col))

    for r_offset, c_offset in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
        new_row = row + r_offset
        new_col = col + c_offset
        if 0 <= new_row < H and 0 <= new_col < W and S[new_row][new_col] == '.':
            heapq.heappush(queue, (move, new_row, new_col))


    for i in range(-2, 3):
        for j in range(-2, 3):
            if i == 0 and j == 0:
                continue
            new_row = row + i
            new_col = col + j

            if 0 <= new_row < H and 0 <= new_col < W and S[new_row][new_col] == '.':
                heapq.heappush(queue, (move+1, new_row, new_col))

print(-1)


### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline

H, W = list(map(int, readline().split()))
CH, CW = list(map(int, readline().split()))
DH, DW = list(map(int, readline().split()))
S = []
for _ in range(H):
    S.append(list(input()))

# 1-index -> 0-index
CH -= 1
CW -= 1
DH -= 1
DW -= 1

from collections import deque
seen = set()
queue = deque([(0, CH, CW)])
offsets = [(-1, 0), (1, 0), (0, -1), (0, 1)]

while queue:
    move, row, col = queue.popleft()

    # print(row, col, queue)

    if (row, col) in seen:
        continue

    if row == DH and col == DW:
        print(move)
        sys.exit(0)

    seen.add((row, col))

    for r_offset, c_offset in offsets:
        new_row = row + r_offset
        new_col = col + c_offset
        if 0 <= new_row < H and 0 <= new_col < W and S[new_row][new_col] == '.' and (new_row, new_col) not in seen:
            queue.appendleft((move, new_row, new_col))


    for i in range(-2, 3):
        for j in range(-2, 3):
            new_row = row + i
            new_col = col + j

            if 0 <= new_row < H and 0 <= new_col < W and S[new_row][new_col] == '.' and (new_row, new_col) not in seen:
                queue.append((move+1, new_row, new_col))

print(-1)
### BUGGY CODE ###

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

S = [input() for i in range(H)]

L,R,U,D = [[[0]*W for i in range(H)] for i in range(4)]

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            if i != 0:
                U[i][j] = U[i-1][j]+1
            else:
                U[i][j] = 1
            if j != 0:
                L[i][j] = L[i][j-1]+1
            else:
                L[i][j] = 1
            
        else:
            U[i][j] = 0
            L[i][j] = 0

        ri = H-i-1
        rj = W-j-1
        if S[ri][rj] == ".":
            if i != 0:
                D[ri][rj] = D[ri+1][rj]+1
            else:
                D[ri][rj] = 1
            if j != 0:
                R[ri][rj] = R[ri][rj+1]+1
            else:
                R[ri][rj] = 1
        else:
            D[ri][rj] = 0
            R[ri][rj] = 0


ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans,L[i][j]+R[i][j]+U[i][j]+D[i][j]-3)

print(ans)

### FIXED CODE ###

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

S = [input() for i in range(H)]

L,R,U,D = [[[0]*W for i in range(H)] for i in range(4)]

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            if i != 0:
                U[i][j] = U[i-1][j]+1
            else:
                U[i][j] = 1
            if j != 0:
                L[i][j] = L[i][j-1]+1
            else:
                L[i][j] = 1
            
        else:
            U[i][j] = 0
            L[i][j] = 0

        ri = H-i-1
        rj = W-j-1
        if S[ri][rj] == ".":
            if i != 0:
                D[ri][rj] = D[ri+1][rj]+1
            else:
                D[ri][rj] = 1
            if j != 0:
                R[ri][rj] = R[ri][rj+1]+1
            else:
                R[ri][rj] = 1
        else:
            D[ri][rj] = 0
            R[ri][rj] = 0


ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans,L[i][j]+R[i][j]+U[i][j]+D[i][j]-3)

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

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

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

count = Counter(A)
check = {}
for num in A:
    ans = 0
    if num in check.keys():
        ans += check[num]
    else:
        for key, value in count.items():
            if key == num:
                ans += (value-1)*(value-2)//2
            else:
                ans += value*(value-1)//2
        check[num] = ans
    print(ans)


### FIXED CODE ###

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

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

count = Counter(A)
sm = {}
sm2 = {}
for key, value in count.items():
    sm[key] = value*(value-1)//2
    sm2[key] = (value-1)*(value-2)//2
total = sum(sm.values())

for num in A:
    print(total - sm[num] + sm2[num])
### BUGGY CODE ###

from math import pow
S = input()
S = list(S)
S.reverse()
l = len(S)
dp =[ [0] * 13 for _ in range(l + 1)]
dp[0][0] = 1
MOD = 10 ** 9 + 7
keta = 1
for k,c in enumerate(S):
    if c == "?":
        for i in range(0,10): # ? に入る候補達
            for amari in range(0, 13):
                next_amari = (amari + i * keta ) % 13
                dp[k + 1][next_amari] += (dp[k][amari] )
                dp[k + 1][next_amari] %= MOD
    else:
        i = int(c)
        for amari in range(0,13):
            next_amari = (amari + i * keta ) % 13
            dp[k + 1][ next_amari] += (dp[k][amari])
            dp[k + 1][next_amari] %= MOD

    keta *= 10   
    # keta %= MOD なんで？


print(dp[l][5])


### FIXED CODE ###


import sys

S =  sys.stdin.readline()[:-1]
l = len(S)
# S = S[::-1]
S = list(reversed(S))

dp =[[0 ] * 13 for _ in range(l + 1)]
kurai = 1
MOD = (10 ** 9) + 7
dp[0][0] = 1

for keta in range(len(S)):
    c =S[keta]

    if c == "?":
        for j in range(0,10):
            kurai %= 13
            temp = (j * kurai) % 13
            for i in range(13):
                dp[keta + 1][(temp + i) % 13] += (dp[keta][i] )
                dp[keta + 1][(temp + i) % 13] %= MOD
    else:
        kurai %= 13

        temp = (int(c) * kurai) % 13
        for i in range(13):
            dp[keta + 1][(temp + i) % 13]  += (dp[keta][i] )
            dp[keta + 1][(temp + i) % 13] %= MOD
    kurai *= 10
    keta %= MOD
print(dp[-1][5] )
### BUGGY CODE ###

n = int(input())

s = []
for i in range(n):
    s.append("".join(sorted(input())))
s.sort()

a = 0
for i in range(len(s)-1):
    for j in range(i+1, len(s)):
        if s[i] == s[j]: a = a+1
        else: break
print(a)

### FIXED CODE ###

n = int(input())

s = []
for i in range(n):
    s.append("".join(sorted(input())))
s.sort()

a = 0
r = 0
i = 1
l = len(s)
while i < l:
    if s[i] == s[i-1]:
        r = r+1
    else:
        a = a + sum(range(r+1))
        r = 0
    i = i+1

if r > 0: a = a + sum(range(r+1))
print(a)
### BUGGY CODE ###

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def add(num):
    n = 0
    for i in range(N):
        if num[i] >= 2:
            n = n + comb(num[i], 2)
    return n


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

num = [0] * N

for i in range(N):
    num[A[i] - 1] = num[A[i] - 1] + 1

for i in range(N):
    num[A[i] - 1] = num[A[i] - 1] - 1
    print(add(num))
    num[A[i] - 1] = num[A[i] - 1] + 1

### FIXED CODE ###

import math

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

num = [0] * N

for i in A:
    num[i - 1] = num[i - 1] + 1

a = [0] * N
b = [0] * N

for i in range(N):
    if num[i] >= 2:
        a[i] = (num[i] - 1) * (num[i] - 2) // 2
        b[i] = num[i] - 1

sum_a = sum(a)
sum_b = sum(b)

for i in A:
    print(sum_a + sum_b - b[i - 1])
### BUGGY CODE ###

N = int(input())
A = []
for i in range(N):
    A.append(input())

List = []
for i in range(N):
    temp = {}
    for j in range(10):
        if A[i][j] in temp:
            temp[A[i][j]] += 1
        else:
            temp[A[i][j]] = 1
    List.append(temp)

    
ans = 0
i = 0
while i < len(List):
    j = i+1
    num = 1
    if List[i] != 0:
        while j < len(List):
            if List[i] == List[j]:
                num += 1
                List[j] = 0
            j += 1
        ans += (num*(num-1)*0.5)
    i += 1

print(int(ans))

### FIXED CODE ###

N = int(input())
S = [input() for _ in range(N)]

L = ["0"]*N
for i in range(N):
    temp = ["0"]*10
    for j in range(10):
        temp[j] = S[i][j]
    temp.sort()
    L[i] = temp
        
L.sort()
ans = 0
cnt = 1
temp = L[0]
for i in range(1, N):
    if temp == L[i]:
        cnt += 1
    else:
        ans += cnt*(cnt-1)//2
        cnt = 1
        temp = L[i]
        
ans += cnt*(cnt-1)//2
print(ans)
### BUGGY CODE ###

n = int(input())
uvw = []
for i in range(n-1):
    uvw.append(list(map(int, input().split(' '))))
uvw.sort()
result = [0]*(n+1)
result[uvw[0][1]] = uvw[0][2]
s = uvw[0][0]
del uvw[0]
n_visit = []
horyuu = []
count = n-2
while count > 0:
    for i in range(len(uvw)):
        if result[uvw[i][0]] == 0 and result[uvw[i][1]] != 0 and uvw[i][0] != s:
            result[uvw[i][0]] =  result[uvw[i][1]] + uvw[i][2]
            count -= 1
        elif result[uvw[i][0]] != 0 and result[uvw[i][1]] == 0 and uvw[i][1] != s:
            result[uvw[i][1]] =  result[uvw[i][0]] + uvw[i][2]
            count -= 1
        else:
            if uvw[i][1] != s and uvw[i][0] == s:
                result[uvw[i][1]] = uvw[i][2]
                count -= 1
            elif uvw[i][0] != s and uvw[i][1] == s:
                result[uvw[i][0]] = uvw[i][2]
                count -= 1
            else:
                horyuu.append(uvw[i])
    uvw = horyuu
    horyuu = []

for i in range(1,n+1):
    if result[i]%2 == 0:
        print(0)
    else:
        print(1)

### FIXED CODE ###

from collections import deque

n = int(input())
visit = [-1 for _ in range(n+1)]
friends = [[] for _ in range(n+1)]
for i in range(n-1):
    u, v, w = map(int, input().split())
    friends[u].append([v, w])
    friends[v].append([u, w])

q = deque([1])
visit[1] = 0
while q:
    position = q.popleft()
    for i, cost in friends[position]:
        if visit[i] < 0:
            visit[i] = visit[position] + cost
            q.append(i)

for i in visit[1:]:
    print(i%2)
### BUGGY CODE ###

# C - Reconciled?
N, M = map(int, input().split())
ans_N = 1
ans_M = 1

if abs(N - M) >= 2:
    print(0)
else:
    for i in range(N):
        ans_N_1 = (M-i)*(N-i) % (10**9+7)
        ans_N = ans_N * ans_N_1

    for j in range(M):
        ans_M_1 = (M-j)*(N-j) % (10**9+7)
        ans_M = ans_M * ans_M_1
    print(ans_N+ans_M)

### FIXED CODE ###

# C - Reconciled?
N, M = map(int, input().split())
ans_N = 1
ans_M = 1
mod = 10**9+7

if abs(N - M) >= 2:
    print(0)
else:
    for i in range(N):
        ans_N = ans_N * ((M - i) * (N - i)) % mod
    for j in range(M):
        ans_M = ans_M * ((M - j) * (N - j)) % mod
    print((ans_N+ans_M)% mod)
### BUGGY CODE ###

from collections import deque
h,w = map(int,input().split())
grid = []
dq = deque([])
dx = [1,-1,0,0]
dy = [0,0,1,-1]
ans = 0
d = [[-1 for i in range(w)] for j in range(h)]
for i in range(h):
    maze = list(input())
    for j in range(w):
        if maze[j] == "#":
            dq.append((j,i))
            d[i][j] = 0
    grid.append(maze)
while dq:
    x,y = dq.popleft()
    for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if 0 <= nx <= w-1 and 0 <= ny <= h-1 and grid[ny][nx] != "#" and d[ny][nx] == -1:
            dq.append((nx,ny))
            d[ny][nx] = d[y][x] + 1
            ans = max(ans,d[ny][nx])
print(ans)

### FIXED CODE ###

from collections import deque
h,w = map(int,input().split())
grid = []
dq = deque([])
dx = [1,-1,0,0]
dy = [0,0,1,-1]
ans = 0
d = [[-1 for i in range(w)] for j in range(h)]
for i in range(h):
    maze = list(input())
    for j in range(w):
        if maze[j] == "#":
            dq.append((j,i))
            d[i][j] = 0
    grid.append(maze)
while dq:
    x,y = dq.popleft()
    for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if 0 <= nx <= w-1 and 0 <= ny <= h-1 and grid[ny][nx] != "#" and d[ny][nx] == -1:
            dq.append((nx,ny))
            d[ny][nx] = d[y][x] + 1
            ans = max(ans,d[ny][nx])
print(ans)
### BUGGY CODE ###

h, w = map(int, input().split())
maze = []
for i in range(h):
    maze.append(list(input()))

import collections
# print(dat)
def clear_maze(sx, sy, gx, gy):
    INF = 100000000
    field_x_length = len(maze)
    field_y_length = len(maze[0])
    distance = [[INF for i in range(40)] for j in range(40)]

    def bfs():
        queue = collections.deque([])
        queue.appendleft((sx, sy))
        distance[sx][sy] = 0
        while len(queue):
            x, y = queue.pop()
            if x == gx and y == gy:
                break
            # print("seek {0} {1}".format(x, y))
            for i in range(0, 4):
                nx, ny = x + [1, 0, -1, 0][i], y + [0, 1, 0, -1][i]
                if (0 <= nx and nx < field_x_length and 0 <= ny and ny < field_y_length and maze[nx][ny] != '#' and
                        distance[nx][ny] == INF):
                    queue.appendleft((nx, ny))
                    distance[nx][ny] = distance[x][y] + 1
        return distance[gx][gy]

    return bfs()

res = -1
for yy in range(0, h):
    for xx in range(0, w):
        if maze[yy][xx] == "#":
            continue
        for yyy in range(0, h):
            for xxx in range(xx, w):
                if maze[yyy][xxx] == "#":
                    continue
                step = clear_maze(yy, xx, yyy, xxx)
                # print("s={0},{1} g={2},{3} cost = {4}".format(xx,yy,xxx,yyy,step))
                if step == 100000000:
                    continue
                res = max(res, step)
print(res)

### FIXED CODE ###

from pprint import pprint

INF = 1000000
dx = [1, -1, 0,  0]
dy = [0,  0, 1, -1]

# 入力
h, w = map(int, input().split())
maze = []
for i in range(h):
    maze.append(list(input()))

# ワーシャルフロイド用に枠を作る。
# 2次元マップしてもいいが面倒なので、１次元にする。[0 - x][0 - y]を[0- x * y]にflattenする
wsmap = lambda a, b: (a * w + b)
dp = []
# 辺がない時はINFを入れのでデフォルト値とする
for i in range(h * w):
    dp.append([INF] * (h * w))

# 迷路ををグラフにする。
for y in range(h):
    for x in range(w):
        if maze[y][x] == "#": # そのマスが壁なら何もしない(他のマストの連結はないので)
            continue
        # ワーシャルフロイドでは自分自身へのコストは0にしておく。
        dp[wsmap(y, x)][wsmap(y, x)] = 0
        # ４方向に移動できるかの判定
        for dir in range(len(dx)):
            nx, ny = x + dx[dir], y + dy[dir]
            if -1 < nx and nx < w and -1 < ny and ny < h: # 枠をはみ出ないかチェック
                if maze[ny][nx] != "#": # そのマスが壁でないなら
                    #print(wsmap(y, x))
                    #print("--")
                    #print("y, x {0}, {1}".format(ny, nx))
                    #print(wsmap(ny, nx))
                    dp[wsmap(y, x)][wsmap(ny, nx)] = 1 # コストを1にする

# ワーシャルフロイドする
for kk in range(h * w):
    for ii in range(h * w):
        for jj in range(h * w):
            dp[ii][jj] = min(dp[ii][jj], dp[ii][kk] + dp[kk][jj])

# これで結果が出たので
#print(dp)
res = -1
for i in range(h * w):
    for j in range(h * w):
        if dp[i][j] != INF:
            res = max(res, dp[i][j])
print(res)
### BUGGY CODE ###

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

#n! = a p^eとしたときのeを求める (O(logp n)
def mod_e(n,p):
    res = 0
    while n >= p:
        res += n//p
        n = n//p
    return res

#n! = a p^eとしたときのa mod pを求める  (O(logp n)
def mod_fact(n,p):
    if n==0:
        return 1
    
    
    res = mod_fact(n//p,p)
    
    if n//p %2 != 0:
        return res*(p-fact[n%p])%p
    return res*fact[n%p]%p
    
######################################################

#nCk mod p
def mod_comb(n,k):
    if n < 0 or k < 0 or n<k:
        return 0
    e1 = mod_e(n,p)
    e2 = mod_e(k,p)
    e3 = mod_e(n-k,p)
    #pで割り切れる場合
    if e1 > e2 + e3:
        return 0

    #pで割り切れない場合
    a1 = mod_fact(n,p)
    a2 = mod_fact(k,p)
    a3 = mod_fact(n-k,p)
    return a1 * mod_inv(a2*a3%p,p) %p
######################################################

h,w,a,b = map(int,input().split())
#pは素数とする
p = 10**9+7
#fact[i] : i! modp (0<= i <p) O(p)
fact = [1]
k = 1
for i in range(1,10**6+100):
    k = k*i%p
    fact.append(k)

res = 0
for i in range(h-a):
    res += mod_comb(i+b-1,b-1)*mod_comb(h-i-1+w-b-1,w-b-1)
    res = res%p
print(res)

### FIXED CODE ###

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

#n! = a p^eとしたときのeを求める (O(logp n)
def mod_e(n,p):
    res = 0
    while n >= p:
        res += n//p
        n = n//p
    return res

#n! = a p^eとしたときのa mod pを求める  (O(logp n)
def mod_fact(n,p):
    if n==0:
        return 1
    
    
    res = mod_fact(n//p,p)
    
    if n//p %2 != 0:
        return res*(p-fact[n%p])%p
    return res*fact[n%p]%p
    
######################################################

#nCk mod p
def mod_comb(n,k):
    if n < 0 or k < 0 or n<k:
        return 0
    e1 = mod_e(n,p)
    e2 = mod_e(k,p)
    e3 = mod_e(n-k,p)
    #pで割り切れる場合
    if e1 > e2 + e3:
        return 0

    #pで割り切れない場合
    a1 = mod_fact(n,p)
    a2 = mod_fact(k,p)
    a3 = mod_fact(n-k,p)
    return a1 * mod_inv(a2*a3%p,p) %p
######################################################

h,w,a,b = map(int,input().split())
#pは素数とする
p = 10**9+7
#fact[i] : i! modp (0<= i <p) O(p)
fact = [1]
k = 1
for i in range(1,10**6+10):
    k = k*i%p
    fact.append(k)

res = 0
for i in range(h-a):
    res += mod_comb(i+b-1,b-1)*mod_comb(h-i-1+w-b-1,w-b-1)
    res = res%p
print(res)
### BUGGY CODE ###

#!/usr/bin/env python3
import sys


def solve(S: str):
    ans = 0
    if S == '0':
        print(ans)
        return
    N = len(S)
    while True:
        S = S.replace('10', '').replace('01', '')
        if S.count('10') == 0 and S.count('01') == 0:
            break
    ans = N - len(S)
    print(ans)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    S = str(input())
    solve(S)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(S: str):
    stack = []
    N = len(S)
    for i, s in enumerate(S):
        if i == 0:
            stack.append(s)
        else:
            if len(stack) == 0:
                stack.append(s)
            else:
                if s != stack[-1]:
                    tmp = stack.pop()
                else:
                    stack.append(s)
    print(N - len(stack))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    S = str(input())
    solve(S)

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

N, M = map(int, input().split())
list1 = []
ss = set(x for x in range(1,N+1))
for i in range(M):
  ar = []
  L, R = map(int, input().split())
  st = set(x for x in range(L, R+1))
  list1.append(st)
for s in list1:
  ss = ss & s
print(len(ss))
    

### FIXED CODE ###

N, M = map(int, input().split())
L, R = map(int, input().split())


for i in range(M-1):
      L1, R1 = map(int, input().split())
      if R1 < L or R < L1:
        print(0)
        exit()
      else:
        if L <= L1 <= R:
          L = L1
          
        elif L <= R1 <= R:
          R = R1
        
          
print(R-L+1)
### BUGGY CODE ###

import itertools

n = int(input())
v = map(int, input().split())
num = 0

for i in itertools.permutations(v):
  count = i[0]
  for j in range(1, n):
    count = (count + i[j])/2

  num = max(num, count)

print(num)


### FIXED CODE ###

import itertools

n = int(input())
v = sorted(map(int, input().split()))
num = v[0]

for i in v:
  num = (num + i)/2

print(num)