Harryxun/stf_run huggingface dataset:
2 2 1
3 5
3 5
2 2 2

### FIXED CODE ###

val = input().split(' ')
a = int(val[0])
b = int(val[1])
m = int(val[2])

alist = [int(a) for a in input().split(' ')]
blist = [int(b) for b in input().split(' ')]

min_price = sorted(alist)[0] + sorted(blist)[0]

for i in range(m):
    discount = [int(m) for m in input().split(' ')]
    price = alist[discount[0] - 1] + blist[discount[1] - 1] - discount[2]
    if price < min_price:
        min_price = price

print(min_price)
a,b = [int(x) for x in input().split()]
print('Possible' (a+b)%3 == 0 else 'Impossible')

### FIXED CODE ###

a,b = [int(x) for x in input().split()]
print('Possible' if a%3 == 0 or b%3 == 0 or (a+b)%3 == 0 else 'Impossible')
n= int(input())
x= list(map(int,input().split()))
m= mean(x)
g= int(m)
if m-g<g+1-m:
  print(g)
else:
  print(g+1)
  

### FIXED CODE ###

n= int(input())
x= list(map(int,input().split()))
m= sum(x)/len(x)
g= int(m)
ans=0
if m-g<g+1-m:
  ans=g
else:
  ans=g+1
aaa=0
for i in x:
  aaa+= (ans-i)**2
print(aaa)
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:40:34 2019

@author: iwata
"""

N,M = map(int, input().split())
numlist =[]
money = 0
count = 0
count1 = 0
count2 = 0

for i in range(N):
    AB = list(map(int, input().split()))
    numlist.append(AB)

numlist.sort()

while count < M:
    while numlist[count1][1] > count2:
        money = money + numlist[count1][0]
        count = count + 1
        count2 = count2 + 1
        if count == M:
            break
    count1 = count1 + 1
    count2 = 0
    
print(money)


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:07:57 2019

@author: iwata
"""

H,W = map(int, input().split())
h,w = map(int, input().split())

num = H*W - (h*W+(H-h)*w)
print(num)
a=input()
b=input()
print(a,b)
square=int(a)*int(b)
length=int(a)*2+int(b)*2
print(square,length)

### FIXED CODE ###

InputNum = input().split()
tate = int(InputNum[0])
yoko = int(InputNum[1])
square = tate * yoko
length = 2* (tate + yoko)
print(square,length)
s = input()
q = int(input())
for i in range(q):
  n = int(input())
  if n == 1:
    s = s[::-1]
  else:
    f,c = int(input()),input()
    if f == 1:
      s = c + s
    else:
      s = s + c
print(s)
    

### FIXED CODE ###

s=input()
q=int(input())
head=[]
tail=[]
rev=False
for _ in range(q):
  tmp=list(input().split())
  if tmp[0]=='1':
    if rev==False:
      rev=True
    else:
      rev=False
  if tmp[0]=='2':
    if rev==False:
      if tmp[1]=='1':
        head.append(tmp[2])
      if tmp[1]=='2':
        tail.append(tmp[2])
    if rev==True:
      if tmp[1]=='1':
        tail.append(tmp[2])
      if tmp[1]=='2':
        head.append(tmp[2])
head=''.join(map(str,head))
tail=''.join(map(str,tail))
ans=head[::-1]+s+tail
if rev==True:
  ans=ans[::-1]
print(ans)
n,x = map(int,input().split())
a = list(map(int,input().split()))
b = [a[i] + a[i+1] for i in range(n-1)]

ans = max(0, a[0] - x)
b[0] -= ans

for i in range(n-1):
  diff = max(0, b[i] - x)
  ans += diff
  b[i] -= diff
  b[i+1] -= diff
print(ans)

### FIXED CODE ###

n,x = map(int,input().split())
a = list(map(int,input().split()))
b = [a[i] + a[i+1] for i in range(n-1)] + [0]
 
ans = max(0, a[0] - x)
b[0] -= ans
 
