Harryxun/stf_run huggingface dataset:
def power(N):
    ans=1
    for i in range(N):
        ans=(ans*2)%(10**9+7)
    return ans

N=int(input())

A = map(int,input().split())
flag=True
if N%2==0:
    n = [0 for i in range(N/2)]
    for a in A:
        if a%2==0:
            print(0)
            flag=False
            break
        if (a-1)/2 in range(N/2):
            n[(a-1)/2]+=1
            if n[(a-1)/2]==3:
                print(0)
                flag=False
                break
        else:
            print(0)
            flag=False
            break
    if flag:
        print(power(N/2))
    
else:
    n = [0 for i in range((N+1)/2)]
    for a in A:
        if a%2==1:
            print(0)
            flag=False
            break
        if a/2 in range((N+1)/2):
            n[a/2]+=1
            if a==0:
                if n[a]==2:
                    print(0)
                    flag=False
                    break
            elif n[a/2]==3:
                print(0)
                flag=False
                break
        else:
            print(0)
            flag=False
            break
    if flag:
        print(power((N-1)/2))
        

### FIXED CODE ###


N = int(raw_input())
A = map(int,raw_input().split())

flag=True
if N%2==0:
    l = [0 for i in range(N/2)]
    for i in range(N):
        if A[i]%2!=1 or A[i]>=N or A[i]<=0:
            print 0
            flag=False
            break
        l[(A[i]-1)/2]+=1
        if l[(A[i]-1)/2]>=3:
            print 0
            flag=False
            break
    if flag:
        print (2**(N/2))%(10**9+7)
else:
    l = [0 for i in range((N+1)/2)]
    for i in range(N):
        if A[i]%2!=0 or A[i]>=N or A[i]<0:
            print 0
            flag=False
            break
        if A[i]==0:
            l[0]+=1
            if l[0]>=2:
                print 0
                flag=False
                break
        else:
            l[A[i]/2]+=1
            if l[A[i]/2]>=3:
                print 0
                flag=False
                break        
    if flag:
        print (2**((N-1)/2))%(10**9+7)
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
X=many_int()

sort_X=sorted(X)
min_X = sort_X[0]
max_X = sort_X[1]

min_num = 0
min_sum = 99999999999
for i in range(min_X, max_X+1):
    temp_sum = 0
    for j in X:
        temp_sum += (j-i)**2
    
    if temp_sum < min_sum:
        min_sum = temp_sum
        min_num = i

print(min_num)

### FIXED CODE ###

def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
X=many_int()

sort_X=sorted(X)
min_X = sort_X[0]
max_X = sort_X[-1]

min_num = 0
min_sum = 99999999999
for i in range(min_X, max_X+1):
    temp_sum = 0
    for j in X:
        temp_sum += (j-i)**2
    
    if temp_sum < min_sum:
        min_sum = temp_sum
        min_num = i

print(min_sum)
n = input()
for 9 in n:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = input()
if n[0] == '9' or n[1] == '9':
    print('Yes')
else:
    print('No')
di='URLD'
mp=dict(zip(list(di),range(4)))
rv=dict(zip(list(di),list(di[::-1])))
h,w,n=map(int,input().split())
b=[h,w,w,h]
r,c=map(int,input().split())
st=[h-r+1,c,w-c+1,r]
s=input()
t=[rv[i] for i in input()]
ans=True
for j,i in mp.items():
    c=st[i]
    for k in range(n):
        c+=1*(s[k]==j)
        if c>b[i]:
            a=False
        if c>1:
            c-=1*(t[k]==j)
if a:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

import time
st_time=time.time()

from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
ts=time.time()
sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
show_flg=False
#show_flg=True

di='URLD'
mp=dict(zip(list(di),range(4)))
rv=dict(zip(list(di),list(di[::-1])))

h,w,n=LI()
b=[h,w,w,h]
r,c=LI()
st=[h-r+1,c,w-c+1,r]
s=input()
t=[rv[i] for i in input()]
ans=True
for j,i in mp.items():
    c=st[i]
    for k in range(n):
        c+=1*(s[k]==j)
        if c>b[i]:
            ans=False
        if c>1:
            c-=1*(t[k]==j)
            
