Harryxun/stf_run huggingface dataset:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
count = 0
for j in range(len(a)-1):
    if(count => 2):
        print(l[0] * l[1])
        exit()
    if(a[j] == a[j+1]):
        del l[0]
        l.append(a[j])
        j += 1
        count += 1

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
c = 0
i = 0
while(i < len(a)-1):
    if(a[i] == a[i+1]):
        del l[0]
        l.append(a[i])
        i += 1
        c += 1
    if(c >= 2 or i == len(a)-2):
        i = len(a)-1
        print(l[0] * l[1])
    i += 1
N = int(input())

kisu = 0
gusu = 0

for i in range(N):
  if i % 2 = 0:
    kisu += 1
  else:
    gusu += 1
    
kakuritsu = kisu // (gusu + kisu)

print(kakuritsu)

### FIXED CODE ###

N = int(input())

kisu = 0

for i in range(1, N+1):
  if i % 2 == 1:
    kisu += 1
    
    
kakuritsu = kisu / N


print('{:.10f}'.format(kakuritsu))
N, A, B = map(int,input().split())
print("NO")

### FIXED CODE ###

N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7))
n,m=(int(i) for i in input.split())
l=[None,None,None]
answer='unknown'
for i in range(m):
  a,b=(int(i) for i in input().split())
  if l[a-1]==None:
    l[a-1]=b
  elif l[a-1]!=b:
    answer='-1'
    break
for i in range(3):
  if l[i]==None:
    if i!=3-n:
      l[i]=0
    else:
      l[i]=1
r=l[0]*10**2+l[1]*10+l[2]
if len(str(r))!=n:
  answer='-1'
if answer=='-1':
  print('-1')
else:
  print(r)


### FIXED CODE ###

n,m=(int(i) for i in input().split())
l=[None,None,None]
answer='unknown'
for i in range(m):
  a,b=(int(i) for i in input().split())
  if l[n-a]==None:
    l[n-a]=b
  elif l[n-a]!=b:
    answer='-1'
    break
if l[0]==None:
  l[0]=0
for i in range(3):
  if l[i]==None:
    if i!=n-1:
      l[i]=0
    else:
      l[i]=1
r=l[2]*10**2+l[1]*10+l[0]
if len(str(r))!=n:
  answer='-1'
if answer=='-1':
  print('-1')
else:
  print(r)
import numpy as np
n,m = map(int, input().split())
count = [0]*n
py = []

for i in range(m):
    p,y = map(int, input().split())
    count[p-1] += 1
    py.append([p,y])

li = sorted(py)
count = np.cumsum(count)

for i in range(m):
    num = li.index(py[i]) + 1
    pref = str(py[i][0])
    if py[i][0] == 1:
        print(pref.zfill(6) + str(num).zfill(6))
    else:
        print(pref.zfill(6) + str(num - count[i]).zfill(6))

### FIXED CODE ###

n,m = map(int, input().split())
py = []
for i in range(m):
    p,y = map(int, input().split())
    py.append((p,y,i))
py.sort()
li = [[0]*2 for i in range(m)]
s = 0
t = 0
for p,y,i in py:
    #もしs!=pならその県は初めてなので1番目、違うならそこから+1
    if s != p:
        s = p
        t = 1
    else:
        t += 1
    li[i][0] = s
    li[i][1] = t
for i in range(m):
    print(str(li[i][0]).zfill(6) + str(li[i][1]).zfill(6))
# -*- coding : utf-8 -*-

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

L = list(map(int, [input() for i in range(n)]))
L.sort()
word = ""

for i in len(L):
  word = word + L[i]

print(word)


### FIXED CODE ###

# -*- coding : utf-8 -*-

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

L = list([input() for i in range(n)])
L.sort()
word = ""

for i in range(len(L)):
  word = word + L[i]