for i in range(n-1):
  diff = max(0, b[i] - x)
  ans += diff
  b[i] -= diff
  b[i+1] -= diff
print(ans)
A = input()
A = A[::-1]
divide = [i[::-1] for i  in ["dream", "dreamer", "erase", "eraser"]]
print(A)
print(divide)
flag = 1
while flag and A:
  flag = 0
  for word in divide:
    if A.startswith(word):
      A = A[len(word):]
      print(A)
      flag = 1

if len(A) == 0:
  print('YES')
else:
  print('NO')


### FIXED CODE ###

A = input()
A = A[::-1]
divide = [i[::-1] for i  in ["dream", "dreamer", "erase", "eraser"]]

flag = 1
while flag and A:
  flag = 0
  for word in divide:
    if A.startswith(word):
      A = A[len(word):]
      flag = 1

if len(A) == 0:
  print('YES')
else:
  print('NO')
if __name__=="__main__":
    a=int(raw_input())
    b=int(raw_input())
    a=a*b
    print a/3.305785
    
    

### FIXED CODE ###

if __name__=="__main__":
    num=raw_input().split()
    a=int(num[0])
    b=int(num[1])
    print a*b/3.305785
n = int(input())
edge = [tuple(int(i) for i in input().split()) for i in range(n-1)]
to = [[] for _ in range(n+1)]
for e in edge:
    a,b = e
    to[a].append(b)
    to[b].append(a)
color = {}

def f(cn,pn,pc):
    c = 1
    for nn in to[cn]:
        if nn == pn: continue
        if c == pc: c += 1
        tmp = (cn,nn)
        color[(min(tmp),max(tmp))] = c
        f(nn,cn,c)
        c += 1

f(1,0,0)
print(max(color.values()))
for key in edge: print(color[key])

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10**6)
n = int(input())
edge = [tuple(int(i) for i in input().split()) for i in range(n-1)]
to = [[] for _ in range(n+1)]
for e in edge:
    a,b = e
    to[a].append(b)
    to[b].append(a)
color = {}

def f(cn,pn,pc):
    c = 1
    for nn in to[cn]:
        if nn == pn: continue
        if c == pc: c += 1
        tmp = (cn,nn)
        color[(min(tmp),max(tmp))] = c
        f(nn,cn,c)
        c += 1

f(1,0,0)
print(max(color.values()))
for key in edge: print(color[key])
n = int(input())
mont = [int(input()) for i in range(n)]
conut = 0
for i in range(n):
  if mont[i] >= max(mont[:i]):
    count += 1
print(count)

### FIXED CODE ###

n = int(input())
#mont = [int(input()) for i in range(n)]
mont = list(map(int,input().split()))
count = 0
for i in range(n):
  if mont[i] >= max(mont[:i+1]):
    count += 1
print(count)
from collections import deque
query = int(input())
l = deque()
for _ in range(query):
    command = input()
    if command == "deleteFirst":
        l.popleft()
    elif command == "deleteLast":
        l.pop()
    else:
        command, value = command.split(" ")
        if command == "insert":
            deque.append(value)
        elif command == "delete":
            deque.remove(value)
print(*l)

### FIXED CODE ###

from collections import deque
query = int(input())
l = deque()
for _ in range(query):
    command = input().strip()
    if command == "deleteFirst":
        try:
            l.popleft()
        except:
            pass
    elif command == "deleteLast":
        try:
            l.pop()
        except:
            pass
    else:
        command, value = command.split(" ")
        if command == "insert":
            l.appendleft(int(value))
        elif command == "delete":
            try:
                l.remove(int(value))
            except:
                pass
print(*l)
N=int(input())
A=list(map(int,input.split))
print(max(A)-min(A))


### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
print(max(A)-min(A))
tmp = input()
N = int(tmp.split()[0])
M = int(tmp.split()[1])
A = []
B = []
for i in range(N):
	tmp = input()
	A[i] = int(tmp.split()[0])
	B[i] = int(tmp.split()[1])

