Harryxun/stf_run huggingface dataset:
"""
問題文

N個の整数 A1,A2,...,ANが黒板に書かれています。
あなたはこの中から整数を 1つ選んで、1 以上 109以下の好きな整数に書き換えます。
元の整数と同じ整数に書き換えても構いません。書き換えた後のN個の整数の最大公約数の最大値を求めてください。

制約
入力は全て整数である。
2≤N≤105
1≤Ai≤109
"""

"""
3 5 7
最大公約数: 1
最大の最大公約数: 1

8 4 6
最大公約数: 2
最大の最大公約数: 4
『aとbとcの最大公約数』　＝　『aとbの最大公約数』と『c』　の最大公約数

A1 , A2 , A3 ... An

gcd(A1 , A2 , A3 ... An-1) * N
= gcd * N * N
= gcd * N^2

gcd(A1 , A2 , A3 ... An-1)
gcd(A1 , A2 , A3 ... An-2 , An) = gcd(A1 , A2 , A3 ... An-2) , An
"""
#from math import gcd
from fractions import gcd  # for Ver.3.4 or lower.
from functools import reduce
gcd_map = {}
def GCD(numbers , startIndex , endIndex):
    if len(numbers) == 0 : return 0
    if len(numbers) == 1 : return numbers[0]
    if len(numbers) == 2 : 
        return gcd(numbers[0] , numbers[1])
    else : 
        set_index = (startIndex , endIndex)
        if set_index in gcd_map : 
            return gcd_map[set_index]
        value = GCD(numbers[1:] , startIndex + 1 , endIndex)
        result = gcd(value , numbers[0])
        gcd_map[set_index] = result
        return result

def main() : 
    N = int(input())
    a_list = input().split(" ")
    a_list = [int(i) for i in a_list]
    maxValue = 0
    for i in range(N) : 
        if i == 0 : 
            prev_list = a_list[1:]
            rst = GCD(prev_list , 1 , N - 1)
        elif i == N - 1 : 
            after_list = a_list[:N-1]
            rst = GCD(after_list , 0 , N - 2)
        else : 
            prev_list = a_list[0 : i ]
            after_list = a_list[i + 1 :] 
            rst = gcd(GCD(prev_list , 0 , i - 1) , GCD(after_list , i + 1 , N - 1))
        if maxValue < rst : maxValue = rst
    print(maxValue)
main()


### FIXED CODE ###

"""
問題文

N個の整数 A1,A2,...,ANが黒板に書かれています。
あなたはこの中から整数を 1つ選んで、1 以上 109以下の好きな整数に書き換えます。
元の整数と同じ整数に書き換えても構いません。書き換えた後のN個の整数の最大公約数の最大値を求めてください。

制約
入力は全て整数である。
2≤N≤105
1≤Ai≤109
"""

"""
3 5 7
最大公約数: 1
最大の最大公約数: 1

8 4 6
最大公約数: 2
最大の最大公約数: 4
『aとbとcの最大公約数』　＝　『aとbの最大公約数』と『c』　の最大公約数

A1 , A2 , A3 ... An

gcd(A1 , A2 , A3 ... An-1) * N
= gcd * N * N
= gcd * N^2

gcd(A1 , A2 , A3 ... An-1)
gcd(A1 , A2 , A3 ... An-2 , An) = gcd(A1 , A2 , A3 ... An-2) , An
"""
def gcd(a, b):  # a>b
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

from functools import reduce
def GCD(numbers):
    if len(numbers) == 0 : return 0
    if len(numbers) == 1 : return numbers[0]
    if len(numbers) == 2 : 
        return gcd(numbers[0] , numbers[1])
    else : 
        value = GCD(numbers[:len(numbers)-1])
        result = gcd(value , numbers[len(numbers) - 1])
        return result

def main() : 
    N = int(input())
    a_list = input().split(" ")
    a_list = [int(i) for i in a_list]
    R = [0 for i in range(N - 1)]
    L = [0 for i in range(N - 1)]
    R[0] = a_list[0]
    L[0] = a_list[-1]

    for i in range(1 , N-1) : 
        R[i] = gcd(R[i - 1] , a_list[i])
    
    for j in range(1 , N-1) : 
        L[j] = gcd(L[j - 1] , a_list[- j - 1])
    
    maxValue = 0
    for i in range(N - 2) : 
        value = gcd(R[i] , L[N - i - 3])
        if value > maxValue : maxValue = value
    print(max(maxValue , R[-1] , L[-1]))