print(word)
s=int(input())
print(s//(u=60)//u, s//u%u, s%u, sep=":")


### FIXED CODE ###

u,s=60,int(input())
print(s//u//u, s//u%u, s%u, sep=":")
N = int(input())
monstar = list(map(int, input().split()))
monstar.sort()
min1, min2 = monstar[0], monstar[1]
while min1 > 0 and min2 > 0:
  if min1 <= min2:
    min2 -= min1
  else:
    min1 -= min2
print(max(min1, min2))

### FIXED CODE ###

A, B = map(int, input().split())
if B % A == 0:
  print(A+B)
else:
  print(B-A)
10 13 15
3
1
4
1
5
9
2
6
5
3
5
8
9
7
9

### FIXED CODE ###

import sys

N,K,Q=(int(x) for x in input().split())
#Ai=[]
par=[]
for i in range(N):
	par.append(K)

par = [0] * N

for i in range(Q):
	a=int(input())
	par[a-1] += 1 	


#Ai.append(a)
#print(par)
for i in range(N):
	if par[i]+K > Q:
		print("Yes")
	else:
		print("No")
#print(par)
s=input()

if s[0] == s[1] and s[1] == s[2] and s[2] == s[3]
    print('Bad')    
else:
    print('Good')


### FIXED CODE ###

s=input()

if s[0] == s[1]:
    print('Bad')
    exit()
if s[1] == s[2]:
    print('Bad')   
    exit()
if s[2] == s[3]:
    print('Bad')
    exit()
else:
    print('Good')
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

N, M = map(int, inp().split())
SC = [tuple(map(int, inp().split())) for _ in range(M)]
SC = sorted(SC, key=lambda x:(x[0],-(x[1])))
max_N = (SC[0][1]+1)*(10**(N-1))
min_N = 10**(N-1)

ans = 1005
for i in range(max_N, min_N, -1):
  x = str(i)
  cnt = 0
  for s, c in SC:
    if int(x[s-1]) == c:
      cnt += 1
  if cnt == M:
    ans = min(ans, i)
print(ans if ans < 1005 else -1)    
    
  



### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

def check(n):
  x = str(n)
  if len(x) != N:
    return False
  for s, c in SC:
    if x[s-1] != str(c):
      return False
  return True
  
N, M = map(int, inp().split())
SC = [tuple(map(int, inp().split())) for _ in range(M)]

for i in range(1001):
  if check(i):
    print(i)
    exit()
print(-1)
a, b = [int(i) for i in input().split()]

def gcd(a,b):
    while b!=0:
    a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)

print(lcm(a, b))

### FIXED CODE ###

a, b = [int(i) for i in input().split()]

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)

print(lcm(a, b))
# coding: utf-8

h, w = map(int,input().split())
A = []

for i in range(h):
    l = list(input())
    if list(set(l)) == ['.']:
        h -= 1
    else:
        A.append(l)
#for a in A:
    #print(a)
Ans = []
for i in range(w):
    cnt = 0
    for j in range(h):
        if A[j][i] == '.':
            cnt += 1
    if cnt == h:
        Ans.append(i)

for i in Ans:
    for j in range(h):
        del A[j][i]

for a in A:
    print(''.join(a))

### FIXED CODE ###

# coding: utf-8
import fractions
#N = int(input())

h, w = map(int,input().split())
h_list = []
w_list = []
F = []
for i in range(h):
    l = list(input())
    F.append(l)
    if list(set(l)) == ['.']:
        w_list.append(i)
        
for i in range(w):
    cnt = 0
    for j in range(h):
        if F[j][i] == '.':
            cnt += 1
        else:
            break
    if cnt == h:
        h_list.append(i)
A = []
#print(h_list,w_list)#ここまでOK
for i in range(h):
    if i not in w_list:
        l = []
        for j in range(w):
            if j not in h_list:
                #print(F[i][j])
                l.append(F[i][j])
        
        A.append(l)

for i in range(len(A)):
    print(''.join(A[i]))
n, k = map(int, input().split())
li = [int(i) for i in input().split()]
newlist = sorted(li)
price = 0
for a in range(k):
  count += newlist[a]
  