show(s)
show(t)
show(mp,rv,di)
if ans:
    print('YES')
else:
    print('NO')
A,B,C =map(int,input().split())
if A==B==c:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

A,B,C =map(int,input().split())
if A==B==C:
  print("No")
elif A!=B and B!=C and C!=A:
  print("No")
else:
  print("Yes")
n = int(input())
a = list(map(int, input().split()))
 
a.sort(reverse=True)

ans=0
for i in range(N):
    if i % 2 ==0:
        ans += a[i]
    else:
        ans -= a[i]
print(ans)

### FIXED CODE ###

N = int(input())
a = int(input())
if (N % 500) <= a:
    print("Yes")
else:
    print("No")
s=input()
if(s-2019/4/30 >0):
   print("TBD")
else:
   print("Heisei")

### FIXED CODE ###

s=input()
if(s>"2019/04/30"):
   print("TBD")
else:
   print("Heisei")
x = 0
y = 1
n = int(input())
if y <= n:
    for y in range(1,n+1):
    x = x + y
    print(x)
    y = y + 1
    

### FIXED CODE ###

m = int(input())
result = 0
for i in range(1, m+1):
    result += i
print(result)
a = [input().split() for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[1][0],a[1][1],a[2][1]]
a8 = [a[2][0],a[2][1],a[2][2]]
n = int(input())
B = [int(input()) for i in range(n)]
if set(a1) <= B or set(a2) <= B or set(a3) <= B or set(a4) <= B or set(a5) <= B or set(a6) <= B or set(a7) <= B or set(a8) <= B:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
a4 = set()
a5 = set()
a6 = set()
a7 = set()
a8 = set()
a4.update({a1[0],a2[1],a3[2]})
a5.update({a1[2],a2[1],a3[0]})
a6.update({a1[0],a2[0],a3[0]})
a7.update({a1[1],a2[1],a3[1]})
a8.update({a1[2],a2[2],a3[2]})
n = int(input())
B =set()
for i in range(n):
    b = int(input())
    B.add(b)
if set(a1) <= B or set(a2) <= B or set(a3) <= B or a4 <= B or a5 <= B or a6 <= B or a7 <= B or a8 <= B:
    print('Yes')
else:
    print('No')
N = int(input())
S = list(input())

count_list =[]
wc = 0

A=[0]*(N)
bc = 0

for i in list(range(N))[::-1]:
    if(S[i] == '#'):
        bc  += 1
    A[i] = bc

for n in range(N-1):
    if(S[n] == '.'):
        num = n
        count_list.append(A[n+1] + wc)
        wc += 1

if(S[N-1] == '.'):
    count_list.append(wc+1)

count = min(count_list)
print(count)

### FIXED CODE ###

h1, h2, d = list(map(int, (input().split())))

if(h1 > h2):
    temp = h2
    h2 = h1
    h1 = temp

if(d >= h1 and d <= h2):
    print("Yes")
else:
    print("No")
N=int(input())
S=[0]*N
for i in range(N):
    S[i]=input()

M=int(input())
T=[0]*M
for i in range(M):
    T[i]=input()

A=[]
for i in S:
    A.append(S.count(i)-T.count(i))

print(max(*A,0))

### FIXED CODE ###

N=input()
N=int(N)
S=[0]*N
for i in range(N):
    S[i]=input()

M=input()
M=int(M)
T=[0]*M
for i in range(M):
    T[i]=input()

A=[]
for i in S:
    A.append(S.count(i)-T.count(i))

print(max(0,max(A)))
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy

# 最大公約数
def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z

# 幅優先探索(BFS)でスタート座標(x, y)からの最大距離返す
def bfs(SS, x, y, H, W):#入力(座標系(迷路), x, y, xの端, yの端)
  x_next = [0, 0, -1, 1]
  y_next = [1, -1, 0, 0]
  tempx = x
  tempy = y
  mlength = 0
  q = deque()
  xytuple = (x, y, 0)
  q.append(xytuple)


  while q:
    xytuple = q.popleft()
    SS[xytuple[0]][xytuple[1]] = "x" #探索した場所は探索できないようにする
    for i in range(4): #このforで上下左右を調べてる
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      #print(tempx, tempy, xytuple[2])
      #print(S)
      if(0 <= tempx and tempx < H and 0 <= tempy and tempy < W and SS[tempx][tempy] == "."):
        temptuple = (tempx, tempy, xytuple[2]+1)
        SS[temptuple[0]][temptuple[1]] = "x" #探索した場所は探索できないようにする
        mlength = max(mlength, xytuple[2] +1)
        q.append(temptuple)
      #print(q)
  return mlength