cnt=0
total=0
while cnt < M:
	mini = N
	minv = 999999999999999
	for i in range(N):
		if minv > A[i]:
			minv = A[i]
			mini = i
	cnt += B[mini]
	total += A[mini]*B[mini]
	A[mini] = 999999999999999
total -= minv*(cnt-M)
print(total)

### FIXED CODE ###

tmp = input()
N = int(tmp.split()[0])
M = int(tmp.split()[1])
AB = []
for i in range(N):
	tmp = input()
	AB.append([int(tmp.split()[0]),int(tmp.split()[1])])

AB.sort()

cnt=0
total=0
i = 0
while cnt < M:
	cnt += AB[i][1]
	total += AB[i][0]*AB[i][1]
	i+=1
total -=  AB[i-1][0]*(cnt-M)
print(total)
import sys
c = [0 for i in range(37)]
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                c[i+j+k+l] += 1
for line in sys.stdin:
    n = int(line)
    print(c[n])

### FIXED CODE ###

import sys
t = [None for i in range(10000)]
c = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                t[c] = i + j + k + l 
                c += 1
for line in sys.stdin:
    print(t.count(int(line)))
from math import sqrt

N = int(input())
ans = []
for i in range(1, int(sqrt(N))):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i))))
        
print(min(ans))

### FIXED CODE ###

from math import sqrt
N = int(input())
ans = []
for i in range(1, int(sqrt(N)) + 1):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i))))
print(min(ans))
H, W = map(int, input().split())
A = []
B = []
for i in range(H):
    L = list(map(int, input().split()))
    M = [j%2 for j in L]
    if i%2 != 0:
        M.reverse()
    A.extend(M)

indices = [i for i, x in enumerate(A) if x == 1]

def countiter(indices):
    if len(indices) == 0 or len(indices) == 1:
        return 0
    elif len(indices) == 2:
        return indices[1]-indices[0]
    else:
        return indices[1]-indices[0]+countiter(indices[2:])

N = countiter(indices)
print(N)
iter = 0
while iter<N:
    a = indices[0]
    b = indices[1]
    h = (a+1)//W + 1
    if h%2 != 0:
        w = a-(h-1)*W+1
        wchange = 1
    else:
        w = h*W-a
        wchange = -1
    while a < b:
        if w == 1 and wchange == -1:
            print(h, w, h+1, w)
            h += 1
            wchange *= -1
            iter += 1
            a += 1
        elif w == W and wchange == 1:
            print(h, w, h+1, w)
            h += 1
            wchange *= -1
            iter += 1
            a += 1
        else:
            print(h, w, h, w + wchange)
            w += wchange
            iter += 1
            a += 1
    indices[0:2] = []

### FIXED CODE ###

H, W = map(int, input().split())
A = [0]
idx_list = []
for i in range(H):
    L = list(map(int, input().split()))
    M = []
    for j in range(W):
        M.append([i+1, j+1])
    if i%2 != 0:
        L.reverse()
        M.reverse()
    idx_list.extend(M)
    for j in range(W):
        A.append((A[-1]+L[j])%2)
A = A[1:-1]
N = sum(A)
print(N)
if N != 0:
    a = A.index(1)
    iter = 0

    while iter<N:
        if A[a] == 1:
            print(idx_list[a][0], idx_list[a][1], idx_list[a+1][0], idx_list[a+1][1])
            iter += 1
        a += 1