print(count)

### FIXED CODE ###

n, k = map(int, input().split())
li = [int(i) for i in input().split()]
newlist = sorted(li)
price = 0
for a in range(k):
  price += newlist[a]
  
print(price)
from fraction import gcd
n=int(input())
a=list(map(int,input().split()))
t=1
for i in a:
  t=t/gcd(t,i)*i
ans=0
MOD=1000000007
for i in a:
  ans+=t/i
  ans%=MOD
print(ans)


### FIXED CODE ###

from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
b=1
for i in a:
  b=b//gcd(b,i)*i
ans=0
for i in a:
  ans+=(b//i)
print(ans%(10**9+7))
import sys

n,x = map(int,input().split())
n = n+1

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


counter = 0
next_jump = 0
for val in range(0,n):
    #if next_jump <= x:
    if next_jump < x:
        next_jump = next_jump + l_L[val-1]
        counter += 1
    else:
        print(counter)
        sys.exit(0)

### FIXED CODE ###

x,a = map(int,input().split(" "))

if x < a:
    print(0)
else:
    print(10)
S = input().split("/")

if int(S[5]) < 5 and s[4] ==0 :
	print('Heisei')
else :
	print('TBD')

### FIXED CODE ###

s = input()

if s <= "2019/04/30":
    print("Heisei")
else:
    print("TBD")
import sys
import math
from scipy.special import comb

mod = 10 ** 9 + 7

N = int(input())

if N <= 1:
    print(0)
    sys.exit()

# ans = comb(N, 2, exact=True) * 2 * (8 ** (N - 2)) + (9 ** N - 8 ** N) * 2
ans = 10 ** N - 8 ** N - (9 ** N - 8 ** N) * 2
print(ans % mod)



### FIXED CODE ###

import sys
import math

mod = 10 ** 9 + 7

N = int(input())

if N <= 1:
    print(0)
    sys.exit()

# ans = comb(N, 2, exact=True) * 2 * (8 ** (N - 2)) + (9 ** N - 8 ** N) * 2
ans = 10 ** N - 8 ** N - (9 ** N - 8 ** N) * 2
print(ans % mod)
N,K=list(map(int,input().split()))

S = list(input())

S[K] = chr(ord(S[K])+32)

print(''.join(S))

### FIXED CODE ###

N,K=list(map(int,input().split()))
S = list(input())

for i in range(len(S)):
    if i != K-1:
        print(S[i],end='')
    else:
        print(chr(ord(S[i])+32),end="")
n, m = map(int, input().split())

G = [[] for _ in range(m)]
for _ in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    G[u].append(v)
    G[v].append(u)

ans = [-1] * n
ans[0] = 'Yes'

from collections import deque

q = deque([0])

while q:
    _q = q.popleft()
    for x in G[_q]:
        if ans[x] == -1:
            ans[x] = _q + 1
            q.append(x)

# if -1 in ans:
#     print('No')
# else:
for _ans in ans:
    print(_ans)


### FIXED CODE ###

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

G = [[] for _ in range(n)]
for _ in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    G[u].append(v)
    G[v].append(u)

ans = [-1] * n

from collections import deque

q = deque([0])

while q:
    _q = q.popleft()
    for x in G[_q]:
        if ans[x] == -1:
            ans[x] = _q + 1
            q.append(x)

if -1 in ans:
    print('No')
else:
    ans[0] = 'Yes'
    for _ans in ans:
        print(_ans)
#coding:utf-8
2 x = input()
3 print x*x*x

### FIXED CODE ###

# -*- coding: utf-8 -*-

def main():
    """ エントリポイントだよ。

    """
    x = int(input())
    print(str(x ** 3))


if __name__ == "__main__":
    main()
import sys
input = sys.stdin.readline

all,rolls=map(int,input().split())
List=list(map(int,input().split()))

sum = 0
sumList =[]

for i in range(all - rolls + 1):
	sum = 0
	for j in range(rolls):
		sum = sum + (List[i + j] + 1) / 2
	sumList.append(sum)

sumList.sort(reverse=True)
print(sumList[0])

### FIXED CODE ###

a,b=input().split()
c,d=map(int,input().split())
e=input()

if a==e:
	c = c - 1
else:
	d = d - 1

print(c,d)
import numpy as np
N,K=map(int,input().split())
A=list(map(int,input().split()))
def B(i):
  if i==0:
    return 1
  return A[B(i-1)-1]
C=[1]
for i in range(1,N+1):
  if C.count(B(i))==0:
    C.append(B(i))
  else:
    l=C.index(B(i))+1
    break
if K+1<=l:
  print(C[K])
else:
  print(C[l-2+(K+2-l)%(len(C)-l+1)])

### FIXED CODE ###

import numpy as np
N,K=map(int,input().split())
A=list(map(int,input().split()))
C=[1]
s=set([1])
for i in range(N):
  if A[C[i]-1] in s:
    l=C.index(A[C[i]-1])+1
    break
  else:
    C.append(A[C[i]-1])
    s.add(A[C[i]-1])
if K+1<=l:
  print(C[K])
else:
  print(C[l-1+(K+1-l)%(len(C)-l+1)])
a,b=list(map(int,input().split()))
print(max(a+b,a-b,a*b)

### FIXED CODE ###

a,b=list(map(int,input().split()))
print(max([a+b,a-b,a*b]))
n=int(input())
h=list(map(int,input().split()))
c=0
for i in range(n-1,0,-1):
  if h[i]<h[i+1]-1:
    print('No')
    exit()
  elif h[i]==h[i+1]-1:
    h[i+1]=h[i+1]-1

print('Yes')


       
    


### FIXED CODE ###

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


for i in range(n-1):
  if h[n-1-i]<h[n-i-2]-1:
    print('No')
    exit()
  elif h[n-1-i]==h[n-i-2]-1:
    h[n-i-2]=h[n-i-2]-1

print('Yes')
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10**9 + 7

N,K = map(int,readline().split())
AB = map(int,read().split())

def cumprod(arr,MOD):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD
    for n in range(1,Lsq):
        arr[n] *= arr[n-1,-1]; arr[n] %= MOD
    return arr.ravel()[:L]

def make_fact(U,MOD):
    x = np.arange(U,dtype=np.int64); x[0] = 1
    fact = cumprod(x,MOD)
    x = np.arange(U,0,-1,dtype=np.int64); x[0] = pow(int(fact[-1]),MOD-2,MOD)
    fact_inv = cumprod(x,MOD)[::-1]
    return fact,fact_inv

fact,fact_inv = make_fact(K+10,MOD)

graph = [[] for _ in range(N+1)]
for a,b in zip(AB,AB):
    graph[a].append(b)
    graph[b].append(a)

# 次数1の頂点を根とする
deg = [len(x) for x in graph]
for i,x in enumerate(deg):
    if x == 1:
        break
root = i

parent = [0] * (N+1)
ts = [root]
stack = [root]
while stack:
    x = stack.pop()
    for y in graph[x]:
        if y == parent[x]:
            continue
        parent[y] = x
        stack.append(y)
        ts.append(y)

perm = np.zeros(N+K+10,np.int64)
perm[:K-1] = fact[K-2] * fact_inv[K-2::-1] % MOD
perm = perm.tolist()

dp = [1] * (N+1)
for v in ts[::-1]:
    if v == root:
        break
    d = deg[v]
    dp[v] *= perm[d-1]; dp[v] %= MOD
    p = parent[v]
    dp[p] *= dp[v]; dp[p] %= MOD

x = dp[root]
x *= K*(K-1)%MOD
x %= MOD
print(x)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

N,K = map(int,input().split())
MOD = 10 ** 9 + 7

edge = [[] for _ in range(N)]
for _ in range(N-1):
  a,b = map(lambda x: int(x) - 1,input().split())
  edge[a].append(b)
  edge[b].append(a)
deg = [len(E) for E in edge]
  
U = 10 ** 5 + 100
fact = [1] * (U+1)
fact_inv = [1] * (U+1)
for n in range(1,U+1):
  fact[n] = fact[n-1] * n % MOD
fact_inv[U] = pow(fact[U],MOD-2,MOD)
for n in range(U-1,0,-1):
  fact_inv[n] = fact_inv[n+1] * (n+1) % MOD

def perm(n,k):
  if k > n or k < 0:
    return 0
  return fact[n] * fact_inv[n-k] % MOD

def F(x,parent = None):
  if parent is None:
    c = perm(K, deg[x] + 1)
  else:
    c = perm(K-2, deg[x] - 1)
  for y in edge[x]:
    if y == parent:
      continue
    c *= F(y,x)
    c %= MOD
  return c

answer = F(0)
print(answer)
import fractions


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


def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass

###############################


gcd_ab = fractions.gcd(A,B)	


primes_ab = primes(gcd_ab)

# 1は必ずはいる
count = 1
for t in primes_ab:
    if A % t == 0 and B % t == 0:
        count += 1

print(count)



### FIXED CODE ###

import fractions


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


gcd_ab = fractions.gcd(A,B)	



def factorization(n):
    arr = 0
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr += 1

    if temp!=1:
        arr += 1

    return arr

f = factorization(gcd_ab)
print(f + 1)
import sys
if argv[1] == 'Sunny':
  echo "Cloudy"
elif argv[1] == 'Cloudy':
  echo "Rainy"
elif argv[1] == 'Rainy' :
  echo "Sunny"
else:

### FIXED CODE ###

s = input()
if s=='Sunny':
  print('Cloudy')
elif s=='Rainy':
  print('Sunny')
else:
  print('Rainy')
[n,m] = [int(i) for i in input().split()]
a = []
b = []
for i in range(n):
  a.append(input())
for i in range(m):
  b.append(input())
cnt = 0
flag = "No"
for i in range(n - m + 1):
  for j in range(n - m + 1):
    for k in range(m):
      for l in range(m):
	    if a[i+k][j+l] == b[k][l]:
          cnt += 1
    if cnt == m ** 2:
      flag = "Yes"
    else:
      cnt = 0
print(flag)
      

### FIXED CODE ###

[n,m] = [int(i) for i in input().split()]
a = []
b = []
for i in range(n):
    a.append(input())
for i in range(m):
    b.append(input())
cnt = 0
flag = "No"
for i in range(n - m + 1):
    for j in range(n - m + 1):
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] == b[k][l]:
                    cnt += 1

        if cnt == m ** 2:
            flag = "Yes"
        else:
            cnt = 0
print(flag)
# from sys import exit

def main():
    x = int(input())
    d = 100
    ans = 0
    
    while d < x:
    d = int(d*1.01)
    ans += 1
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

from sys import exit

def main():
    X = int(input())
    deposit = 100

    i = 0
    while True:
        deposit = int(deposit * 1.01)
        i += 1

        if deposit >= X:
            print(i)
            exit()

if __name__ == '__main__':
    main()
s=str(input())
if s=="ABC":
  print(“ARC”)
else:
  print(“ABC”)

### FIXED CODE ###

s=str(input())
if s=="ABC":
  print("ARC")
else:
  print("ABC")
s = input()
print("YES" if '7' in s else "NO)

### FIXED CODE ###

s = input()
print("Yes" if '7' in s else "No")
s = input()

if(s[2] == s[3] && s[4] == s[5])　print('Yes')
else print('No')

### FIXED CODE ###

s = input()
 
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else :
    print('No')
N,L=input().split()
N=int(N)
L=int(L)
A=0
B=[]
C=[]
for j in range(1,N+1):
    A+=L+j-1
for i in range(1,N+1):
    if L+i-1>=0:
        B.append(L+i-1)
    else:
        C.append(L+i-1)
if min(B)<=abs(max(C)):
    print(A-min(B))
else:
    print(A-max(C))

### FIXED CODE ###

N,L=map(int,input().split())
A=[]
B=[]
for i in range(1,N+1):
    A.append(L+i-1)
for j in range(1,N+1):
    B.append(abs(L+j-1))
idx=B.index(min(B))
print(sum(A)-A[idx])
i = [int(input()) for i in range(5)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[3] - i[2] > i[4]:
  temp += 1
if i[2] - i[1] > i[4]:
  temp += 1  
if i[1] - i[0] > i[4]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')

### FIXED CODE ###

i = [int(input()) for i in range(6)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[4] - i[2] > i[5]:
  temp += 1
if i[4] - i[1] > i[5]:
  temp += 1
if i[4] - i[0] > i[5]:
  temp += 1
if i[3] - i[2] > i[5]:
  temp += 1
if i[3] - i[1] > i[5]:
  temp += 1
if i[3] - i[0] > i[5]:
  temp += 1
if i[2] - i[1] > i[5]:
  temp += 1
if i[2] - i[0] > i[5]:
  temp += 1  
if i[1] - i[0] > i[5]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')
x, n= input().split()
x = int(x)
n = int(n)

array = [[0]]*100
if n == 0:
    print(x)
else:
    for i in range(100):
        array[i] = 0
    tmp = input().split(' ')
    for i in range(n):
        array[int(tmp[i])] += 1
    
    dif_tmp = 999
    ret = 999
    for i in range(100):
        if array[99-i] == 0:
            if abs(x-(99-i)) <= dif_tmp:
                ret = 99-i
                dif_tmp = abs(x-(99-i))
    for i in range(1,100):
        if abs(x+i) <= dif_tmp:
            ret = -i
            dif_tmp = abs(x+i)
    print(ret)

### FIXED CODE ###

x, n= input().split()
x = int(x)
n = int(n)

array = [[0]]*200
if n == 0:
    print(x)
else:
    for i in range(200):
        array[i] = 0
    tmp = input().split(' ')
    for i in range(n):
        array[int(tmp[i])] = 1
    
    dif_tmp = 999
    ret = 999
    for i in range(200):
        if array[199-i] == 0:
            if abs(x-(199-i)) <= dif_tmp:
                ret = 199-i
                dif_tmp = abs(x-(199-i))
    for i in range(1,100):
        if abs(x+i) <= dif_tmp:
            ret = -i
            dif_tmp = abs(x+i)
    print(ret)
import numpy as np
N,M,C=map(int,input().split())
B=np.array([int(i) for i in input().split()]).T
A=[[int(i) for i in input().split()] for j in range(N)]
A=np.matrix(A)
print(sum([i+C>0 for i in (np.dot(A,B).T).A1]))

### FIXED CODE ###

import numpy as np
N,M,C=map(int,input().split())
B=np.array([int(i) for i in input().split()]).T
A=[[int(i) for i in input().split()] for j in range(N)]
A=np.matrix(A)
print(sum([i+C>0 for i in (np.dot(A,B).T).A1]))
def Warshall_Floyd(edges,N):
  """頂点N個のグラフ上の隣接行列edgesが与えられたとき, 
  2点間の最短距離距離を隣接行列で返す"""
  for k in range(N):
    for i in range(N):
      for j in range(N):
        edges[i][j]=min(edges[i][j],edges[i][k]+edges[k][j])
  return edges
 
import sys
from sys import stdin
input = stdin.readline
N=int(input())
A=[list(map(int,input().split())) for i in range(N)]
B=Warshall_Floyd(A,N)
if A!=B:
  print(-1)
  sys.exit()
 
ans=0
for i in range(N):
  for j in range(i):
    need=1
    for k in range(N):
      if k!=i and k!=j:
        if A[i][j]==A[i][k]+A[k][j]:
          need=0
          break
    ans+=need*A[i][j]
print(ans)

### FIXED CODE ###

N=int(input())
A=int(input())
print(N*N-A)
import math
def:
	A B H M=map(int,input().split(" "))
	if H>M/5:
		angle=(H/12-M/60)
	else:
		angle=(M/60-H/12)
    t=math.cos(math.pi*angle)
    d=(A^2+B^2-2AB*t)^0.5
    print(d)
    

### FIXED CODE ###

import math


def cal():
    string = input()
    a, b, h, m = string.split(" ")
    a = int(a)
    b = int(b)
    h = int(h)
    m = int(m)
    minuteAngel = (float(m) * 360) / 60
    hourAngel = (float(h) % 12) * 30 + (float(m) * 30) / 60
    angel = abs(hourAngel - minuteAngel)
    angel=angel/180
    cosine = math.cos(math.pi*angel)
    ans = math.sqrt(a*a + b*b - 2*a*b*cosine)
    print(format(ans, '.20f'))
    # print(angle1)
    # print(angle2)
    # print(angle)
    # print(cosine)

cal()
import math
a, b = map(int, input().split())
lcm = (a * b) // math.gcd(a, b)
print(lcm)

### FIXED CODE ###

a, b = map(int, input().split())
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
suf = 0
for i in range (n):
  if a[i]!= n-1:
  	men1 = a[i]
  	men2 = a[i + 1] 
  	suf += b[men1]
  	if (men1 + 1 == men2):
    	suf += c[men1]
  else:
    men1 = a[i]
    suf += b[men1]
print(suf)


### FIXED CODE ###

n = int(input())
print(n ** 3)
n,k,x,y=map(int,input().split())

if n>k:
  print(k*x+(n-k)*y)

else:
  print(n*x)
      

### FIXED CODE ###

n = int(input())
k = int(input())
x= int(input())
y= int(input())

if n>k:
  print(k*x+(n-k)*y)

else:
  print(n*x)
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**5]*n
dp[0]=0
for i in range(2,n):
    for j in range(1,k):
        dp[i]=min(dp[i-j]+abs(h[i-j]-h[i]))
        print(dp[n-1])

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**5]*n
dp[0]=0
for i in range(1,n):
    dp[i]=min(dp[j]+abs(h[j]-h[i]) for j in range(max(0,i-k),i))
print(dp[n-1])
from sys import exit
n, m = map(int, input().split())
X = ["" for _ in range(10)]
for _ in range(m):
    c, s = map(int, input().split())
    if X[c] != "" and X[c] != str(s):
        print(-1)
        exit()
    X[c] = str(s)
flag = False
for i in range(1, 11):
    if X[-i] == "":
        if flag:
            X[-i] = "0"
    else:
        flag = True
X = int("".join(X))
print(X if 10 ** (n - 1) <= X < 10 ** n else - 1)

### FIXED CODE ###

from sys import exit
N, M = map(int, input().split())
ans = ["a" for i in range(N)]
if M == 0:
  print(10 ** (N - 1) if N > 1 else 0)
  exit()
for i in range(M):
  s, c = map(int, input().split())
  if ans[s - 1] == "a":
    ans[s - 1] = str(c)
  elif ans[s - 1] != str(c):
    print(-1)
    exit()
if ans[0] == "a":
  ans[0] = "1"
if ans[0] == "0":
  if N != 1:
    print(-1)
    exit()
  else:
    print(0)
    exit()
ans = [a.replace("a", "0") for a in ans]
ans = int("".join(ans))
print(ans if 10 ** N > ans >= 10 ** (N - 1) else -1)
n,r=map(int,input().split())

if n<10:
  print(r+100*(10-k))
  
else:
  print(r)

### FIXED CODE ###

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

if n<10:
  print(r+100*(10-n))
  
else:
  print(r)
a,b=[int(i) for i in input().split()]

print(min[2*a-1,a+b,2*b-1])

### FIXED CODE ###

a,b=[int(i) for i in input().split()]
print(max([2*a-1,a+b,2*b-1]))