Harryxun/stf_run huggingface dataset:
n,a,b,c,d=map(int,input().split())
s=input()
if c<d and b<c:
  s=s[a-1:d]
elif c>d and b<d:
  t=s[b-1:d]
  s_=s[a-1:c]
elif a<c and c<b and b<d:
  s_=s[a-1:c]
  s=s[b-1:d]
  f=0
  f_=0
  for i in range(len(s_)):
    if s_[i]=='.':
      f=0
    elif s_[i]=='#' and f==0:
      f=1
    elif s_[i]=='#' and f==1:
      print('No')
      exit()
  for j in range(len(s)):
    if s[i]=='.':
      f_=0
    elif s[i]=='#' and f_==0:
      f_=1
    elif s[i]=='#' and f_==1:
      print('No')
      exit()
  print('Yes')
  exit()
if c<d and b<c:
  f=0
  for i in range(len(s)):
    if s[i]=='.':
      f=0
    elif s[i]=='#' and f==0:
      f=1
    elif s[i]=='#' and f==1:
      print('No')
      exit()
  print('Yes')
elif c>d and b<c
  f=0
  g=0
  h='No'
  for i in range(len(s)):
    if s_[i]=='.':
      f=0
    elif s_[i]=='#' and f==0:
      f=1
    elif s_[i]=='#' and f==1:
      print('No')
      exit()
  for j in range(len(t)):
    if t[j]=='.':
      g+=1
      if g==3:
        h='Yes'
    else:
      g=0
  print(h)    


### FIXED CODE ###

n,a,b,c,d=map(int,input().split())
s=input()
if c<d and b<c:
  s=s[a-1:d]
elif c>d and b<c:
  t=s[b-2:d+1]
  s_=s[a-1:c]
elif a<c<b<d:
  s_=s[a-1:c]
  s=s[b-1:d]
  f=0
  f_=0
  for i in range(len(s_)):
    if s_[i]=='.':
      f=0
    elif s_[i]=='#' and f==0:
      f=1
    elif s_[i]=='#' and f==1:
      print('No')
      exit()
  for j in range(len(s)):
    if s[i]=='.':
      f_=0
    elif s[i]=='#' and f_==0:
      f_=1
    elif s[i]=='#' and f_==1:
      print('No')
      exit()
  print('Yes')
  exit()
if c<d:
  f=0
  for i in range(len(s)):
    if s[i]=='.':
      f=0
    elif s[i]=='#' and f==0:
      f=1
    elif s[i]=='#' and f==1:
      print('No')
      exit()
  print('Yes')
else:
  f=0
  g=0
  h='No'
  for i in range(len(s_)):
    if s_[i]=='.':
      f=0
    elif s_[i]=='#' and f==0:
      f=1
    elif s_[i]=='#' and f==1:
      print('No')
      exit()
  for j in range(len(t)):
    if t[j]=='.':
      g+=1
      if g==3:
        h='Yes'
    else:
      g=0
  print(h)