main()
A , B , M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
M -= 1
ans = []
for i in range():
    q = list(map(int, input().split()))
    x = a[q[0]-1] + b[q[1]-1] - q[2]
    ans.append(x)
print(min(ans))

### FIXED CODE ###

A , B , M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = [min(a) + min(b)]
for i in range(M):
    q = list(map(int, input().split()))
    x = a[q[0]-1] + b[q[1]-1] - q[2]
    ans.append(x)
print(min(ans))
N = int(input())
x = 0
for _ in range(N):
    k, u = tuple(input().split())
    k += float(x)*(380000 if u == 'BTC' else 1)
print(k)

### FIXED CODE ###

N = int(input())
x = 0
for _ in range(N):
    k, u = input().split()
    x += float(k)*(380000 if u == 'BTC' else 1)
print(x)
n=int(input())
A=np.array(list(map(int,input().split())))
print(1/sum(1/A))


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
s = 0
for i in range(n):
    s += (1/a[i])

print(1/s)
import numpy as np

n = int(input())

if n % 2 != 0:
    print(0)
    exit()

logtenN = int(np.log10(n))


ans = 0
for i in range(1,logtenN+1):
    add10 = n//(10**i)
    ans += add10
    logfiveAddTen = int(np.log10(add10)/np.log10(5))
    for j in range(1,logfiveAddTen):
        add5 = (add10//(5**j))//2
        ans += add5

print(ans)


### FIXED CODE ###

n = int(input())
ans = 0
if n % 2 != 0:
    print(0)
    exit()
denominator = 10
while n >= denominator:
    ans += n//denominator
    denominator *= 5

print(ans)
a,b,c = list(map(int,input().split()))
a1 = a//c
a2 = b//c if b%x else b//c-1
print(a1-a2)

### FIXED CODE ###

a,b,c = list(map(int,input().split()))
x = a//c 
y = b//c
if a%c:
    print(y-x)
else:
    print((y-x)+1)
from collections import defaultdict

def inside(x, y):    
    return 0 <= x <= h - 3 and 0 <= y <= w - 3

h, w, n = (int(_) for _ in input().split())
black = defaultdict(int)
for i in range(n):
    a, b = (int(_) - 1 for _ in input().split())
    for j in range(3):
        for k in range(3):
            x, y = a - j, b - k
            if not inside(x, y):
                continue
            black[(x, y)] += 1
ans = [0 for i in range(10)]
ans[0] = (h-2)*(w-2) - len(black)
for k in black:
    ans[black[k]] += 1
for i in range(10):
    print(ans[i])


### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())
print((a + b) * h // 2)
n, m = input().split()
ni = int(n)
mi = int(m)
l1 = []
for i in range (mi):
    ai = int(input())
    l1.append(ai)
s = sum(l1)
r = (ni - s)
if r >= 0:
    print(r)
else:
    print("-1")

### FIXED CODE ###

import math
r = int(input())
p = math.pi
a = p * (r * 2)
print(a)
N = int(input())
t0, x0, y0 = 0, 0, 0
flag=True
for i in range(N):
    t1,x1,y1 = [int(j) for j in input().split()]
    dt = t1 - t0
    dist = abs(x0-x1) + abs(y0-y1)

    if dist > dt:
        print('No')
        flag=False
	break

    elif (dist%2==0 and dt%2==0) or  (dist%2==1 and dt%2==1):
        t0, x0, y0 = t1, x1, y1

    else:
        print('No')
        flag=False
	break

if flag:
    print('Yes')

### FIXED CODE ###

import sys

def main():
    N = int(input())
    t, x, y = 0, 0, 0

    for _ in range(N):
        next_t, next_x, next_y = [int(__) for __ in input().split()]

        delta_t = next_t - t
        distance = abs(next_x - x) + abs(next_y - y)

        if distance > delta_t:
            print("No")
            sys.exit()

        if (delta_t - distance) % 2 != 0:
            print("No")
            sys.exit()

        t, x, y = next_t, next_x, next_y

    print("Yes")

main()
from collections import Counter
n = int(input())
a = Counter(list(map(int, input().split())))
a = [list(x) for x in a.items() if x[1]>=2]
a.sort(reverse=True, key=lambda x: (x[0], x[1]))
count = 0
base = 4
for i in len(a):
    if count == 1:
        print(l*a[i][0])
        exit()
    else:
        l = a[0]
        count += 1

    if a[1]>=4:
        print(a[i][0]*a[i][0])
        exit()

print(0)


### FIXED CODE ###

from collections import Counter
n = int(input())
a = Counter(list(map(int, input().split())))
a = [list(x) for x in a.items() if x[1]>=2]
a.sort(reverse=True, key=lambda x: (x[0], x[1]))
count = 0
base = 4
for i in range(len(a)):
    if count == 1:
        print(l*a[i][0])
        exit()
    else:
        l = a[i][0]
        count += 1

    if a[i][1]>=4:
        print(a[i][0]*a[i][0])
        exit()

print(0)
N = int(input())

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

return num2alpha(N)

### FIXED CODE ###

N = int(input())

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

print(num2alpha(N).lower())
import sys
import os

n = sys.argv[1]
n = n[-1]

if n == "2" or n == "4" or n == "5" or n == "7" or n == "9":
    print("hon")
elif n == "0" or n == "1" or n == "6" or n == "8":
    print("pon")
elif n == "3":
    print("bon")

sys.exit()


### FIXED CODE ###

import sys
import os

n = input()
n = n[-1]

if n == "2" or n == "4" or n == "5" or n == "7" or n == "9":
    print("hon")
elif n == "0" or n == "1" or n == "6" or n == "8":
    print("pon")
elif n == "3":
    print("bon")

sys.exit()
S = input()
if S =="hi" or S =="hihi" or S =="hihihi" or S = "hihihihi" or S ="hihihihihi":
	print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
if S =="hi" or S =="hihi" or S =="hihihi" or S == "hihihihi" or S =="hihihihihi":
	print("Yes")
else:
  print("No")
N=int(input())
MAXN=1005
MAXV=N*(N-1)//2

a=[[0 for j in range(N-1)] for i in range(N)]
for i in range(N):
  line=list(map(int,input().split()))
  for j in range(N-1):
    a[i][j]=line[j]-1

id=[[0 for j in range(MAXN)] for i in range(MAXN)]
v=0
for i in range(N-1):
  for j in range(i+1,N):
    id[i][j]=v
    v+=1

def toId(i,j):
  if i>j:
    i,j=j,i
  return id[i][j]

to=[[] for i in range(MAXV)]
for i in range(N):
  for j in range(N-1):
    a[i][j]=toId(i,a[i][j])
  for j in range(N-2):
    to[a[i][j+1]].append(a[i][j])
    
visited=[False for i in range(MAXV)]
calculated=[False for i in range(MAXV)]
dp=[0 for i in range(MAXV)]

def dfs(v):
  if visited[v]:
    if not calculated[v]:
      return -1
    return dp[v]
  visited[v]=True
  for u in to[v]:
    val=dfs(u)
    if val==-1:
      return -1
    if val+1>dp[v]:
      dp[v]=val+1
  calculated[v]=True
  return dp[v]
    
ans=0
for i in range(v):
  res=dfs(i)
  if res==-1:
    print(-1)
    break
  if ans<res:
    ans=res
else:
  print(ans+1)


### FIXED CODE ###

N=int(input())
a=[[0 for j in range(N-1)] for i in range(N)]
for i in range(N):
  line=list(map(int,input().split()))
  for j in range(N-1):
    a[i][j]=line[j]-1
  a[i]=a[i][::-1]
    
q=[]

#seen=[[False for j in range(N)] for i in range(N)]

# 選手nが試合できるならqueに入れる
def check(i):
  if len(a[i])==0:
    return False
  j=a[i][-1]
  if a[j][-1]==i:
    q.append([i,j])
  
for i in range(N):
  check(i)
  
from collections import defaultdict

day=0
while q:
  day+=1
 # q=sorted(q)
  prevQ=q.copy()
  q=[]
  matched=defaultdict(list)
  for p in prevQ:
    i=p[0]
    j=p[1]
    if i>j:
      i,j=j,i
    if matched[i]:
      continue
    a[i].pop()
    a[j].pop()
    check(i)
    check(j)
    matched[i].append(j)
    
for i in range(N):
  if len(a[i])!=0:
    print(-1)
    break
else:
  print(day)
X, M = map(int, input().split())
NN = N
li = []
while X not in li and N != 0:
    li = li + [X]
    X = X ** 2 % M
    N -= 1
    
if N == 0:
    print(sum(x for x in li))

elif N != 0 and X in li:
    l = len(li)
    s = li.index(X)
    T = l - s
    q = (NN - s) // T
    r = (NN - s) % T
    print(sum(li[i] for i in range(s)) + sum(li[i] for i in range(s, len(li))) * q
              + sum(li[i] for i in range(s, s + r)))

### FIXED CODE ###

N, X, M = map(int, input().split())
NN = N
li = []
isused = [False] * M
while isused[X] == False and N != 0:
    li.append(X)
    isused[X] = True
    X = (X ** 2) % M
    N -= 1
    
if N == 0:
    print(sum(li))

elif N != 0 and X in li:
    l = len(li)
    s = li.index(X)
    T = l - s
    q = (NN - s) // T
    r = (NN - s) % T
    print(sum(li) + sum(li[i] for i in range(s, len(li))) * (q-1) + sum(li[i] for i in range(s, s + r)))
from collections import defaultdict
d = defaultdict(int)
n=int(input())
v=list(map(int,input().split()))
for i in range(n):
    d[v[i]]+=1
D=sorted(d.items(), key=lambda x:x[1])
if len(D)==1:
    print(D[0][1]//2)
elif len(D)==2:
    print(0)
else len(D)>=3:
    h=0
    for i in range(len(D)-2):
        h+=D[i][1]
    print(h)


### FIXED CODE ###

from collections import defaultdict
d0 = defaultdict(int)
d1 = defaultdict(int)
N=int(input())
v=list(map(int,input().split()))
for i in range(N):
    if i%2==0:
        d0[v[i]]+=1
    else:
        d1[v[i]]+=1
D0=sorted(d0.items(), key=lambda x:x[1],reverse=True)
D1=sorted(d1.items(), key=lambda x:x[1],reverse=True)
if (D0[0][1]+D1[0][1])==len(v) and D0[0][0]==D1[0][0]:
    print(len(v)//2)
else:
    i0=0
    i1=0
    while i0<=len(D0) or i1<=len(D1):
        if D0[i0][0]!=D1[i1][0]:
            print(len(v)-D0[i0][1]-D1[i1][1])
            break
        else:
            if D0[i0][1]>D1[i1][1]:
                i1+=1
            elif D0[i0][1]<D1[i1][1]:
                i0+=1
            else:
                if (len(D0)-1-i0)>0 and (len(D1)-1-i1)>0:
                    if D0[i0+1][1]>D1[i1+1][1]:
                        i0+=1
                    else:
                        i1+=1
                elif (len(D0)-1-i0)==0 :
                    i1+=1
                elif (len(D1)-1-i1)==0:
                    i0+=1
A, B, C, X, Y = map(int, input().split(' '))
ans = A * X + B * Y
for k in range(1, max(X, Y) + 1):
    _ans = 2 * C * k + max(X - k, 0) * A + max(Y - k, 0) * B
    if _ans < ans:
        ans = _ans
print(ans)

### FIXED CODE ###

s = input()
count = 0
for i in range(3):
    if 'o' in s[i]:
        count += 1
print(700 + count * 100)
h,w = map(int,input().split())
Array = [list(map(str,input())) for _ in range(h)]
dx = [1,1,0,-1,-1,-1,0,1]
dy = [0,1,1,1,0,-1,-1,-1]
for i in range(h):
  for j in range(w):
    if Array[i][j]='#':
      continue
    num=0
    for d in range(8):
      ni = i+dy[d]
      nj = j+dx[d]
      if ni<0 or h<=ni:
        continue
      if nj<0 or w<=nj:
        continue
      if Array[ni][nj]=='#':
        num=num+1
    Array[i][j]=char(num)
    
for i in Array:
  print(i)

### FIXED CODE ###

h,w = map(int,input().split())
Array = [list(map(str,input())) for _ in range(h)]
dx = [1,1,0,-1,-1,-1,0,1]
dy = [0,1,1,1,0,-1,-1,-1]
for i in range(h):
  for j in range(w):
    if Array[i][j]=='#':
      continue
    num=0
    for d in range(8):
      ni = i+dy[d]
      nj = j+dx[d]
      if ni<0 or h<=ni:
        continue
      if nj<0 or w<=nj:
        continue
      if Array[ni][nj]=='#':
        num=num+1
    Array[i][j]=str(num)
    
for i in Array:
  print(*i, sep='')
x,a,b=map(int,input().split())
print('delicious' if 0<b-a else 'dangerous' x>b-a else 'safe')

### FIXED CODE ###

x,a,b=map(int,input().split())
print('delicious' if b-a<=0 else 'dangerous' if x<b-a else 'safe')
input_line = input()
l = input().split(' ')
l = [int(x) for x in l]

if l[0] < l[1]:
  print(0)
else:
  print(10)


### FIXED CODE ###

input_line = input()
l = input_line.split(' ')
l = [int(x) for x in l]

if l[0] < l[1]:
    print(0)
else:
    print(10)
n = int(input())

ans = ''

while n > 0:
    n -= 1
    ans += chr(ord('a') + n % 26)
    n //= 26

print(ans[::-1])


### FIXED CODE ###

s = input()

if s == s.upper():
    print('A')
else:
    print('a')
n = int(input())
h_li = list(map(int,input().split()))
tmp = h_li[0]
move = 0
res = []
for i,x in enumerate(h_li[1::]):
    if tmp >= x:
        move += 1
        tmp = x
        if i == len(h_li)-2:
            res.append(move)
    else:
        res.append(move)
        move = 0
        tmp = x
        
print(max(res))

### FIXED CODE ###

n = int(input())
h_li = list(map(int,input().split()))
tmp = h_li[0]
move = 0
res = [0]
for i,x in enumerate(h_li[1::]):
    if tmp >= x:
        move += 1
        tmp = x
        if i == len(h_li)-2:
            res.append(move)
    else:
        res.append(move)
        move = 0
        tmp = x
        
print(max(res))
N = input()
length = len(N)

count = 0
last = 0
for i in range(length-1):
    last = i
    if i % 2 == 0:
        count += 9*(10**i)

number = int(N)
if i%2 == 1:
    count += number + 1 - 10**(last+1)
print(count)

### FIXED CODE ###

N = input()
length = len(N)

count = 0
last = 0
for i in range(length-1):
    last = i
    if i % 2 == 0:
        count += 9*(10**i)

number = int(N)
if length == 1:
    count = number
elif last%2 == 1:
    count += number + 1 - 10**(last+1)
print(count)
S, W = map(int.input(" ")) 
if W >= S :
    print("Unsafe")
else:
    print("Safe")

### FIXED CODE ###

S, W = list(map(int, input().split()))
if W >= S :
    print("unsafe")
else:
    print("safe")
def main():
  n = int(input())
  a_li , b_li = [] , []
  for _ in range(n):
    x , y = int(input())
    a_li.append(x + y)
    b_li.append(x - y)
    print(max(max(a_li) - min(a_li), max(b_li) - min(b_li)))

if __name__ == "__main__":
  main()

### FIXED CODE ###

def main():
  n = int(input())
  a_li , b_li = [] , []
  for _ in range(n):
    x , y = map(int,input().split())
    a_li.append(x + y)
    b_li.append(x - y)
  print(max(max(a_li) - min(a_li), max(b_li) - min(b_li)))
 
if __name__ == "__main__":
  main()
N=int(input())
X=[int(input())]

def insert_search(List,a,l,r):
  if r==l:
    List[l-1]=a
    return List
  m=(l+r)//2
  if List[m]<a:
    return insert_search(List,a,m+1,r)
  elif List[m]!=a:
    return insert_search(List,a,l,m-1)
  else:
    while List[m]==a:
      m-=1
    List[m]=a
    return List
for i in range(N-1):
  a=int(input())
  if a>X[-1]:
    X[-1]=a
  elif X[0]>=a:
    X.insert(0,a)
  else:
    X=insert_search(X,a,0,len(X)-1)
print(len(X))

### FIXED CODE ###

N=int(input())
from collections import deque
d = deque([int(input())]) 
import bisect

for i in range(N-1):
  a=int(input())
  if a>d[-1]:
    d[-1]=a
  elif d[0]>=a:
    d.appendleft(a)
  else:
    i=bisect.bisect_left(d,a)
    d[i-1]=a
print(len(d))
#
import sys
import math
import numpy as np
import itertools


# ひとつ入力
n = int(input())
# リストに入れる
a = [int(i) for i in input().split()] 

hidari = [0]*n
migi   = [0]*n
hidari[0] = a[0]
for i in range(1,n):
    hidari[i]=math.gcd(hidari[i-1],a[i])
migi[n-1] = a[n-1]
for i in range(n-2,-1,-1):
    migi[i]=math.gcd(migi[i+1],a[i])

saidai=max(migi[1],hidari[n-2])
for i in range(1,n-1):
    saidai = max(saidai, math.gcd(hidari[i-1],migi[i+1]))
#    print(math.gcd(hidari[i-1],migi[i+1]))
#print(hidari,migi)
print(saidai)



### FIXED CODE ###

#
import sys
import math
import numpy as np
import itertools
import fractions

# ひとつ入力
n = int(input())
# リストに入れる
a = [int(i) for i in input().split()]

hidari = [0]*n
migi   = [0]*n
hidari[0] = a[0]
for i in range(1,n):
    hidari[i]=fractions.gcd(hidari[i-1],a[i])
migi[n-1] = a[n-1]
for i in range(n-2,-1,-1):
    migi[i]=fractions.gcd(migi[i+1],a[i])

saidai=max(migi[1],hidari[n-2])
for i in range(1,n-1):
    saidai = max(saidai, fractions.gcd(hidari[i-1],migi[i+1]))
#    print(fractions.gcd(hidari[i-1],migi[i+1]))
#print(hidari,migi)
print(saidai)
a=input()
if a="a" or a="i" or a="u" or a="e" or a="o":
  print("vowel")
else:
  print("consonant")

### FIXED CODE ###

a=input()
if a=="a" or a=="i" or a=="u" or a=="e" or a=="o":
  print("vowel")
else:
  print("consonant")
N = int(input())
D = {i+1:int(input()) for i in range(N)}
d = D{1}
ans = 1


for i in range(N):
  if d==2:
    print(ans)
    exit()
    
  d = D[d]
  ans +=1
  
  
print(-1)

### FIXED CODE ###

N = int(input())
D = {i+1:int(input()) for i in range(N)}
d = D[1]
ans = 1


for i in range(N):
  if d==2:
    print(ans)
    exit()
    
  d = D[d]
  ans +=1
  
  
print(-1)
s = input()
m = (len(s) - 1) / 2
l = s[:m]
r = s[(len(s) + 3) / 2 - 1:]


def check(s):
    mid = len(s) // 2
    left = s[:mid]
    right = s[mid+1:]
    if left == right[::-1]:
        return True
    else:
        return False

if check(s) and check(r) and check(l):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

s = input()
m = (len(s) - 1) // 2
l = s[:m]
r = s[(len(s) + 3) // 2 - 1:]


def check(s):
    mid = len(s) // 2
    if len(s) % 2 != 0:
        left = s[:mid]
        right = s[mid+1:]
    else:
        left = s[:mid]
        right = s[mid:]
    if left == right[::-1]:
        return True
    else:
        return False

if check(s) and check(r) and check(l):
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline

def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]

def same(x, y):
    if find(x) == find(y):
        return True
    else:
        return False

def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    if rank[x] > rank[y]:
        x, y = y, x
    par[x] += par[y]
    par[y] = x

def uCnt(x):
    return -par[find(x)]

N, M, K = map(int, input().split())
par = [-1 for i in range(N)]
rank = [0] * N
frendCnt = [0] * N
bloc = [[] for _ in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    frendCnt[a] += 1
    frendCnt[b] += 1
    unite(a, b)

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

#for i in range(N):
#    ans = uCnt(i) - frendCnt[i] - 1
#    for j in bloc[i]:
#      if same(i, j):
#           ans -= 1
#    print(ans, end=' ')

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)

    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

num = [0]*n

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

edge = [[] for i in range(n)]

for i in range(k):
    c,d = map(int,input().split())
    edge[c-1].append(d-1)
    edge[d-1].append(c-1)


for i in range(n):
    cnt = size(i) - num[i] - 1
    for e in edge[i]:
        if same(e,i):
            cnt -= 1
    print(cnt,end=' ')
r,g = map(int, input().split())
print((g*2)/r)

### FIXED CODE ###

r = int(input())
g = int(input())
print((g*2)-r)
a, b, c, k = input().split()

if a >= k:
  print(1*k)
elif (a+b) > k:
  print(1*a)
else:
  ans = (1*a) - (k-(a-b))
  print(ans)

### FIXED CODE ###

li = list(map(int, input().split()))
a, b, c, k = li[0], li[1], li[2], li[3]

if a >= k:
  print(1*k)
elif (a+b) >= k:
  print(1*a)
else:
  ans = (1*a) - (k-(a+b))
  print(ans)
from numpy import zeros

N = int(input())
A = zeros((10,10))

for i in range(1,N+1):
  s = int(str(i)[0])
  t = int(str(i)[-1])
  A[s][t] += 1

cnt = 0
for l in range(1,N+1)
  a = int(str(i)[0])
  b = int(str(i)[0])
  cnt += A[s][t]
  
print(cnt)

### FIXED CODE ###

N = int(input())
A =[[0]*10 for i in range(10)]
 
for i in range(1,N+1):
  a = int(str(i)[0])
  b = int(str(i)[-1])
  A[a][b] += 1
 
cnt = 0
for _ in range(1,N+1):
  a = int(str(_)[0])
  b = int(str(_)[-1])
  cnt += A[b][a]
  
print(cnt)
import math
a,b,x = map(float, input().split())

def ok(mid,a,b,x_s):
    x = a * math.sin(mid*math.pi/180)/math.sin(math.pi/2 - (mid * math.pi/180))
    s = 0
    if b - x > 0:
        s = (b - x + b)/2 * a
    else:
        x = b * math.sin(math.pi/2 - (mid * math.pi/180))/math.sin(mid*math.pi/180)
        s = 0.5 * x * b
    if s < x_s:
        return -1
    else:
        return 1

def bin_search(a,b,x):
    l = 0.0
    r = 90.0
    while abs(l - r) > 1e-10:
        mid = l + (r - l)/2
        res = ok(mid,a,b,x)
        if res < 0:
            r = mid
        else:
            l = mid
    return r


def toFixed(numObj, digits=0):
    return f"{numObj:.{digits}f}"


print(toFixed(bin_search(a,b,x/a),10))

### FIXED CODE ###

import math
a,b,x = map(float, input().split())

def ok(mid,a,b,x_s):
    x = a * math.sin(mid*math.pi/180)/math.sin(math.pi/2 - (mid * math.pi/180))
    s = 0
    if b - x > 0:
        s = (b - x + b)/2 * a
    else:
        x = b * math.sin(math.pi/2 - (mid * math.pi/180))/math.sin(mid*math.pi/180)
        s = 0.5 * x * b
    if s < x_s:
        return -1
    else:
        return 1

def bin_search(a,b,x):
    l = 0.0
    r = 90.0
    while abs(l - r) > 1e-10:
        mid = l + (r - l)/2
        res = ok(mid,a,b,x)
        if res < 0:
            r = mid
        else:
            l = mid
    return r


#def toFixed(numObj, digits=0):
#    return f"{numObj:.{digits}f}"


print(bin_search(a,b,x/a))