n = input()
v_list = list(map(int,input().split()))
c_list = list(map(int,input().split())
 
diff_list = [v_list[i]-c_list[i] for i in range(n) if v_list[i] - c_list[i] > 0]
diff_list.append(0)
print(sum(diff_list))

### FIXED CODE ###

n=int(input())
v_list=list(map(int,input().split()))
c_list=list(map(int,input().split()))

diff_list = [v_list[i]-c_list[i] for i in range(n) if v_list[i] - c_list[i] > 0]
diff_list.append(0)
print(sum(diff_list))
a = list(map(int, input().split()))

if a[0] * b[1] % 2 == 0:
    print('Even')

else:
    print('Odd')
    

### FIXED CODE ###

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

if a[0] * a[1] % 2 == 0:
    print('Even')

else:
    print('Odd')
S = input()
if S[0] != 'A':
  print('WA')
  exit()
count = 0
if len(S) < 4:
  print('WA')
  exit()
for i in range(len(S) - 3):
  if S[i+2] == 'C':
    count += 1
  elif S[i+2].islower():
    continue
  else:
    print('WA')
    exit()
if A[1].isupper() or A[-1].isupper():
  print('WA')
  exit()
if count == 1:
  print('AC')
  exit()
print('WA')
    

### FIXED CODE ###

S = input()
if S[0] != 'A':
  print('WA')
  exit()
count = 0
if len(S) < 4:
  print('WA')
  exit()
for i in range(len(S) - 3):
  if S[i+2] == 'C':
    count += 1
  elif S[i+2].islower():
    continue
  else:
    print('WA')
    exit()
if S[1].isupper() or S[-1].isupper():
  print('WA')
  exit()
if count == 1:
  print('AC')
  exit()
print('WA')
import sys

sys.setrecursionlimit(10**7)

dx = (1, 0, -1, 0,)
dy = (0, 1, 0, -1,)

inf = 1<<60

def solve():
    def dfs(i, j, a, visited):
        visited[i][j] = True

        for k in range(len(dx)):
            ni = i + dy[k]
            nj = j + dx[k]

            if 0 <= ni < h and 0 <= nj < w:
                if (not visited[ni][nj]) and a[ni][nj]:
                    dfs(ni, nj, a, visited)

    h, w, k = map(int, sys.stdin.readline().split())

    si = 0
    sj = 0

    a = []

    for i in range(h):
        s = sys.stdin.readline().rstrip()
        a.append([ch != '#' for ch in s])

        if 'S' in s:
            si = i
            sj = s.find('S')

    # print(a)
    # print(si, sj)

    visited = [[False]*w for i in range(h)]

    dfs(si, sj, a, visited)

    # print(visited)

    ans = inf

    for i in range(h):
        for j in range(w):
            if visited[i][j]:
                tmp = min([h - i, i, w - j, j])
                tmp = (tmp + k - 1) // k + 1
                ans = min(ans, tmp)

    print(ans)

if __name__ == '__main__':
    solve()

### FIXED CODE ###

import sys
from collections import deque

dx = (1, 0, -1, 0,)
dy = (0, 1, 0, -1,)

inf = 1<<60

def solve():
    h, w, k = map(int, sys.stdin.readline().split())

    si = -1
    sj = -1

    a = [[False]*w for i in range(h)]

    for i in range(h):
        s = sys.stdin.readline().rstrip()

        for j, ch in enumerate(s):
            if ch == '.':
                a[i][j] = True
            elif ch == 'S':
                a[i][j] = True
                si, sj = i, j

    visited = [[False]*w for i in range(h)]
    visited[si][sj] = True

    nxts = deque([(si, sj, 0)])

    ans = inf

    while nxts:
        i, j, d = nxts.popleft()

        ans = min(ans, i, h - 1 - i, j, w - 1 - j)

        for l in range(len(dx)):
            ni = i + dy[l]
            nj = j + dx[l]

            if 0 <= ni < h and 0 <= nj < w and not visited[ni][nj] and a[ni][nj] and d + 1 <= k:
                visited[ni][nj] = True
                nxts.append((ni, nj, d + 1))

    ans = (ans + k - 1) // k + 1

    print(ans)

if __name__ == '__main__':
    solve()
x=input().split()

for i in range(2):
  x[i]=int(x[i])
  
ans=(x[2]-(x[0]-x[1]))

if ans>0:
  print(ans)
  
  elif ans<0:
    print(ans-ans)

### FIXED CODE ###

x=input().split()

y=[0]*3

for i in range(3):
  y[i]=int(x[i])

ans=(y[2]-(y[0]-y[1]))

if ans>0:
  print(ans)
  
elif ans<=0:
  print(0)
X = int(input())
flag = False
for ai in range(-119,120):
    for bi in range(-120,119):
    	if ai**5 - bi**5 ==X:
        	print(int(ai),int(bi))
            flag = True
            break
    if flag:
        break

### FIXED CODE ###

X = int(input())
# X = a**5 - b**5 
#   = (a-b)(a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4)
# よって、X は　a-b　の倍数 X%(a-b) = 0

# a**5  = b**5 + X
#   a   = ( b**5 + X )**(1/5)
# X< 10**9 を満たす a,bの最大値は、120 , 119
flag = False
for ai in range(-119,120):
    for bi in range(-120,119):
        if ai - bi != 0 and X > (ai - bi):
            if X % (ai - bi) == 0:
                if ai**5 - bi**5 ==X:
                    print(int(ai),int(bi))
                    flag = True
                    break
        else:
            if ai**5 - bi**5 ==X:
                print(int(ai),int(bi))
                flag = True
                break
    if flag:
        break
from math import gcd
n = int(input())
A = list(map(int, input().split()))
ans = A[0]
for a in A[1:]:
    ans = gcd(ans, a)
print(ans)


### FIXED CODE ###

from heapq import heapify, heappush, heappop
n = int(input())
A = list(map(int, input().split()))
heapify(A)
while len(A) != 1:
    t = heappop(A)
    A = [a % t for a in A if a % t != 0]
    if A is None:
        A = [t]
        break
    heappush(A, t)
print(A[0])
import math
r=int(input())
a=r*r*math.pi
b=2*r*math.pi
print('%.5f %.5f' % (a,b))

### FIXED CODE ###

import math
r = float(input())
m = r ** 2 * math.pi
l = r * 2 * math.pi
print('{:.6f} {:.6f}'.format(m, l))
import decimal
a,b=list(map(int,input().split()))
x = decimal.Decimal(a)
y = decimal.Decimal(b)
print(x*y)


### FIXED CODE ###

import math
import decimal
x,y = list(map(decimal.Decimal,input().split()))
print(math.floor(x*y))
N = input()
list_input = map(int, raw_input().split())

list_input = sorted(list_input)
sums = 0
for i in range(0,2*N,2):
    sums += min(list_input[i],list_input[i+1])

print(sums)

### FIXED CODE ###

N = int(raw_input())
L = map(int,raw_input().split())
L.sort(reverse = True)
ans = 0
for i in xrange(N):
    ans += min(L[2*i],L[2*i+1])
print ans
N, Y = map(int, input().split())

    for x in range(N):
        for y in range(N):
            z = N - x - y
            if z < 0:
                break

            if 10000 * x + 5000 * y + 1000 * z == Y:
                return " ".join([str(x), str(y), str(z)])

    return "-1 -1 -1"

### FIXED CODE ###

def solve():
    N, Y = map(int, input().split())

    for x in range(N + 1):
        for y in range(N + 1 - x):
            z = N - x - y
            if 10000 * x + 5000 * y + 1000 * z == Y:
                return " ".join([str(x), str(y), str(z)])

    return "-1 -1 -1"

if __name__=='__main__':
  print(solve())
val = input()
val = [int(x.strip()) for x in val.split(" ")]
h = val[0]
w = val[1]

s = [[0]*w]*h
for i in range(h):
    s[i] = input()

ans = "Yes"

for i in range(h):
    for j in range(w):
        d = 0
        if s[i][j] == ".":
            continue

        if i > 0:
            if s[i-1][j] == "#":
                d += 1

        if i < h-1:
            if s[i+1][j] == "#":
                d += 1

        if j > 0:
            if s[i][j-1] == "#":
                d += 1

        if j < h-1:
            if s[i][j+1] == "#":
                d += 1
        
        if d == 0:
            ans = "No"
            break
    if ans == "No":
        break

print(ans)


### FIXED CODE ###

val = input()
val = [int(x.strip()) for x in val.split(" ")]
h = val[0]
w = val[1]

s = [[0]*w]*h
for i in range(h):
    s[i] = input()

ans = "Yes"

for i in range(h):
    for j in range(w):
        d = 0
        if s[i][j] == ".":
            continue

        if i > 0:
            if s[i-1][j] == "#":
                d += 1

        if i < h-1:
            if s[i+1][j] == "#":
                d += 1

        if j > 0:
            if s[i][j-1] == "#":
                d += 1

        if j < w-1:
            if s[i][j+1] == "#":
                d += 1
        
        if d == 0:
            ans = "No"
            break
    if ans == "No":
        break

print(ans)
n=int(raw_input())
t=map(int,raw_input().split())
m=int(raw_input())
xt=[map(int,raw_input().split()) for _ in xrange(m)]
ans=[0]*m
for i in xrange(m):
    tmp=t
    tmp[xt[i][0]]=xt[i][1]
    for j in xrange(n):
        ans[i]+=tmp[j]
for j in xrange(n):
    print(ans[j])


### FIXED CODE ###

import copy
n=int(raw_input())
t=map(int,raw_input().split())
m=int(raw_input())
pt=[map(int,raw_input().split()) for _ in xrange(m)]
ans=[0]*m
for i in xrange(m):
    tmp=copy.deepcopy(t)
    tmp[pt[i][0]-1]=pt[i][1]
    for j in xrange(n):
        ans[i]+=tmp[j]
for i in xrange(m):
    print(ans[i])
import math
N,M = map(int,input().split())
S = input()
T = input()

flag = True
for n in range(N):
    if (M*n)%N==0:
        m = (M*n)//N
        flag = (S[n]==T[m])
        if not flag:
            break
if flag:
    print(N*M//math.gcd(N,M))
else:
    print(-1)


### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
N,M = map(int,input().split())
s = input()
t = input()
g = gcd(N,M)
l = N*M//g

n = N//g
m = M//g

ans = l

for i in range(g):
    if s[i*n]!=t[i*m]:
        ans = -1
        break
print(ans)
n = int(input())

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

n_list = []
for a in a_list:
    if int(a) % 2 != 0:
        print(0)
        break
    else:
        i = 0
        while int(a) > 1 and int(a) % 2 == 0:
            a = int(a) / 2
            i += 1
    n_list.append(i)
print(min(n_list))




### FIXED CODE ###

n = int(input())

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

n_list = []
for a in a_list:
    if int(a) % 2 != 0:
        n_list.append(0)
        break
    else:
        i = 0
        while int(a) > 1 and int(a) % 2 == 0:
            a = int(a) / 2
            i += 1
    n_list.append(i)
print(min(n_list))
x=int(input())
if x>=2000:
    print(1)
else:
    a=x//100
    #print(a)
    n=x-a*100
    #print(n)
    if n/a>5:
        print(0)
    else:
        print(1)

### FIXED CODE ###

x=int(input())
if x<100:
    print(0)
elif x>=2000:
    print(1)
else:
    a=x//100
    #print(a)
    n=x-a*100
    #print(n)
    if n/a>5:
        print(0)
    else:
        print(1)
a = list(map(str, input(),split()))
print(a[2],a[0],a[1])

### FIXED CODE ###

a,b,c = list(map(int, input().split()))
print(c,a,b)
from collections import defaultdict

n, m = map(int, input().split())
A = list(map(int, input().split()))
num_use_dic = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
usable = defaultdict(int)  # key: 使う本数, value: 整数
ans = []

for num in A:
    use = num_use_dic[num]
    if usable[use] < num:  # 使用本数が同じなら大きい数字のみ使えば良い
        usable[use] = num




def dfs(candidate, count):
    global ans
    if ans:
        return
    if count < 0:
        return
    if count == 0:
        ans = list(map(int, list(candidate)))
        return

    for use, num in sorted(usable.items()):
        dfs(candidate+str(num), count-use)


dfs('', n)
ans.sort(reverse=True)
print(''.join(map(str, ans)))

### FIXED CODE ###

from collections import defaultdict

n, m = map(int, input().split())
A = list(map(int, input().split()))
dic = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
usable = defaultdict(int)

for num in A:
    use = dic[num]
    if usable[use] < num:
        usable[use] = num

DP = [-1]*(n+10)
DP[0] = 0

for i in range(n):
    digits = DP[i]
    if digits < 0:
        continue

    for use in usable.keys():
        if i+use <= n and DP[i+use] < digits + 1:
            DP[i+use] = digits + 1
        else:
            continue

digits = DP[n]
num_of_match = n
ans = ''

for _ in range(n):
    if digits == 0:
        break

    for num in sorted(usable.values(), reverse=True):
        use = dic[num]
        if DP[num_of_match - use] == digits - 1:
            digits -= 1
            num_of_match -= use
            ans += str(num)
            break
        else:
            continue

print(ans)
i = raw_input().split(' ')
num = int(str(i[0]+str(i[1])))
for i in range(100):
	if i*i==num:
		print 'Yes'
	else:
		print 'No'
ethan:work ethan$

### FIXED CODE ###

i = raw_input().split(' ')
result =int(i[0])*int(i[1])
if result%2==0:
	print 'Even'
else:
	print 'Odd'
#入力
N, K = map(int, input().split())
li = list(map(int,input().split()))
list.sort(li, reverse = True)

#出力
for i in range(K):
    li[i] = 0

print(sum(li))

### FIXED CODE ###

import numpy as np
#入力
N, K = map(int, input().split())
li = list(map(int,input().split()))
list.sort(li, reverse = True)

#出力
a = list(np.zeros(K))
if N - K>=0:
    b = list(np.ones(N-K))
    a.extend(b)
else:
    a = list(np.zeros(N))

print(int(np.dot(a, li)))
def main():
    n ,m = map(int, input().split(' '))
    inf = 10**9
    bit_dp = [inf for _ in range(2**(n))]
    bit_dp[0] = 0
    for i in range(m):
        a, b = map(int, input().split(' '))
        c = list(map(int, input().split(' ')))
        bit_n = 0
        for i in c:
            bit_n |= 1 << i-1
        for i in range(2**(n)):
            if bit_dp[i|bit_n] > bit_dp[i] + a:
            bit_dp[i|bit_n] = bit_dp[i] + a
    if bit_dp[-1] >= inf:
        print(-1)
    else:
        print(bit_dp[-1])
if __name__ == '__main__':
    main()

### FIXED CODE ###

n, m = map(int, input().split(' '))
dp = [10**9 for _ in range(2**n)]
dp[0] = 0
for i in range(m):
    a, b = map(int, input().split(' '))
    c = list(map(int, input().split(' ')))
    num = 0
    for j in range(b):
        num += 1 << (c[j]-1)
    for s in range(2**n):
        if dp[s|num] >= dp[s] + a:
            dp[s|num] = dp[s] + a
if dp[-1] == 10**9:
    print(-1)
else:
    print(dp[-1])
N = int(input())
x = [0]*100000
count = 0

for i in range(N):
    a = int(input())
    if x[a-1] == 1:
            x[a-1] = 0
    else:
        x[a-1] += 1

print(x.count(1))


### FIXED CODE ###

import collections as cl
N = int(input())
x = []
count = 0

for i in range(N):
    a = int(input())
    x.append(a)

d = cl.Counter(x)

for i in d.values():
    if i % 2 == 1:
        count += 1
print(count)
a,b,v,w,t = map(int,input().split())

d = abs(b-a)
p = abs(v-w)
i=0
for i in range(1:t):
  if v<=w:
    print("NO")
  elif p*t == d:
    print("YES")


### FIXED CODE ###

a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if v <= w:
    print('NO')
else:
    if 1 <= (abs(b - a) / (v - w)) <= t:
        print('YES')
    else:
        print('NO')