N = int(input())
A = list(map(int, input().split()))
count, check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')
data = input()
    data = data.split(" ")
    n = int(data[0])
    k = int(data[1])
    sum = 0
    for b in range(1, n+1):
        sum += (n//b*max(0,b-k)+max(0,n%b-k+1))
    if k == 0: sum-=n
    print(sum)

### FIXED CODE ###

n,k=map(int,input().split())
if k==0:
    print(n**2)
    exit()
c=0
for b in range(1,n+1):
    c+=max(b-k,0)*(n//b)
    c+=max(n%b-k+1,0)
print(c)
import numpy as np

N,M,K = map(int,input().split())
A = np.array(list(map(int,input().split())))
B = np.array(list(map(int,input().split())))

total = 0

for i in range(N + M):
    if len(A) > 0 and A[0] <= B[0] and K - A[0] >= 0:
        K = K - A[0]
        A = A[1:]
        total += 1
    elif len(B) > 0 and K - B[0] >= 0:
        K = K - B[0]
        B = B[1:]
        total += 1
    else:
        break

print(total)

### FIXED CODE ###

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

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
            j -= 1
    ans = max(ans, i + j)
print(ans)
MOD = 10**9 + 7
MAX = 2000 + 5
fact = [1 for _ in range(MAX)]
finv = [1 for _ in range(MAX)]
for i in range(2, MAX):
    fact[i] = fact[i - 1] * i % MOD
    finv[i] = pow(fact[i], MOD-2, MOD)

def comb(n, k):
    if n < k or n < 0 or k < 0:
        return 0
    return (fac[n] * finv[k] % MOD) * finv[n-k] % MOD

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

for i in range(1, k+1):
    ans = comb(k-1, i-1) * comb(n-k+1, i) % MOD
    print(ans)


### FIXED CODE ###

MOD = 10**9 + 7
MAX = 2000 + 5
fac = [1 for _ in range(MAX)]
for i in range(2, MAX):
    fac[i] = fac[i - 1] * i % MOD

def comb(n, k):
    if n < k or n < 0 or k < 0:
        return 0
    return (fac[n] * pow(fac[k], MOD-2, MOD) % MOD) * pow(fac[n-k], MOD-2, MOD) % MOD

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

for i in range(1, k+1):
    ans = comb(k-1, i-1) * comb(n-k+1, i) % MOD
    print(ans)
S=input()
red=0
blue=0
for i in range(N):
    if S[i]==0:
        red+=1
    else:
        blue+=1
print(min(red,blue)*2)

### FIXED CODE ###

S=list(input())

red=0
blue=0
for i in range(len(S)):
    if S[i]=="0":
        red+=1
    else:
        blue+=1
        
print(min(red,blue)*2)
A,B = list(map(int,input()))

print(A-B+1)

### FIXED CODE ###

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

print(A-B+1)
n=int(input());print(min(x+n/x-2for x in range(1,int(n**.5)+1)if n%x<0))

### FIXED CODE ###

n=int(input());print(min(x+n//x-2for x in range(1,int(n**.5)+1)if n%x<1))
N = int(input())
H = list(map(int, input().split()))
if N == 1:
    print(0)
    exit()
reverse_H = H[::-1]
ans = 0
result = []
for i in range(N-1):
    if reverse_H[i] <= reverse_H[i+1]:
        ans += 1
    else:
        result.append(ans)
        ans = 0
print(max(result))


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
if N == 1:
    print(0)
    exit()
reverse_H = H[::-1]
ans = 0
result = []
for i in range(N-1):
    if reverse_H[i] <= reverse_H[i+1]:
        ans += 1
    else:
        result.append(ans)
        ans = 0
if ans > 0:
    result.append(ans)
if result:
    print(max(result))
else:
    print(0)
from math import ceil
N,K = map(int,input().split())
A = list(map(int,input().split()))

def possible(l):
    c = 0
    for i in range(N):
        n = A[i]//l
        c += n
    return c<=K

l = 0
r = max(A)
m = (l+r)/2
for i in range(32):
    pos = possible(m)
    if pos:
        r = m
    else:
        l = m
    m = (l+r)/2

ans = ceil(m)
if possible(ans-1):
    ans -= 1
print(ans)

### FIXED CODE ###

from math import ceil
N,K = map(int,input().split())
A = list(map(int,input().split()))

def possible(l):
    if l==0:
        return False
    c = 0
    for i in range(N):
        if A[i]%l==0:
            n = A[i]//l-1
        else:
            n = A[i]//l
        c += n
    return c<=K

l = 0
r = max(A)
m = (l+r)/2
for i in range(32):
    pos = possible(m)
    if pos:
        r = m
    else:
        l = m
    m = (l+r)/2

if possible(int(m)):
    print(int(m))
else:
    print(ceil(m))
isPair=True
isSet=True

def gen_factorization(N):
    tables=[-1]*(N+1)
    for i in range(2,N):
        if tables[i]!=-1:continue
        tmp=i
        while tmp<=N:
            tables[tmp]=i
            tmp+=i
    def fuctorization(n):
        if n==1:return 1
        elif n<0:n=abs(n)
        elif n>N:return -1
        ans={}
        while n!=1:
            tmp=tables[n]
            #debug print
            #print(tmp,n)
            ans.setdefault(tmp,0)
            ans[tmp]+=1
            n//=tmp
        return ans
    return fuctorization

N=int(input())
f=gen_factorization(10**6)
A=list(map(int,input().split()))
primes={}
for i in A:
  print(i)
  d=f(i)
  for j in d:
    primes.setdefault(j,0)
    primes[j]+=1
ansMax=max(primes.values())
ansMin=min(primes.values())
print(primes)
if ansMax==1:
  print('pairwise coprime')
elif ansMax==N:
  print('not coprime')
else:
  print('setwise coprime')

### FIXED CODE ###


def gen_factorization(N):
    tables=[-1]*(N+1)
    for i in range(2,N+1):
        if tables[i]!=-1:continue
        tmp=i
        while tmp<=N:
            tables[tmp]=i
            tmp+=i
    def fuctorization(n):
        if n==1:return {1:1}
        elif n<0:n=abs(n)
        if n>N:return "error"
        ans={}
        while n!=1:
            tmp=tables[n]
            #debug print
            #print(tmp,n)
            ans.setdefault(tmp,0)
            ans[tmp]+=1
            n//=tmp
        return ans
    return fuctorization

N=int(input())
f=gen_factorization(10**6+10)
A=list(map(int,input().split()))
primes={}
for i in A:
  d=f(i)
  for j in d:
    primes.setdefault(j,0)
    primes[j]+=1
primes[1]=1
ansMax=max(primes.values())

if ansMax==1:
  print('pairwise coprime')
elif ansMax==N:
  print('not coprime')
else:
  print('setwise coprime')
H, N = input().split()
H = int(H)
N = int(N)
A= input()
total=0
for i in A:
    total += int(i)
if total >= H:
    print("Yes")
elif total < H:
    print("No")

### FIXED CODE ###

H, N = input().split()
H = int(H)
N = int(N)
A= input().split()
total=0
for i in A:
    total += int(i)
if total >= H:
    print("Yes")
elif total < H:
    print("No")
s=input()
print("Good" if len(s)=len(set(s)) else "Bad")

### FIXED CODE ###

s=input()

flag=True
for i in range(len(s)-1):
    if s[i+1]==s[i]:
        flag=False
print("Good" if flag else "Bad")
def main1():
    N=int(input())
    A=map(int,input().split())
    A.sort()
    ans=[0]*(10**6)
    for i in  range(len(A)-1):
        if ans[i]>=2:
            continue
        if A[i]!=A[i+1]:
            ans[i]+=1
        for j in range(A[i]*2,10**6,A[i]):
                ans[j]=2
    print(ans.count(1))
main1()

### FIXED CODE ###

def main1():
    N=int(input())
    A=list(map(int,input().split()))
    A.sort()
    ans=[0]*(10**6+1)
    if N ==1 :
        print(1)
        return 
    for i in  range(len(A)):
        ans[A[i]]+=1
        if ans[A[i]]==1:
            for j in range(A[i]*2,10**6+1,A[i]):
                ans[j]=2
    print(ans.count(1))
main1()
a = int(input())
b = int(input())
print(a*b, ' ', (a+b) * 2 )


### FIXED CODE ###

a , b = map(int, input().split())
print(a * b, (a + b) * 2)
s=str(input())
n=len(s)
i=0
ans=0
c=0
while i < n:
	if s[i] == "<":
		c=c+1
		ans=ans+c
	else:
		j=1
		while (i >= j) and (s[i-j] == ">"):
			j=j+1
		if j > 1:
			if d >= j:
				ans=ans+j-1
			else:
				ans=ans+j
		elif i == 0:
			ans=1
		else:
			d=c
		c=0
	i=i+1
print(ans)

### FIXED CODE ###

s=str(input())
n=len(s)
i=0
ans=0
c=0
d=0
j=0
while i < n:
	if s[i] == "<":
		c=c+1
		ans=ans+c
		j=0
	else:
		j=j+1
		if j > 1:
			if d >= j:
				ans=ans+j-1
			else:
				ans=ans+j
		elif i == 0:
			ans=1
		else:
			d=c
		c=0
	i=i+1
print(ans)
s = input().split("T")
x, y = map(int, input().split())
x -= len(s[0])
s.pop(0)

list_yoko = [len(s[i]) for i in range(1, len(s), 2)]
list_tate = [len(s[i]) for i in range(0, len(s), 2)]

set_yoko = {list_yoko[0], -list_yoko[0]}
set_tate = {list_tate[0], -list_tate[0]}

for i in list_yoko[1:]:
	sy = set()
	for j in set_yoko:
		sy |= {j + i, j - i}
	set_yoko = sy

for i in list_tate[1:]:
	st = set()
	for j in set_tate:
		st |= {j + i, j - i}
	set_tate = st

if (x in set_yoko) and (y in set_tate):
	print("Yes")
else:
	print("No")

### FIXED CODE ###

s = input().split("T")
x, y = map(int, input().split())
x -= len(s[0])
s.pop(0)

list_yoko = [len(s[i]) for i in range(1, len(s), 2)]
list_tate = [len(s[i]) for i in range(0, len(s), 2)]

if list_yoko == []:
	list_yoko = [0]

if list_tate == []:
	list_tate = [0]
	
set_yoko = {list_yoko[0], -list_yoko[0]}
set_tate = {list_tate[0], -list_tate[0]}

for i in list_yoko[1:]:
	sy = set()
	for j in set_yoko:
		sy |= {j + i, j - i}
	set_yoko = sy

for i in list_tate[1:]:
	st = set()
	for j in set_tate:
		st |= {j + i, j - i}
	set_tate = st

if (x in set_yoko) and (y in set_tate):
	print("Yes")
else:
	print("No")
N = int(input())
A = list(map(int, input().split()))

A.sort()
a_list = [A[0]]
ans = 0
if A[0] != A[1]:
    ans += 1
for i in range(1, N):
    if A[i] == A[i-1]:
        continue
    for a in a_list:
        if A[i] % a == 0:
            break
    else:
        a_list.append(A[i])
        ans += 1

print(ans)


### FIXED CODE ###

from collections import Counter

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

c = Counter(A)
p = [True]*(10**6+1)

for k, v in c.items():
    t = k*2
    while t <= 10**6:
        p[t] = False
        t += k

ans = 0
for a in A:
    if c[a] == 1 and p[a]:
        ans += 1
print(ans)
while True:
    n = int(raw_input())
    if n == 0:
        break
    s = [[] for i in range(n)]
    for i in range(n):
        s[i] = raw_input()
    for i in range(n,0,-1):
        for j in range(n-i+1):
            for k in range(n-i+1):
                flag = 0
                for l in range(i):
                    for m in range(i):
                        if s[j+l][k+m] = "*":
                            flag = 1
                            break
                if flag == 0:
                    print i
                else:
                    break
            if flag == 1: break
        if flag == 1: break
    if flag == 0:
        print 0

### FIXED CODE ###

while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))
n,h = (int(i) for i in input().split())
x = [[int(i) for i in input().split()] for i in range(n)]
a,b = 0,[]
for j in x:
	if j[0] > a: a = j[0]
	b.append(j[1])
b.sort()
while b[0]<=a: b = b[1:]
h -= sum(b)
if h%a==0: answer = (h-h%a)//a + len(b)
else: answer = (h-h%a)//a + len(b) + 1
print(answer)

### FIXED CODE ###

def main():
    N, H = map(int, input().split())
    AB = (tuple(map(int, input().split())) for _ in [0] * N)
    a, b = [], []
    appenda, appendb = a.append, b.append
    for i, j in AB:
        appenda(i)
        appendb(j)

    amax = max(a)
    b = [i for i in b if i > amax]
    b.sort(reverse=1)
    energy = H
    if energy <= sum(b):
        attack = 0
        i = 0
        while energy > 0:
            energy -= b[i]
            attack += 1
            i += 1
    else:
        energy -= sum(b)
        attack = (energy + amax - 1) // amax + len(b)

    print(attack)

main()
n, a = map(int, input().split())
x = list(map(int, input().split()))
dp = [[[0 for s in range(n * 50)] for k in range(n + 1)] for j in range(n + 1)]
for j in range(n + 1):
    for k in range(n + 1):
        for s in range(n * 50):
            if (j == 0) and (k == 0) and (s == 0):
                dp[j][k][s] = 1
            elif (j > 0) and (s < x[j - 1]):
                dp[j][k][s] = dp[j - 1][k][s]
            elif (j > 0) and (k > 0) and (s >= x[j - 1]):
                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j - 1]]