#X = str(input()).split()
#a = [int(x) for x in input().split()]


NM = str(input()).split()
N = int(NM[0])
M = int(NM[1])

for i in reversed(range(1,M)):
  f = M/i
  if(f.is_integer() == True):
    #print(i)
    if(N*i<=M):
      ans = i
      break


print(ans)


### FIXED CODE ###

# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy

# 最大公約数
def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z

# 幅優先探索(BFS)でスタート座標(x, y)からの最大距離返す
def bfs(SS, x, y, H, W):#入力(座標系(迷路), x, y, xの端, yの端)
  x_next = [0, 0, -1, 1]
  y_next = [1, -1, 0, 0]
  tempx = x
  tempy = y
  mlength = 0
  q = deque()
  xytuple = (x, y, 0)
  q.append(xytuple)


  while q:
    xytuple = q.popleft()
    SS[xytuple[0]][xytuple[1]] = "x" #探索した場所は探索できないようにする
    for i in range(4): #このforで上下左右を調べてる
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      #print(tempx, tempy, xytuple[2])
      #print(S)
      if(0 <= tempx and tempx < H and 0 <= tempy and tempy < W and SS[tempx][tempy] == "."):
        temptuple = (tempx, tempy, xytuple[2]+1)
        SS[temptuple[0]][temptuple[1]] = "x" #探索した場所は探索できないようにする
        mlength = max(mlength, xytuple[2] +1)
        q.append(temptuple)
      #print(q)
  return mlength

#素因数分解
def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a



#X = str(input()).split()
#a = [int(x) for x in input().split()]


NM = str(input()).split()
N = int(NM[0])
M = int(NM[1])


for i in reversed(range(math.floor(M/N)+1)):
  f = M/i
  if(f.is_integer() == True):
    if(N*i<=M):
      ans = i
      break


print(ans)
while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif y < x:
      print y, x
   else:
      print x, y
    

### FIXED CODE ###

while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x > y:
      print '%s %s' % (y,x)
   else:
      print '%s %s' % (x,y)
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

for i in range(n - m):
    t = True
    for j in range(n - m):
        for k in range(m):
            if dat_a[i+ k][j:j+m] != dat_b[k]:
                t = False
                continue
        if t:
            break
    if t:
        break

print("Yes" if t else "No")

### FIXED CODE ###

n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

if n == 1 and m == 1:
    if dat_a[0][0] == dat_b[0][0]:
        t = True
    else:
        t = False

for i in range(n - m + 1):
    for j in range(n - m + 1):
        for k in range(m):
            #print(dat_a[i + k][j : j + m])
            if dat_a[i + k][j : j + m] != dat_b[k]:
                t = False
                break
            t = True
        if t:
            break
    if t:
        break

print("Yes" if t else "No")
A,B = int(input().split())
if (B%A==0):
  print(A+B)
else:
  print(B-A)

### FIXED CODE ###

from sys import stdin
A, B = [int(x) for x in stdin.readline().rstrip().split()]
if (B%A==0):
  print(A+B)
else:
  print(B-A)
print(input()[0:3]+'8'+input()[4:])

### FIXED CODE ###

print('2018'+input()[4:])
# -*- coding: utf-8 -*-

