Harryxun/stf_run huggingface dataset:
N = int(input())
S = input()
count = 0
ans = 1
m = 10**9 + 7
 
for i in range(N):
  if S[2*i] == "W":
    ans *= ((2*i) - (count*2))%m
    count += 1
  if S[2*i + 1] == "B":
    ans *= ((2*i + 1) - (count*2))%m
    count += 1
 
if count != N:
  print(0)
else:
  for o in range(1, N+1):
    ans *= o
    ans %= m
  print(ans % m)

### FIXED CODE ###

M, D = map(int, input().split())
m_list = {m for m in range(1, M + 1)}
ans = 0
 
for d in range(11, D+1):
  d_10 = int(d/10)
  d_1 = d - (d_10 * 10)
  if (d_10 < 2) or (d_1 < 2):
    continue
  else:
    if (d_10 * d_1) in m_list:
      ans += 1
      
print(ans)
from functools import lru_cache

N = int(input())
h = list(map(int,input().split()))
#print(h)

@lru_cache()
def func(cur):
	if cur==0:
		return 0
	elif cur==1:
		return abs(h[1]-h[0])#+func(0)
	step1 = abs(h[cur]-h[cur-1])+func(cur-1)
	step2 = abs(h[cur]-h[cur-2])+func(cur-2)
	return min(step1,step2)

ans = func(N-1)
print(ans)


### FIXED CODE ###


N = int(input())
h = list(map(int,input().split()))
#print(h)

dp = [0]*N
dp[0] = 0
dp[1] = abs(h[1]-h[0])
for n in range(2,N):
	step1 = abs(h[n]-h[n-1])+dp[n-1]
	step2 = abs(h[n]-h[n-2])+dp[n-2]
	dp[n] =  min(step1,step2)

ans = dp[N-1]
print(ans)
n = int(intput())

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

sa = sorted(a)

if n % 2 == 0:
  k = 0
else:
  k = 1

flag = True