ans = 0
for k in range(1, n + 1):
    ans += dp[j][k][k * a]
print(ans)

### FIXED CODE ###

n, a = map(int, input().split())
x = list(map(int, input().split()))
X = max(x)
y = [i - a for i in x]
dp = [[0 for t in range(2 * n * X + 10)] for j in range(n + 1)]
dp[0][n * X] = 1
for j in range(1, n + 1):
    for t in range(2 * n * X + 1):
        if 0 <= t - y[j - 1] <= 2 * n * X:
            dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y[j - 1]]
        else:
            dp[j][t] = dp[j - 1][t]
print(dp[n][n * X] - 1)
A,B=map(int,input().split())
cal,cal2=0,0
ans=[]

for i in range(1200):
    cal=math.floor(i*0.08)
    cal2=math.floor(i*0.1)

    if cal==A and cal2==B:
        ans.append(i)


if len(ans)>0:
    print(min(ans))
else :
    print(-1)


### FIXED CODE ###

import math
A,B=map(int,input().split())
cal,cal2=0,0
ans=[]

for i in range(1200):
    cal=math.floor(i*0.08)
    cal2=math.floor(i*0.1)

    if cal==A and cal2==B:
        ans.append(i)


if len(ans)>0:
    print(min(ans))
else :
    print(-1)