def move(S, before_a, before_b, a_index, b_index, g_a, g_b):
    if len(S)<=a_index or len(S) <= b_index:
        return -1
    if S[a_index]=='#' or S[a_index]=='B':
        return 0
    elif S[b_index]=='#' or S[b_index]=='A':
        return 0
    if a_index==g_a and b_index==g_b:
        return 100
    S[before_a] = '.'
    S[before_b] = '.'

    S[a_index] = 'A'
    S[b_index] = 'B'
    rr1 = 0
    rr2 = 0
    rr3 = 0
    rr4 = 0
    if len(S)>a_index:
        rr1 = move(S, a_index, b_index, a_index+1, b_index, g_a, g_b)
    if len(S)-1>a_index:
        rr2 =  move(S, a_index, b_index, a_index+2, b_index, g_a, g_b)
    if len(S)>b_index:
        rr3 = move(S, a_index, b_index, a_index, b_index+1, g_a, g_b)
    if len(S)-1>b_index:
        rr4 = move(S, a_index, b_index, a_index, b_index+2, g_a, g_b)
    return max([rr1,rr2,rr3,rr4])
#    return 1

N, A, B, C, D = map(int, input().split())

S = list(input())

S[A-1] = 'A'
S[B-1] = 'B'

a_index = A-1
b_index = B-1

r1 = 0
r2 = 0
r3 = 0
r4 = 0

if len(S)>a_index:
    r1 = move(S, a_index, b_index, a_index+1, b_index, C-1, D-1)
if len(S)-1>a_index:
    r2 = move(S, a_index, b_index, a_index+2, b_index, C-1, D-1)
if len(S)>b_index:
    r3 = move(S, a_index, b_index, a_index, b_index+1, C-1, D-1)
if len(S)-1>b_index:
    r4 = move(S, a_index, b_index, a_index, b_index+2, C-1, D-1)


if r1==100 or r2==100 or r3==100 or r4==100:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

#!/usr/bin/env python3

N, A, B, C, D = map(int, input().split())
S = input()

#hunuke

h = S[A-1:D+1].count('##')
m3 = S[B-2:D+1].count('...')

if C < D:
    if h == 0: print('Yes')
    else: print('No')
else:
    if m3 != 0 and h == 0:
        print('Yes')
    else: print('No')
N = input()
ans = []
for i in len(N):
  ans.append(N[0])