for i,s in enumerate(sa):
  if (i//2)*2+k != s:
    flag = false

if flag:
  print(2**n//2)
else:
  print(0)


### FIXED CODE ###

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

if n % 2 == 0:
  k = 1
  l = 0
else:
  k = 0
  l = 1 

a=1000000007
flag = True 
for i,s in enumerate(sa):
  if ((i+l)//2)*2+k != s:
    flag = False
if flag:
  print(2**(n//2) % a)
else:
  print(0)
import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)

def main():
    N, M = map(int, input().split())
    A = [0] * (N + 1)
    for i in range(M):
        bre = int(input())
        A[bre] = -1
    a_2 = 1
    a_1 = 1 if A[1] != -1 else -1
    # print(A)
    for i in range(N):
        if (A[i] == -1) & (A[i + 1] == -1):
            print(0)
            sys.exit()
    # print(a_1, a_2)
    A[0] = 1
    A[1] = 1 if A[1] != -1 else -1
    for i in range(2, N + 1):
        if A[i] == -1:
            a_2 = a_1
            a_1 = -1
            continue
        elif a_1 == -1:
            a = a_2
        elif a_2 == -1:
            a = a_1
        else:
            a = a_1 +a_2
        a_2 = a_1
        a_1 = a
        # print(a_2, a_1)
    print(a % 1000000007)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)

def main():
    N, M = map(int, input().split())
    A = [0] * (N + 1)
    for i in range(M):
        bre = int(input())
        A[bre] = -1
    A[0] = 1
    A[1] = 1 if A[1] != -1 else -1
    # print(A)
    for i in range(N):
        if (A[i] == -1) & (A[i + 1] == -1):
            print(0)
            sys.exit()

    for i in range(2, N + 1):
        if A[i] == -1:
            continue
        elif A[i - 1] == -1:
            A[i] = A[i - 2]
        elif A[i - 2] == -1:
            A[i] = A[i - 1]
        else:
            A[i] = A[i - 1] + A[i - 2]
    print(A[N] % 1000000007)

if __name__ == '__main__':
    main()
import numpy as np
N = int(input())

edge = np.zeros((N,N))
color = [-1] * (N)

for i in range(N-1) :
    u , v , w = map(int,input().split())
    edge[u-1,v-1] = w
    edge[v-1,u-1] = w

stack = [(0,0)] # (頂点 , 距離)

while len(stack) > 0 :
    v , d = stack.pop()

    if d % 2 == 0 :
        color[v] = '1'
    else :
        color[v] = '0'

    for u , w in enumerate(edge[v]) :
        if w > 0 and color[u] == -1 :
            color[u] = -2
            stack.append((u,d+w))

for i in color :
    print(i)

### FIXED CODE ###

from collections import deque

N = int(input())

edge = [[] for _ in range(N)]
check = [False] * N
dist = [0] * N

for i in range(N-1) :
    u , v , w = map(int,input().split())
    edge[u-1].append((v-1,w))
    edge[v-1].append((u-1,w))

q = deque([0])

while q :
    current = q.popleft()
    if check[current] :
        continue

    check[current] = True
    for ad , w in edge[current] :
        if not check[ad] :
            q.append(ad)
            dist[ad] = dist[current] + w

for w in dist :
    print(w % 2)
import math

N, M = map(int, input().split())
if M <= 1 and N <= 1:
    print(0)
elif N == 0:
    print(int((math.factorial(M)/(2*math.factorial(M-2)))))
elif M == 0:
    print(int((math.factorial(N)/(2*math.factorial(N-2)))))
else:
    print(int((math.factorial(N)/(2*math.factorial(N-2))) + (math.factorial(M)/(2*math.factorial(M-2)))))

### FIXED CODE ###

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

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

if M == 0 and N == 0:
    print(0)
elif M == 1 and N == 1:
    print(0)
elif M <= 1:
    print(cmb(N, 2))
elif N <= 1:
    print(cmb(M, 2))
else:
    a = cmb(M, 2)
    b = cmb(N, 2)
    print(a + b)
S=str(input())
if S='Sunny':
  print(Cloudy)

elif S='Cloudy':
  print(Rainy)

else:
  print(Sunny)

### FIXED CODE ###

S=str(input())

if S=='Sunny':
  print('Cloudy')

elif S=='Cloudy':
  print('Rainy')
  
else:
  print('Sunny')
def get_primes(n=10**6):
    primes = [2]
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if n <= p ** 2:
            return primes + data
        primes.append(p)
        data = [d for d in data if d % p != 0]


def main():
    MOD = 10 ** 9 + 7
    N = int(input())
    A = list(map(int, input().split(' ')))
    # 答えは sum(lcm(A) / A)
    primes = get_primes(max(max(A), 2))
    lcm_pf = [0] * len(primes)
    a_pf = [[0] * len(primes) for _ in range(N)]
    # lcm(A) の素因数分解表示を計算
    for i, a in enumerate(A):
        for j, p in enumerate(primes):
            while a % p == 0:
                a_pf[i][j] += 1
                a //= p
            if a == 1:
                break
        for j in range(len(primes)):
            lcm_pf[j] = max(lcm_pf[j], a_pf[i][j])
    # sum(lcm(A) / A) を計算
    ans = 0
    for i in range(N):
        v = 1
        for j, p in enumerate(primes):
            e = lcm_pf[j] - a_pf[i][j]
            v *= p ** e
            v %= MOD
        ans += v
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import math


def main():
    MOD = 10 ** 9 + 7
    N = int(input())
    A = list(map(int, input().split(' ')))
    # 答えは sum(lcm(A) / A)
    L = 1
    for a in A:
        L = L * a // math.gcd(L, a)
    ans = 0
    for a in A:
        ans += L * pow(a, MOD - 2, MOD)
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()
a,b=map(int,input().split())
print(' '.join(list(range(b-(a-1),b+(a+1)))))

### FIXED CODE ###

a,b=map(int,input().split())
c=list(range(b-(a-1),b+(a-1)+1))
d=' '.join(map(str,c))
print(d)
n=int(input())
s=list(input())
c=0
if n%2 != 0:
    print('No')
    exit()
else:
    for i in range(n/2):
        if s[i]!=s[i+n/2]:
            c+=1
    if c==0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n=int(input())
s=list(input())
c=0
if n%2 != 0:
    print('No')
    exit()
else:
    for i in range(n//2):
        if s[i]!=s[i+n//2]:
            c+=1
    if c==0:
        print('Yes')
    else:
        print('No')
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
onaji = 0

for i in range(len(A)):
    if i >= len(A)-1:
        break
    for j in range(len(A)-1,i,-1):
        if A[i] == A[j]:
            onaji = 1
        if A[j] % A[i] == 0:
            del A[j]
            
    if onaji == 1:
        del A[i]
        onaji = 0

print(len(A))


### FIXED CODE ###

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

for i in range(len(a)):
    if a[i] == 0:
        print(i+1)
n = int(input())
x = []
u = []
s = 0
for i in range(n):
    x.append(floart(input())
    u.append(input())
    if u[i] == 'JPY':
      s = s + int(x)
    if u[i] == 'BTC':
      s = s + ( x *  380000.0) 

print(s)

### FIXED CODE ###

n = int(input())
x = []
u = []
s = 0
for i in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
      s = s + int(x)
    if u == 'BTC':
      s = s + ( float(x) *  380000.0) 

print(s)
print(input().swapcase())

s = input()

for c in s:
    if c.islower():
        print(c.upper(), end="")
    else:
        print(c.lower(), end="")
print()


### FIXED CODE ###



s = input()

for c in s:
    if c.islower():
        print(c.upper(), end="")
    else:
        print(c.lower(), end="")
print()
# -*- coding: utf-8 -*-

n = input()
list = []
for i in xrange(n):
    command = raw_input().split()
    if command[0] == "insert":
        list.insert(0, command[1])
    elif command[0] == "delete":
        list.remove(command[1])
    elif command[0] == "deleteFirst":
        list.pop(0)
    elif command[0] == "deleteLast":
        list.pop()
        
print " ".join(list)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = input()
l = []
tail = 0
for i in xrange(n):
    cmd = raw_input().split()
    if cmd[0] == "insert":
        l.append(cmd[1])
    elif cmd[0] == "delete":
        try:
            l.pop(len(l) - l[::-1].index(cmd[1]) -1)
        except ValueError:
            pass
    elif cmd[0] == "deleteFirst":
        l.pop()
    elif cmd[0] == "deleteLast":
        tail += 1

print " ".join(l[tail:][::-1])
a, b, h = list(map(int, input().split("\n")))
S = (a + b) * h / 2
print(S)

### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())
 
print(int((a+b)*h//2))
n,t = map(int,input().split())

ct = [[int(i) for i in input().split()] for _ in range(n)]

x=[]
for i in range(n):
  if ct[i][1] <= t:
    x.append(ct[i][0])
    
    
x.sotr()

print(x[0])

### FIXED CODE ###

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

ct = [[int(i) for i in input().split()] for _ in range(n)]

x=[]
for i in range(n):
  if ct[i][1] <= t:
    x.append(ct[i][0])
    
    
x.sort()

if len(x) != 0:
  print(x[0])
else:
  print("TLE")
from sys import setrecursionlimit
   setrecursionlimit(1000)
   
   class Node():
    NIL = -1

    def __init__(self, parent=NIL, left=NIL, right=NIL, depth=-1):
        self.parent = parent
        self.left = left
        self.right = right
        self.depth = depth

def read_nodes(T):
    for _ in range(len(T)):
        id, _, *child = [int(x) for x in input().split()]
        for i, c in enumerate(child):
            if i == 0:
                T[id].left = c
            else:
                T[l].right = c
            l = c
            T[c].parent = id

def calc_depth(T):

    def rec(r, p):
        nonlocal T

        T[r].depth = p
        if T[r].right != Node.NIL:
            rec(T[r].right, p)
        if T[r].left != Node.NIL:
            rec(T[r].left, p + 1)

    rec([u.parent for u in T].index(-1), 0)

def node_type(T, id):
    if T[id].parent == Node.NIL:
        return "root"
    elif T[id].left == Node.NIL:
        return "leaf"
    else:
        return "internal node"

def child(T, id):
    c = []
    i = T[id].left
    while i != Node.NIL:
        c.append(i)
        i = T[i].right
    return c

def print_nodes(T):
    for id in range(len(T)):
        print("node {}: parent = {}, depth = {}, {}, {}".
              format(id, T[id].parent, T[id].depth,
                     node_type(T, id), child(T, id)))

def main():
    n = int(input())
    T = [Node() for _ in range(n)]

    read_nodes(T)
    calc_depth(T)
    print_nodes(T)

main()


### FIXED CODE ###

class Node():
    def __init__(self, parent=-1, child=[]):
        self.parent = parent
        self.child = child


def node_depth(u, id):
    if u[id].parent == -1:
        return 0
    else:
        return node_depth(u, u[id].parent) + 1


def node_type(u, id):
    if u[id].parent == -1:
        return "root"
    elif u[id].child == []:
        return "leaf"
    else:
        return "internal node"


def main():
    n = int(input())
    u = [Node() for _ in range(n)]

    for _ in range(n):
        id, _, *child = (int(x) for x in input().split())
        u[id].child = child
        for c in child:
            u[c].parent = id

    for id in range(n):
        print("node {}: parent = {}, depth = {}, {}, {}".
              format(id, u[id].parent,
                     node_depth(u, id), node_type(u, id),
                     u[id].child))


main()
A = input()
N = int(A)


if N ==1:
    print(N) 
elif N%2 == 0:
    a = 0.5
    a = float(a)
elif N % 2 == 1:
    a = (N/2 + 1)/N

print(a)

### FIXED CODE ###

A = input()
N = int(A)


if N ==1:
    a = 1
elif N%2 == 0:
    a = 0.5
    a = float(a)
elif N%2 == 1:
    a = (N//2 + 1)/N

print(a)
N = int(input())
arr = map(int, input().split(' '))
ans = [0 for x in range(N)]
for i in reversed(range(N)):
  n = i + 1
  s = 0
  for k in reversed(range(1, N // n)):
	index = n*k - 1
	s += arr[index]
  if s % 2 == arr[i]:
     ans[i] = 0
  else:
     ans[i] = 1
    	
ans_arr = []
for i in ans:
  if i == 1:
    ans_arr.append(i)

print(sum(ans))
print(' '.join(ans_arr))


### FIXED CODE ###

def main():
    n = int(input())
    A = [0] + list(map(int, input().rstrip().split()))
    for i in range(n // 2, 0, -1):  # second half: no multiples
        A[i] = sum(A[i::i]) % 2
    ans = [i for i, j in enumerate(A) if j]
    print(len(ans))  # all cells: [1] -> len() (much faster than sum())
    print(*ans)


if __name__ == "__main__":
    main()
import sys
 
n=int(input())
h=[]
count=0
for i in range(n):
  h.append(int(input()))
  max=h[0]
  if h[i-1]>=max:
    max=h[i-1]
    count+=1
print(count)

### FIXED CODE ###

import sys
 
n=int(input())
h=input().split()
count=0
max=int(h[0])
for i in range(n):
  if int(h[i])>=max:
    max=int(h[i])
    count+=1
print(count)
n=int(input())
s=input()
t=input()
for i in range(n):
    print(s[i],end="")
    print(t[i],end="")

### FIXED CODE ###

n=int(input())
s,t=input().split()
for i in range(n):
    print(s[i],end="")
    print(t[i],end="")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<n; i++)
#define pb push_back
#define int long long

int N, M;

signed main() {
    cin.tie(0); ios::sync_with_stdio(false);
    cin >> N >> M;
    int ans = 0;
    for (int i=1; i*i<=M; i++) {
        if (M%i==0) {
            if (i*N<=M) ans = max(ans, i);
            if (i!=M/i) {
                int j = M/i;
                if (j*N<=M) ans = max(ans, j);
            }
        }
    }
    cout << ans << endl;
}

### FIXED CODE ###

def make_divs(n):
    divs = []
    
    for i in range(1, int(n**0.5)+1):
        if n%i==0:
            divs.append(i)
            
            if i!=n//i:
                divs.append(n//i)
                
    divs.sort(reverse=True)
    
    return divs

N, M = map(int, input().split())
divs = make_divs(M)

for d in divs:
    if M//d>=N:
        print(d)
        exit()
def yesno(S):

if S=="AAA" or S=="BBB":
  return("No")
else:
  return("Yes")
S=input()
print(yesno(S))


### FIXED CODE ###

def yesno(S):
  if S=="AAA" or S=="BBB":
    return "No"
  else:
    return "Yes"
S=input()
print(yesno(S))
a = input()
print(a//3600, a//60%60, x%60, sep=":")


### FIXED CODE ###

t=int(input())
print("{0}:{1}:{2}".format(t//3600,t//60%60,t%60))
def _init_ (self,data):
        self.data = data

class Dice:
    def move(self,direction):
        if direction == 'E':
            self.data[0],self.data[3],self.data[5],self.data[2] = \
                    self.data[3].self.data[5],self.data[2],self.data[0]
        elif direction == 'N':
            self.data[0],self.data[4],self.data[5],self.data[1] = \
                    self.data[4].self.data[5],self.data[1],self.data[0]
        elif direction == 'S':
            self.data[0],self.data[1],self.data[5],self.data[4] = \
                    self.data[4].self.data[0],self.data[1],self.data[5]
        elif direction == 'W':
            self.data[0],self.data[2],self.data[5],self.data[3] = \
                    self.data[2].self.data[5],self.data[3],self.data[0]

    def getTop(self):
        return self.data[0]

dice = Dice(input().split())
cmd = input()
for i in range(len(cmd)):
    dice.move(cmd[i])
    print(dice.getTop())

### FIXED CODE ###

class Dice:
    def __init__ (self,data):
        self.data = data

    def move(self,direction):
        if direction == 'E':
            self.data[0],self.data[3],self.data[5],self.data[2] = \
                    self.data[3],self.data[5],self.data[2],self.data[0]
        elif direction == 'N':
            self.data[0],self.data[4],self.data[5],self.data[1] = \
                    self.data[1],self.data[0],self.data[4],self.data[5]
        elif direction == 'S':
            self.data[0],self.data[1],self.data[5],self.data[4] = \
                    self.data[4],self.data[0],self.data[1],self.data[5]
        elif direction == 'W':
            self.data[0],self.data[2],self.data[5],self.data[3] = \
                    self.data[2],self.data[5],self.data[3],self.data[0]

    def getTop(self):
        return self.data[0]

dice = Dice(input().split())
cmd = input()
for i in range(len(cmd)):
    dice.move(cmd[i])
print(dice.getTop())
n,a,b=map(int,input().split())
s=input()
for i in s:
    if a+b>0:
        if i=="a":
            a-=1
            print("Yes")
            continue
       elif i=="b" and b>0:
            b-=1
            print("Yes")
            continue
    print("No")


### FIXED CODE ###

n,a,b=map(int,input().split())
s=input()
for i in s:
    if a+b>0:
        if i=="a":
            a-=1
            print("Yes")
            continue
        if i=="b" and b>0:
            b-=1
            print("Yes")
            continue
    print("No")
#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, K: int):
    if (N - 2) * (N - 1) < 2 * K:
        return -1

    g = [[1] * N for _ in range(N)]
    for i in range(N):
        g[i][i] = 0

    for i in range(K):
        g[i][i+1] = 0
        g[i+1][i] = 0

    ret = []
    for i in range(N):
        for j in range(N):
            if j <= i:
                continue

            if g[i][j] != 0:
                ret.append('{} {}'.format(i+1, j+1))

    ret = [str(len(ret))] + ret
    return '\n'.join(ret)


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
    K = int(next(tokens))  # type: int
    result = solve(N, K)
    if isinstance(result, Iterable) and not isinstance(result, str):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, K: int):
    g = [[1] * N for _ in range(N)]
    for i in range(N):
        g[i][i] = 0

    k = K
    for i in range(N):
        if k == 0:
            break
        for j in range(N - 1):
            if j <= i:
                continue

            g[i][j] = 0
            g[j][i] = 0
            k -= 1
            if k == 0:
                break

    if 0 < k:
        return '-1'

    ret = []
    for i in range(N):
        for j in range(N):
            if j <= i:
                continue

            if g[i][j] != 0:
                ret.append('{} {}'.format(i+1, j+1))
    ret = [str(len(ret))] + ret
    return '\n'.join(ret)


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
    K = int(next(tokens))  # type: int
    result = solve(N, K)
    if isinstance(result, Iterable) and not isinstance(result, str):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


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

ans = 0
for i in range(n):
    init = a_list[:]
    init.pop(i)
    gcd = gcd_list(init)
    if ans < gcd:
        ans = gcd

print(ans)


### FIXED CODE ###

from fractions import gcd

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

rs, ls = [0], [0]
for i in range(n-1):
  rs.append(gcd(rs[i], a[i]))
  ls.append(gcd(ls[i], a[-i-1]))

gcd_list = [gcd(r,l) for r, l in zip(rs, ls[::-1])]
print(max(gcd_list))
from math import factorial
def comb(n,k,p):
  #from math import factorial
  if n<0 or k<0 or n<k: return 0
  if n==0 or k==0: return 1
  a=factorial(n) %p
  b=factorial(k) %p
  c=factorial(n-k) %p
  return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p
def power_func(a,n,p):
  bi=str(format(n,"b"))
  res=1
  for i in range(len(bi)):
    res=(res*res) %p
    if bi[i]=="1":
      res=(res*a) %p
  return res

N,K = map(int,input().split())
for i in range(1,K+1):
    if i == 1 or i == K:
        print(comb(N-K+1,i,10**9+7))
    else:
        k = factorial(N-K+1) #% 10**9+7
        l = factorial(N-K+1-i)
        m = factorial(i-1)
        #print(k,l,m)
        print( (k//(l*m)) % (10**9+7) )
        #print( (k//(l*m)))
        #print(comb(N-K+1,i,10**9+7))

### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7
MAX = 4000
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range( 2, MAX + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
n,k= map(int,input().split())
for i in range(1,k+1):
    pre = cmb(k-1,i-1,mod)
    pos = cmb(n-k+1,i,mod)
    print((pre*pos)%mod)
N, M = map(int, input().split())
print((1900*M+100*(N-M))2**M)


### FIXED CODE ###

N, M = map(int, input().split())
print((1900*M+100*(N-M))*(2**M))
import sys
N, M = map(int, input().split())
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]

A.sort(reverse=True)
B.sort(reverse=True)

if len(set(A))!=len(A) or len(set(B))!=len(B):
    print(0)
    sys.exit()

ans = 1
rows, columna = 0,0
mod = 10**9+7
for x in range(N*M, 0, -1):

    if x in A and x in B:
        rows += 1
        columna += 1

    elif x in A and not x in B:
        rows += 1
        ans = ans * (columna)

    elif x in B and not x in A:
        columna += 1
        ans = ans *(rows)

    else:
        ans = ans * (rows * columna -(N*M-x

    ans %= mod    

print(ans%(10**9+7))


### FIXED CODE ###

def solve():
    MOD = 10 ** 9 + 7
    N, M = map(int, input().split())
    A = set(map(int, input().split()))
    B = set(map(int, input().split()))
    
    row, columun = 0, 0
    ans = 1
    for i in range(N * M, 0, -1):
        in_A = i in A
        in_B = i in B
        if in_A and in_B:
            row += 1
            columun += 1
        elif in_A:
            row += 1
            ans *= columun
        elif in_B:
            columun += 1
            ans *= row
        else:
            ans *= row * columun - (N * M - i)
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    solve()
import sys

A, B = map(int, input().split())

a = int(A // 0.08) + 1
b = int(B // 0.1) + 1

ab = []
ab.append(min(a, b))
ab.append(max(a, b))

for i in ab:
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(f'{i}')
        sys.exit(0)

print('-1')

### FIXED CODE ###

A, B = map(int, input().split())

a = int(A // 0.08) + 1
b = int(B // 0.1) + 1

ab = []
ab.append(min(a, b))
ab.append(max(a, b))

for i in ab:
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit(0)

print('-1')
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)
    
    

### FIXED CODE ###

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)