a,b,c,d,e,f=map(int,input().split())
a*=100
b*=100
x=set()
for i in range(0,f+1,a):
    for j in range(0,f+1,b):
        if 0<(i+j)<=f:
            x.add(i+j)
y=set()
for i in range(0,f+1,c):
    for j in range(0,f+1,d):
        if 0<(i+j)<=f:
            y.add(i+j)

ans=[]
noudoma=e/100
for n in x:
    for m in y:
        if n==0:
            continue
        if m/n<=noudoma and (n+m)<=f:
            ans.append([n+m,m,m/(n+m)])

ans.sort(key=lambda x:x[2], reverse=True)


print(ans[0][0],ans[0][1])


### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
a*=100
b*=100
x=set()
for i in range(0,f+1,a):
    for j in range(0,f+1,b):
        if 0<(i+j)<=f:
            x.add(i+j)
y=set()
for i in range(0,f+1,c):
    for j in range(0,f+1,d):
        if 0<(i+j)<=f:
            y.add(i+j)

ans=[]
for n in x:
    for m in y:
        if n+m>f:
            continue
        if n*e<m*100:
            continue
        ans.append([n+m,m,m/n])
if not ans:
    print(a,0)
    exit()
ans.sort(key=lambda x:x[2], reverse=True)

print(ans[0][0],ans[0][1])
N, M, X, Y = map(int, input().split())

xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

if (max(xs) < min(ys)) ans (X < Y):
    print("No War")
else:
    print("War")

### FIXED CODE ###

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

xs = list(map(int, input().split()))
xs.append(X)
ys = list(map(int, input().split()))
ys.append(Y)

if max(xs) < min(ys):
    print("No War")
else:
    print("War")
a,b,c=map(int,input.split())
print('Yes' if a+b >= c else 'No')

### FIXED CODE ###

a,b,c=map(int,input().split())
print('Yes' if a+b >= c else 'No')
N, M = map(int, input().split())
g = [list() for _ in range(M + 1)]
for _ in range(M):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)

ans = 0
def walk(cur, visited):
    global ans
    if cur == N:
        ans += 1
        return
    visited.append(cur)
    for nex in g[cur]:
        if nex not in visited:
            walk(nex, visited)
walk(1, [])
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
g = [[]for _ in range(n + 1)]
for _ in range(m):
    a, b = map(int, input().split())
    g[a].append(b) 
    g[b].append(a)

ret = 0
def walk(node, visited):
    global ret
    tmp = visited + [node]
    if len(tmp) == n:
        ret += 1 
    for nd in g[node]:
        if nd not in tmp:
            walk(nd, tmp)
walk(1, [])
print(ret)
N=()
M=()
A=()

N=int(input(""))
M=int(input(""))
      
for i in range (0,M):
      A=int(input(""))
      N=(N-A)
      
if N<0:
      print("-1")
else:
      print(N)

### FIXED CODE ###

N=()
M=()
A=()

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

A = list(map(int, input().split()))
for i in range(0,M): 
      N=N-A[i]
      
if N<0:
      print("-1")
else:
      print(N)
import ractions
a,b,c,d = map(int,input().split())
x = b//c + b//d - b//(c*d//ractions.gcd(c,d))
y = (a-1)//c + (a-1)//d - (a-1)//(c*d//ractions.gcd(c,d))
print(b-(a-1)-x+y)