if int(''.join(ans) > int(N):
    print(''.join(ans))
    exit()
for i in len(N):
  ans.append(str(int(N[0]) + 1))
print(''.join(ans))


### FIXED CODE ###

N = input()
ans = []
for i in range(len(N)):
  ans.append(N[0])
if int(''.join(ans)) >= int(N):
    print(''.join(ans))
    exit()
ans = []
for i in range(len(N)):
  ans.append(str(int(N[0]) + 1))
print(''.join(ans))
import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
C.sort()
res = 0
for i in B:
    res += bisect.bisect_right(A, i) * (N - bisect.bisect_left(C, i))
    
print(res)

### FIXED CODE ###

N = int(input())

for i in range(N+1):
    n = i*i
    if n > N:
        break
        
    res = n

print(res)
N = int(input())
X = list(map(int, input().split()))
for i in range(N):
  for j in range(i+1, N):
    ans += X[i] * X[j]
    
print(ans)


### FIXED CODE ###

N = int(input())
X = list(map(int, input().split()))
ans = 0
for i in range(N):
  for j in range(i+1, N):
    ans += X[i] * X[j]
    
print(ans)
n=int(input())
if n==1:
  print("Hello World")
a=int(input())
b=int(input())
else:
  print(a+b)

### FIXED CODE ###

n=int(input())
if n==1:
  print('Hello World')
else:
    print(int(input())+int(input()))
a = list(map(int, input()))
a.sort()
maped_list = map(str, a)
mojiretsu = ' '.join( a )    
print(mojiretsu)


### FIXED CODE ###

a, b, c = map(int, input().split())
if a < b < c:
    print("Yes")
else:
    print("No")
W, H, x, y = map(int, input().split())

ans = 0
if x*H == W*y:
    ans = 1
    print(x*H, ans)
    exit()
S = max(min(H*x, H*(W-x)), min(W*y, W*(H-y)))

xp = x*H/y
yp = y*W/x

if xp <= W:
    if S <= xp*H/2:
        S = xp*H/2
        ans = 1
if yp <= H:
    if S <= yp*W/2:
        S = yp*W/2
        ans = 1

print(S, ans)


### FIXED CODE ###

W, H, x, y = map(int, input().split())
print(W*H/2, int((x+x==W and y+y==H)))
N = int(input())
S = {}
name_list = []
for i in range(N):
  name = input()
  if name not in S:
    S[name] = 1
    name_list.append(name)
  else:
    S[name] += 1
sorted(name_list)
max_vote_name = []
max_vote = -float('inf')
for name in name_list:
  if S[name] > max_vote:
    max_vote = S[name]
    max_vote_list = [name]
  else if S[name] == max_vote:
    max_vote_list.append(name)
for name in max_vote_list:
  print (name)

### FIXED CODE ###

N = int(input())
S = {}
name_list = []
for i in range(N):
  name = input()
  if name not in S:
    S[name] = 1
    name_list.append(name)
  else:
    S[name] += 1
name_list = sorted(name_list)
max_vote_name = []
max_vote = -float('inf')
for name in name_list:
  if S[name] > max_vote:
    max_vote = S[name]
    max_vote_list = [name]
  elif S[name] == max_vote:
    max_vote_list.append(name)
for name in max_vote_list:
  print (name)
N = int(input())
A = list(map(int, input().split()))

for i in range(0, N):
    print(A.count(i+1))

### FIXED CODE ###

import math
math.pi

N = int(input())

print(2*N*math.pi)
import sys
sys.setrecursionlimit(10**5)
n, m, k = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
cd = [list(map(int, input().split())) for _ in range(k)]
con = [1 for _ in range(n+1)]
uni = [-1 for i in range(n+1)]

def root(num, pea):
    if pea[num] < 0:
        return num
    else:
        pea[num] = root(pea[num], pea)
        return pea[num]

for i in range(m):
    a, b = ab[i]
    con[a] += 1
    con[b] += 1
    if uni[a] != uni[b] or uni[a] < 0 or uni[b] < 0:
        root_a = root(a, uni)
        root_b = root(b, uni)
        root_a, root_b = sorted([root_a, root_b])
        uni[root_a] += uni[root_b]
        uni[root_b] = root_a
        root(root_b, uni)

for i in range(k):
    c, d = cd[i]
    if root(c, uni) == root(d, uni):
        con[c] += 1
        con[d] += 1

result = []
for i in range(1, n+1):
    root_i = root(i, uni)
    result.append(-uni[root_i]-con[i])
print(*result)

### FIXED CODE ###

class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rnk = [0]*(n+1)

    # ノードxのrootノードを見つける
    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.Find_Root(self.root[x])
            return self.root[x]
    # 木の併合、入力は併合したい各ノード
    def Unite(self, x, y):
        # 入力ノードのrootノードを見つける
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        # すでに同じ木に属していた場合
        if(x == y):
            return 
        # 違う木に属していた場合rnkを見てくっつける方を決める
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            # rnkが同じ（深さに差がない場合）は1増やす
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
    # xとyが同じグループに属するか判断
    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    # ノードxが属する木のサイズを返す
    def Count(self, x):
        return -self.root[self.Find_Root(x)]


n, m, k = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
cd = [list(map(int, input().split())) for _ in range(k)]
con = [1 for _ in range(n+1)]
uni = UnionFind(n+1)


for i in range(m):
    a, b = ab[i]
    con[a] += 1
    con[b] += 1
    uni.Unite(a, b)

for i in range(k):
    c, d = cd[i]
    if uni.isSameGroup(c,d):
        con[c] += 1
        con[d] += 1

result = []
for i in range(1, n+1):
    result.append(uni.Count(i)-con[i])
print(*result)
a = int(input())
b = int(input())
if 0 <= a <= 5:
    print(0)
if 6 <= a <= 12:
    print(b//2)
if 16 <= a <= 100:
    print(b)

### FIXED CODE ###

line = input()
a, b = [int(n) for n in line.split()]
if a>=13:
    print(b)
elif a>=6:
    b = b/2
    b = int(b)
    print(b)
else:
    print("0")
n,k = map(int, input().split())
mod = 10**9+7
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

for i in range(1,k+1):
    a = cmb(n-k+1,i)
    b = cmb(k-1,i-1)
    print((a*b)%mod)

### FIXED CODE ###

n,k = map(int, input().split())
mod = 10**9+7
from scipy.misc import comb

for i in range(1,k+1):
    print((comb(n-k+1,i,exact=True)*comb(k-1,i-1,exact=True))%mod)
n, k = map(int, input())
total = set()
for _ in range(k):
  d = int(input())
  a = set(map(int, input().split()))
  total = total | a
ans = n - len(total)
print(ans)
  

### FIXED CODE ###

n, k = map(int, input().split())
total = []
for _ in range(k):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    total.append(a)
ans = n - len(set(total))
print(ans)
n = input()
if n > = 1200:
    print "ARC"
else:
    print "ABC"

### FIXED CODE ###

n = input()
if n >= 1200:
    print "ARC"
else:
    print "ABC"
a = []
for _ in range(5):
  a.append(int(input()))
b =[]
c = []
for i in range(5):
  b[i] = a[i]
for i in range(5):
  while b[i] > 10:
  	b[i] = b[i] - 10
  if min(b[i]) = 10:
    return sum(a)
  else:
    for i in range(5):
    	if b[i] = 10:
          c[i] = a[i]
        else:
          c[i] = a[i] +10 -b[i]
        d = sum(c)
        mini = min(b)
        ans = d - 10 + mini
        return ans
    
        
          
      
      

### FIXED CODE ###

a = []
for i in range(5):
    a.append(int(input()))
b =[]
c = []
for i in range(5):
    b.append(int(a[i]))
for i in range(5):
    while b[i] > 10:
        b[i] = b[i] - 10
if min(b) == 10:
    ans = sum(a)
else:
    for i in range(5):
    	c.append(int(a[i]) +10 -int(b[i]))
    d = sum(c)
    mini = min(b)
    ans = d - 10 + mini
print(ans)
s=input()
ans=[]
I=[0]*len(s)
for i in range(len(s)):
    if (s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C"):
        I[i]=1

    else:
        I[i]=0
for i in range(I):
    if (I[i]==1 and I[i-1]==0) or (I[i]==1 and i==0):
        ans.append(1)
    elif (I[i]==1 and I[i-1]==1):
        ans[-1]+=1
print(max(ans))


### FIXED CODE ###

s=input()
ans=[]
I=[0]*len(s)
for i in range(len(s)):
    if (s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C"):
        I[i]=1

    else:
        I[i]=0
for i in range(len(I)):
    if (I[i]==1 and I[i-1]==0) or (I[i]==1 and i==0):
        ans.append(1)
    elif (I[i]==1 and I[i-1]==1):
        ans[-1]+=1
if ans==[]:
    print(0)
else:
    print(max(ans))
def nCr(n,r):
    com = 1
    for i in range (1,r+1):
        com =com*(n+1-i)//i
    return com
N,K = map(int,input().split())
print(nCr(N,K))
for i in range(1,K+1):
    com1 = nCr(N - K + 1, i)
    com2 = nCr(K-1,i-1)
    print((com1*com2)%(10**9+7))

### FIXED CODE ###

S = list(input())
if len(S) == 4 and (S.count(S[1])) == 2  and len(set(S))==2:
    print('Yes')
else:
    print('No')
def main():
    import sys
    import numpy as np
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n,m,q = ina()
    tmp = [[0]*(n+1) for _ in range(n+1)]
    for _ in range(m):
        l,r = ina()
        tmp[l][r]+=1


    tmp = np.cumsum(tmp,axis=1).cumsum(axis = 0)

    for _ in range(q):
        p,q = ina()
        rick = tmp[q][q]+tmp[p-1][p-1]-tmp[p-1][q]-tmp[q][p-1]
        print(rick)
        


    
        


        


    




















if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import sys
    import numpy as np
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n,m,q = ina()
    tmp = [[0]*(n+1) for _ in range(n+1)]
    for _ in range(m):
        l,r = ina()
        tmp[l][r]+=1


    tmp = np.cumsum(tmp,axis=1).cumsum(axis = 0)

    for _ in range(q):
        p,q = ina()
        rick = tmp[q][q]+tmp[p-1][p-1]-tmp[p-1][q]-tmp[q][p-1]
        print(rick)
        


    
        


        


    




















if __name__ == "__main__":
    main()