### FIXED CODE ###

import fractions
a,b,c,d = map(int,input().split())
x = b//c + b//d - b//(c*d//fractions.gcd(c,d))
y = (a-1)//c + (a-1)//d - (a-1)//(c*d//fractions.gcd(c,d))
print(b-(a-1)-x+y)
s1, s2, s3 = map(int, input().split())

str.upper(s1[0]+" "+s2[1]+" "+s3[2])


### FIXED CODE ###

s1, s2, s3 = input().split()

print(str.upper(s1[0]+s2[0]+s3[0]))
n=input()
if (n==1):
　print("Hello world")
else:
　a=input()
　b=input()
　print(a+b)

### FIXED CODE ###

n=input()
if int(n) == 1:
  print("Hello World")
else:
  a=input()
  b=input()
  print(int(a)+int(b))
N, K = list(map(int, input().split()))
L = llst(map(int, input().split()))
sort.L(reverse = True)
print(sum(l in L for k in range(K+1)))

### FIXED CODE ###

n,k=map(int,input().split())
l=list(map(int,input().split()))
l.sort(reverse=True)
snake=0
for i in range(k):
  snake+=l[i]
print(snake)
A,B = list(map(int,input().split()))
for i in range(1,10**5):
  if i%A == 0 and i%B == 0:
    ans = i
    break
  else:
    i += 1
print(ans)

### FIXED CODE ###

from fractions import gcd
A,B = map(int,input().split())
lcm = A * B // gcd(A, B)
print(lcm)
N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) for x in range(len(L)+1)]
TF = [i < X for i in accumL]
print(str(TF.index(False)+ 1))

### FIXED CODE ###

N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) <= X for x in range(len(L)+1)]
if accumL[-1] == True:
  print(N + 1)
else:
  print(accumL.index(False))
from collections import defaultdict

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

friend_list = defaultdict(list)
for _ in range(M):
    a, b = map(int, input().split(' '))
    a, b = a - 1, b - 1
    friend_list[a].append(b)
    friend_list[b].append(a)

block_list = defaultdict(list)
for _ in range(K):
    c, d = map(int, input().split(' '))
    c, d = c - 1, d - 1
    block_list[c].append(d)
    block_list[d].append(c)


def dfs(s, adj_list):
    cand_list = [s]
    vis_list = []

    while len(cand_list) > 0:
        vis = cand_list.pop(-1)
        vis_list.append(vis)
        pre_cand_list = adj_list[vis]
        for cand in pre_cand_list:
            if cand in vis_list:
                continue
            if cand in cand_list:
                continue
            cand_list.append(cand)

    return vis_list


num_friend_candidate_array = [0, ] * N
visited_user_list = []

for i in range(N):
    if i in visited_user_list:
        continue

    connected_components = dfs(i, friend_list)
    visited_user_list += connected_components

    for j in connected_components:
        exclude_block_user = set(connected_components) - set(block_list[j])
        friend_candidates = len(exclude_block_user) - len(friend_list[j]) - 1
        num_friend_candidate_array[j] = max(len(friend_candidates), 0)

print(*num_friend_candidate_array)


### FIXED CODE ###

from collections import defaultdict


class UnionFind:
    def __init__(self, n=0):
        self.d = {i: -1 for i in range(n)}

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

    def unite(self, x, y):
        x, y = self.find(x), self.find(y)
        if (x == y):
            return False
        if (self.d[x] > self.d[y]):
            x, y = y, x
        self.d[x] += self.d[y]
        self.d[y] = x
        return True

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

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


N, M, K = map(int, input().split(' '))
deg = defaultdict(int)
to = defaultdict(list)
uf = UnionFind(N)

for _ in range(M):
    a, b = map(int, input().split(' '))
    a -= 1
    b -= 1
    deg[a] += 1
    deg[b] += 1
    uf.unite(a, b)

for _ in range(K):
    c, d = map(int, input().split(' '))
    c -= 1
    d -= 1
    to[c].append(d)
    to[d].append(c)

for i in range(N):
    ans = uf.size(i) - 1 - deg[i]
    for u in to[i]:
        if uf.same(i, u):
            ans -= 1
    print(ans, end=' ' if i != (N - 1) else '\n')