Harryxun/stf_run huggingface dataset:
from math import pow



N, K = map(int, input().split())
records = [map(int, input().split()) for i in range(N)]


def compute_score(target_collection):
    keys = {neta_point[0] for neta_point in target_collection}
    points = [neta_point[1] for neta_point in target_collection]
    cardinality = len(keys)
    score = pow(cardinality, 2) + sum(points)
    return score

# exchange one record and compare
def optimize(full_collection, target_collection, target_collection_len, idx):
    while True:
        ex_record = full_collection[idx]
        # check on the idx-th record
        idx += 1
        # bump up for return value
        if ex_record in target_collection:
            continue # cardinality score will not increase
        else:
            for i in range(target_collection_len-1):
                if target_collection[i][0] == target_collection[i-1][0]:
                    target_collection[i] = ex_record
                    new_score = compute_score(target_collection)
                    return new_score, target_collection, idx
        # default
        return 0, target_collection, idx



def cal_score(N, K, records):
    sorted_recs = sorted(records, reverse=True, key=lambda x: x[1])
    target_collection = sorted_recs[0:K]
    score =  compute_score(target_collection)

    # optimzie at most K times
    idx = K
    for i in range(K):
        new_score, new_target_collection, idx = optimize(sorted_recs, target_collection, K, idx)
        if new_score <= score: # no optimization occured
            break
        else:
            score = new_score
    return score
 
score = cal_score(N, K, records)
print(score)


### FIXED CODE ###

from math import pow
from collections import deque, Counter
import sys
stdin = sys.stdin
def li(): return map(int, stdin.readline().split())

def cal_score(N, K, records):
    sorted_recs = sorted(records, key=lambda x: -x[1])
    target_queue = deque(sorted_recs[0:K]) # only allow pop() action, so use dequeue
    compare_queue = deque(sorted_recs[K:])
    distinct_set = set()
    dup_queue = deque()
    score = 0
    for neta_point in target_queue:
        score += neta_point[1]
        if neta_point[0] not in distinct_set:
            distinct_set.add(neta_point[0])
        else:
            dup_queue.append(neta_point)

    cardinality = len(distinct_set)
    score += pow(cardinality, 2)
    score = int(score)
    new_scores = deque()
    new_scores.append(score)
    # start iteration and comparing gain and lost
    while compare_queue:
        comp = compare_queue.popleft()
        if comp[0] in distinct_set:
            continue
        elif len(dup_queue) < 1:
            break
        else:
            old = dup_queue.pop()
            inc = 2 * len(distinct_set) + 1
            dec = old[1] - comp[1]
            delta = inc - dec
            new_score = new_scores[-1] + delta
            new_scores.append(new_score)

            distinct_set.add(comp[0])
    # both queues are drained
    return max(new_scores)

N, K = li()
records = [tuple(li()) for i in range(N)]
score = cal_score(N, K, records)
print(score)
numList = input().split()
numList = list(map(int, numList))
commandList = [
	[2,0,0],
	[0,2,0],
	[0,0,2],
	[0,1,1],
	[1,0,1],
	[1,1,0]
]
numListList = [numList]

def search(depth):
	global numListList
	tmpList = []
	for numList in numListList:
		for command in commandList:
			sumedList = sumList(numList, command)
			if check(sumedList, depth+1):
				return
			tmpList.append(sumedList)
	numListList = tmpList
	search(depth+1)

def sumList(list1, list2):
	return [list1[0]+list2[0], list1[1]+list2[1], list1[2]+list2[2]]

def check(list1, count):
	if list1[0] == list1[1] and list1[1] == list1[2]:
		print(count)
		return True

	if list1[0] == list1[1]:
		if list1[0] > list1[2] and (list1[0]-list1[2])%2 == 0:
			print(int(count+(list1[0]-list1[2])/2))
			return True
		if list1[2] > list1[0]:
			print(int(count+(list1[2]-ist1[0])))
			return True

	if list1[1] == list1[2]:
		if list1[1] > list1[0] and (list1[1]-list1[0])%2 == 0:
			print(int(count+(list1[0]-list1[2])/2))
			return True
		if list1[0] > list1[1]:
			print(int(count+(list1[0]-ist1[1])))
			return True

	if list1[0] == list1[2]:
		if list1[0] > list1[1] and (list1[0]-list1[1])%2 == 0:
			print(int(count+(list1[0]-list1[1])/2))
			return True
		if list1[1] > list1[0]:
			print(int(count+(list1[1]-ist1[0])))
			return True

	

search(0)

### FIXED CODE ###

numList = input().split()
numList = list(map(int, numList))
commandList = [
	[2,0,0],
	[0,2,0],
	[0,0,2],
	[0,1,1],
	[1,0,1],
	[1,1,0]
]
numListList = [numList]

def search(depth):
	global numListList
	tmpList = []
	for numList in numListList:
		for command in commandList:
			sumedList = sumList(numList, command)
			if check(sumedList, depth+1):
				return
			tmpList.append(sumedList)
	numListList = tmpList
	search(depth+1)

def sumList(list1, list2):
	return [list1[0]+list2[0], list1[1]+list2[1], list1[2]+list2[2]]

def check(numList, count):
	if numList[0] == numList[1] and numList[1] == numList[2]:
		print(count)
		return True

	if numList[0] == numList[1]:
		return check2(numList[0], numList[2], count)

	if numList[1] == numList[2]:
		return check2(numList[1], numList[0], count)

	if numList[0] == numList[2]:
		return check2(numList[0], numList[1], count)

	return False

def check2(num1, num2, count):
	if num1 > num2:
		if (num1-num2)%2 == 0:
			print(int(count+(num1-num2)/2))
			return True
		else:
			print(int(count+(num1-num2)/2)+2)
			return True
	else:
		print(int(count+(num2-num1)))
		return True

if check(numList, 0):
	pass
else:
	search(0)
s=input()
n=len(s)
for i in range(n-1):
  if s[i]==s[i+1]:
    print(i,i+1)
    break
  elif i<n-1 and s[i]==s[i+2]:
    print(i,i+2)
    break
else:
  print(-1,-1)

### FIXED CODE ###

s=input()
n=len(s)
for i in range(n-1):
  if s[i]==s[i+1]:
    print(i+1,i+2)
    break
  elif i<n-2 and s[i]==s[i+2]:
    print(i+1,i+3)
    break
else:
  print(-1,-1)
import heapq
al = {"a": 0, "b": 1, "c": 2, "d": 3, "e": 4, "f": 5,
      "g": 6, "h": 7, "i": 8, "j": 9, "k": 10, "l": 11,
      "m": 12, "n": 13, "o": 14, "p": 15, "q": 16, "r": 17,
      "s": 18, "t": 19, "u": 20, "v": 21, "w": 22, "x": 23,
      "y": 24, "z": 25}
als = [[] for _ in range(26)]
for i in als:
    heapq.heapify(i)
s = list(input())
ls = len(s)
for i, v in enumerate(s):
    heapq.heappush(als[al[v]], i)
t = list(input())
last_no = 0
for i, v in enumerate(t):
    print(als, v)
    if len(als[al[v]]) != 0:
        while True:
            p = heapq.heappop(als[al[v]])
            heapq.heappush(als[al[v]], p + ls)
            if p > last_no:
                last_no = p
                break
    else:
        print(-1)
        exit()
print(last_no + 1)


### FIXED CODE ###

import collections, bisect
s = tuple(input())
t = tuple(input())
ls = len(s)
idx = collections.defaultdict(list)
dct = collections.defaultdict(list)
ln = -1
loop = 0
for i, v in enumerate(s):
    idx[v].append(i)
for i in t:
    t_idx = idx[i]
    if t_idx:
        bn = bisect.bisect_left(t_idx, ln + 1)
        if bn >= len(t_idx):
            ln = t_idx[0]
            loop += 1
        else:
            ln = t_idx[bn]
    else:
        print(-1)
        exit()
print(ls * loop + ln + 1)
# -*- coding: utf-8 -*-
from math import factorial

n = int(input())
strlist = []
for i in range(n):
    strlist.append(set(str(input())))

allcount = 0
while (len(strlist) > 1):
    i = 1
    count = 1
    while True:
        if(strlist[0] == strlist[i]):
            count += 1
            strlist.pop(i)
        else:
            i += 1
        if(i==len(strlist)):
            if(count > 1):
                allcount += int(factorial(count) / factorial(2) / factorial(count-2))
            break
    strlist.pop(0)
print(allcount)

### FIXED CODE ###

n = int(input())
strdict = {}
count = 0
for i in range(n):
    sortedstr = "".join(sorted(str(input())))
    strdict.setdefault(sortedstr, 0)
    count += strdict[sortedstr]
    strdict[sortedstr] += 1
print(count)
import sys
from math import complex as C
for e in sys.stdin:
 a,b,c,d,e,f=map(float,e.split(','))
 z,w,q=C(a,b),C(c,d),C(e,f)
 w-=z
 z+=(w/abs(w))**2*(q-z).conjugate()
 print(z.real,z.imag)


### FIXED CODE ###

import sys
from math import*
for e in sys.stdin:
 a,b,c,d,e,f=map(float,e.split(','))
 z,w,q=complex(a,b),complex(c,d),complex(e,f)
 w-=z
 z+=(w/abs(w))**2*(q-z).conjugate()
 print(z.real,z.imag)
n, x, t = map(int, input().split())
print((n // x + (n % x == 0) ? 0 : 1) * t)

### FIXED CODE ###

n, x, t = map(int, input().split())
print((n // x + (0 if n % x == 0 else 1)) * t)
import sys
n,m=map(int,input().split())
arr=[1,2]
arr=arr+[0]*(n-2)
danger=tuple(map(int,sys.stdin))
m=0
if 1 == danger[0]:
  arr[0]=0
  arr[1]=1
  m=1
for i in range(n):
  if i+1 == danger[m]:
    arr[i]=0
    m+=1
  elif i==0 or i==1:
    continue 
  else:
    arr[i]=(arr[i-1]+arr[i-2])%(10**9+7)
print(arr[n-1]%(10**9+7))

### FIXED CODE ###

import sys
n,m = map(int,input().split())
a = list(map(int,sys.stdin))
a.append(0)
prev=0
cur=1
m=0
for i in range(1,n+1):
  if a[m]==i:
    prev,cur = cur,0
    m += 1
  else:
    prev,cur = cur,(cur+prev)%1000000007
print(cur)
, M = list(map(int, input().split()))

cakes = []  
for _ in range(N):
    cakes.append(list(map(int, input().split())))

memo = dict()

def pick_cake(picked):
    key = ','.join([str(p) for p in sorted(picked)])
    if key in memo: 
        return memo[key]

    if len(picked) == M:
        memo[key] = sum([abs(sum([cakes[i][j] for i in picked])) for j in range(3)])
        return memo[key]

    answer = 0 
    for i in range(N):
        if i in picked:
            continue
        answer = max(answer, pick_cake(picked + [i]))
    return answer

print(pick_cake([]))

### FIXED CODE ###

from itertools import product

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

cakes = []
for _ in range(N):
    cakes.append(list(map(int, input().split())))

def _eval1(op):
    def _eval2(x):
        return eval(''.join(['{}{}'.format(op[i], x[i]) for i in range(3)]))

    return _eval2

answer = 0
for op in product('+-', repeat=3):
    answer = max(answer, sum([abs(sum([cake[j] for cake in sorted(cakes, key=_eval1(op))[:M]])) for j in range(3)]))

print(answer)
N=int(input())
##c=list(map(int, input().split()))
a=[]
b=[]
for i in range(N):
    a.append(int(input()))
    b.append(int(input()))

k=0
for i in range(N):
    for j in range(N):
        if(i!=j):
            k=k+((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]))**0.5

print(k/N)




### FIXED CODE ###

N=int(input())
##c=list(map(int, input().split()))

a = [list(map(int, input().split())) for _ in range(N)]

k=0
for i in range(N):
    for j in range(N):
        if(i!=j):
            k=k+((a[i][0]-a[j][0])*(a[i][0]-a[j][0])+(a[i][1]-a[j][1])*(a[i][1]-a[j][1]))**0.5

print(k/N)
#coding:utf-8
import bisect
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + , +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    s = input()
    if s[0] == s[1] == s[2]:
        print(No)
    elif s[0] == s[1] and s[2] == s[3]:
        print(Yes)
    elif s[0] == s[2] and s[1] == s[3]:
        print(Yes)
    elif s[0] == s[3] and s[1] == s[2]:
        print(Yes)
    else:
        print(No)




if __name__ == '__main__':
    main()



### FIXED CODE ###

S = input()

a = 1
b = 1
first = S[0]
second = ""
for i in range(3):
    if S[i+1] == first:
        a += 1
    elif second == "":
        second = S[i+1]
    elif second == S[i+1]:
        b+= 1

if a == 2 and b == 2:
    print("Yes")
else:
    print("No")
N,M=map(int,input().split())
list=[0 for i in range(5*10**5+1)]
mod=10**9+7
list[0]=1
for i in range(len(list)-1):
  list[i+1]=list[i]*(i+1)%mod
def c(m,n):
  a=list[m]*pow(list[m-n],mod-2,mod)*pow(list[n],mod-2,mod)
  return a
def p(m,n):
  a=list[m]*pow(list[m-n],mod-2,mod)
  return a
ans=pow(p(M,N),2)
g=pow(list[M-N],mod-2,mod)
g2=pow(g,2,mod)
nn=list[N]
mm=list[M]
nmg=nn*mm*g2%mod
for i in range(1,N+1):
  ans+=nmg*pow(list[N-i],mod-2,mod)*pow(list[i],mod-2,mod)*list[M-i]*(-1)**i
  ans%=mod
print(ans)


### FIXED CODE ###

a=int(input())
print(int(a+a**2+a**3))
while True:
  a,op,b=map(str,raw_input().split())
  a=int(a)
  b=int(b)
  
  if op=='+':
    print a+b
  elif op=='?':
    break
  elif op=='-':
    print a-b
  elif op=='/':
    print a//b
  elif op=='*':
    ptint a*b
    

### FIXED CODE ###

while True:
  a,op,b=map(str,raw_input().split())
  a=int(a)
  b=int(b)
  
  if op=='+':
    print a+b
  elif op=='?':
    break
  elif op=='-':
    print a-b
  elif op=='/':
    print a/b
  elif op=='*':
    print a*b
def ten_to_n(X, n):
    i = int(X / n)
    s = str(X % n)
    if (i):
        return ten_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    n = ten_to_n(N, M)
    return len(n)
 
print(solve())


### FIXED CODE ###

def solve():
    n, a, b = list(map(int, input().split()))
    MOD = 10 ** 9 + 7
    fact = [1, 1]
    factinv = [1, 1]
    inv = [0, 1]
    
    for i in range(2, max(a, b)+1):
        fact.append((fact[-1] * i) % MOD)
        inv.append((-inv[MOD % i] * (MOD // i)) % MOD)
        factinv.append((factinv[-1] * inv[-1]) % MOD)
    
    def ncr(n, r):
        ret = factinv[r]
        for i in range(n, n-r, -1):
            ret = ret * i % MOD
        return ret
        
    ans = pow(2, n, MOD)
    ans = (ans-ncr(n, a)-ncr(n, b)-1) % MOD
    return ans


print(solve())
import math
     
n, D = map(int, input().split())
point = []
for _ in range(n):
	x = list(map(int, input().split()))
    point.append(x)
     
cnt = 0
for i in range(n-1):
	for j in range(i+1, n):
		dist = 0
        for d in range(D):
        	dist += (point[i][d] - point[j][d])**2
     
        dist = math.sqrt(dist)
        if int(dist) == dist:
        	cnt += 1
     
print(cnt)

### FIXED CODE ###

import math
     
n, D = map(int, input().split())
     
point = []
for _ in range(n):
	x = list(map(int, input().split()))
	point.append(x)
     
cnt = 0
for i in range(n-1):
	for j in range(i+1, n):
		dist = 0
		for d in range(D):
			dist += (point[i][d] - point[j][d])**2
     
		dist = math.sqrt(dist)
		if int(dist) == dist:
			cnt += 1
     
print(cnt)
N = int(input())

point = []
dist = []
maxDist = 0

for _ in range(N) :
    x, y = map(int, input().split())
    d = abs(x) + abs(y)
    maxDist = max(maxDist, d)
    point.append((x, y, d))
    dist.append(d)

mask = maxDist % 2

for d in dist :
    if d % 2 != mask :  # 実現不可能
        print('-1')
        break
else :  # 実現可能
    print(maxDist) # 腕の数
	print(1)
    for x, y, d in point :
        if x < 0 :
            for _ in range(-x) :
                print('L', end='')
        elif x > 0 :
            for _ in range(x) :
                print('R', end='')

        if y < 0 :
            for _ in range(-y) :
                print('D', end='')
        elif y > 0 :
            for _ in range(y) :
                print('U', end='')

        R = (maxDist - d) // 2
        if R > 0 :
            for _ in range(R) :
                print('LR', end='')

        print('')


### FIXED CODE ###

N=int(input())

point = []
parity = {}
for _ in range(N) :
    x, y = map(int, input().split())
    point.append((x, y))
    parity[(x + y) % 2] = 1

if len(set(parity)) == 2 :
    print('-1')
else :
    m = 38
    parity = 1 if (1 in parity) else 0
    print(m + 1 - parity)
    if parity == 1 :  # 距離が奇数
        print(*[1 << i for i in range(m)])
    else :
        print(1, *[1 << i for i in range(m)])

    def arm(x, y, m) :
        if abs(x) >= abs(y) :
            if x >= 0 :
                return ('R', x - (1<<m), y)
            else :
                return ('L', x + (1<<m), y)
        else :
            if y >= 0 :
                return ('U', x, y - (1<<m))
            else :
                return ('D', x, y + (1<<m))

    for x, y in point :
        ans = []
        for i in range(m-1, -1, -1) :
            mode, x, y = arm(x, y, i)
            ans.append(mode)
        if parity == 0 :  # 偶数の場合一つ足す
            if x == 1 :
                ans.append('R')
            elif x == -1 :
                ans.append('L')
            elif y == 1 :
                ans.append('U')
            elif y == -1 :
                ans.append('D')
        print(''.join(ans[::-1]))
n=int(input())

g =[[] for _ in range(n)]
ans=[0] * (n-1)

def dfs(v,c=-1,p=-1):
    k=1

    for u,ei in g[v]:
        if u == p: continue
        if k == c: k+=1

        ans[ei] = k
        k+=1
        dfs(u,ans[ei],v)

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

dfs(0)
mx=0

for i in range(n):
    mx = max(mx,int(len(g[i])))

print(mx)
for i in ans:print(i)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

n=int(input())

g =[[] for _ in range(n)]
ans=[0] * (n-1)

def dfs(v,c=-1,p=-1):
    k=1

    for u,ei in g[v]:
        if u == p: continue
        if k == c: k+=1

        ans[ei] = k
        k+=1
        dfs(u,ans[ei],v)

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

dfs(0)
mx=0

for i in range(n):
    mx = max(mx,int(len(g[i])))

print(mx)
for i in ans:print(i)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics

def main():
    a, b, c, d = (int(x) for x in list(sys.stdin.readline().rstrip()))
    s = 7 - a
    if sum([b, c, d]) == s: res = '+++'
    elif sum([-b, c, d]) == s: res = '-++'
    elif sum([b, -c, d]) == s: res = '+-+'
    elif sum([b, c, -d]) == s: res = '++-'
    elif sum([-b, -c, d]) == s: res = '--+'
    elif sum([-b, c, -d]) == s: res = '-+-' 
    if res[0] == '-': b = -b
    if res[1] == '-': c = -c
    if res[2] == '-': d = -d
    ans = [str(a)]
    for x in [b, c, d]:
        if x >= 0 : x = '+' + str(x)
        else: x = str(x)
        ans.append(x)
    print(''.join(ans) + '=7')


if __name__ == "__main__":
    # execute only if run as a script
    main()


### FIXED CODE ###

import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics

def main():
    a, b, c, d = (int(x) for x in list(sys.stdin.readline().rstrip()))
    s = 7 - a
    if sum([b, c, d]) == s: res = '+++'
    elif sum([-b, c, d]) == s: res = '-++'
    elif sum([b, -c, d]) == s: res = '+-+'
    elif sum([b, c, -d]) == s: res = '++-'
    elif sum([-b, -c, d]) == s: res = '--+'
    elif sum([-b, c, -d]) == s: res = '-+-' 
    elif sum([b, -c, -d]) == s: res = '+--'
    if res[0] == '-': b = -b
    if res[1] == '-': c = -c
    if res[2] == '-': d = -d
    ans = [str(a)]
    for x in [b, c, d]:
        if x >= 0 : x = '+' + str(x)
        else: x = str(x)
        ans.append(x)
    print(''.join(ans) + '=7')


if __name__ == "__main__":
    # execute only if run as a script
    main()
n = input()
A = list(map(int, input().split()))
print(int(max(A)) - int(min(A)))

### FIXED CODE ###

N = int(input())
 
if N % 2 == 0:
  print(int(N))
else:
  print(int(2*N))
n = int(input())

ulist = []

for _ in range(n):
    ulist.append([])

vlist = [True] * n

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


def check(checkV, fromV):
    for data in ulist[checkV]:
        if data[0] != fromV:
            vlist[data[0]] = vlist[checkV] if data[1] % 2 == 0 else not vlist[checkV]
            check(data[0], checkV)

check(0, -1)

for i in range(n):
    print(1 if vlist[i] else 0)

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000000)

n = int(input())

ulist = []

for _ in range(n):
    ulist.append([])

vlist = [True] * n

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


def check(checkV, fromV):
    for data in ulist[checkV]:
        if data[0] != fromV:
            vlist[data[0]] = vlist[checkV] if data[1] % 2 == 0 else not vlist[checkV]
            check(data[0], checkV)

check(0, -1)

for i in range(n):
    print(1 if vlist[i] else 0)
N, M =map(int, input().split())
H_tree = [0] + [int(n) for n in input().split()]
GOOD_tree = [0] + [1 for n in range(N)]
 
for i in range(M):
  A, B = map(int, input().split())
  if H_tree[A]<=H_tree[B]:GOOD_Tree[A] = 0
  if H_tree[A]>=H_tree[B]:GOOD_Tree[B] = 0
print(sum(GOOD_tree))

### FIXED CODE ###

N, M =map(int, input().split())
H_tree = [0] + [int(n) for n in input().split()]
GOOD_Tree = [0] + [1 for n in range(N)]
 
for i in range(M):
  A, B = map(int, input().split())
  if H_tree[A]<=H_tree[B]:GOOD_Tree[A] = 0
  if H_tree[A]>=H_tree[B]:GOOD_Tree[B] = 0
print(sum(GOOD_Tree))
from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
p=gcd(n,m)
# ans=n*m//p
# tt=[0 for _ in range(ans)]
# for i in range(n):
# 	tt[i*(ans//n)]=ord(s[i])
# for i in range(m):
# 	if tt[i*(ans//m)]!=ord(t[i]) and tt[i*(ans//m)]!=0:
# 		print(-1)
# 		exit()
print(ans)


### FIXED CODE ###

from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
p=gcd(n,m)
ans=n*m//p 
for i in range(n):
	if abs((i*(ans//n)/(ans//m))-int(i*(ans//n)/(ans//m)))<=10**(-7):
		if s[i]==t[(i*(ans//n)//(ans//m))]:
			continue
		else:
			print(-1)
			exit()
print(ans)
K,X=map(int,input( ).split( ))
print ('Yes' if 500 * K => X else 'No')


### FIXED CODE ###

a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')
import sys

a=input()
b=input()
"""
if(len(a)>len(b)):
    print("Yes")
    sys.exit()
elif(len(a)<len(b)):
    print("No")
    sys.exit()
else:
"""
c=[]
d=[]
for i in range(len(a)):
    c.append(a[i])
for i in range(len(b)):
    d.append(b[i])
c.sort()
d.reverse()
for i in range(len(a)):
    if(c[i]<d[i]):
        print("Yes")
        sys.exit()
print("No")

### FIXED CODE ###

import sys

a=input()
b=input()
c=[]
d=[]
for i in range(len(a)):
    c.append(a[i])
for i in range(len(b)):
    d.append(b[i])
c.sort()
d.sort()
d.reverse()
for i in range(min([len(a),len(b)])):
    if(c[i]<d[i]):
        print("Yes")
        sys.exit()
if(len(a)<len(b)):
    if(a==b[0:len(a)]):
        print("Yes")
        sys.exit()
print("No")
#coding UTF-8

import math
import sys

for line in sys.stdin:
	a,b = map(int, line.split(' '))
	print int(math.log10(a + b) + 1

### FIXED CODE ###

#coding UTF-8

import math
import sys

for line in sys.stdin:
	a,b = map(int, line.split(' '))
	print int(math.log10(a + b)) + 1
L, R = map(int, input().split())



#print(L%2019, R%2019)

#print((L + 2019 - L%2019))

tmp = 0
"""
if L * R < 2019:
	i = L
	j = R

elif (L + 2019 - L%2019) + 1 <= R:
	if L < L + 2019 - L % 2019 and L + 2019 - L % 2019 + 1 < R:
		i =  L + 2019 - L % 2019
		j = i+1

elif L % 2019 < R % 2019:
	i = L
	j = i+1

elif R % 2019 > L % 2019:
	j = R
	i = j-1

else:
	i = L
	j = R
"""

i = 2019 - np.abs(L-R)
j = i+1

ans = i * j % 2019

print(ans)

### FIXED CODE ###

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

if N*A>B:
	print(B)
else:
	print (A*N)
a,b,c,x=map(int,input().split())
i=0
for s in range(1,a+1):
    for t in range(1,b+1):
         for r in range(1,c+1):
            if 500*a+100*b+50*c==x:
                i+=1
print(i)

### FIXED CODE ###

a,b,c,x=[int(input()) for i in range(4)]
i=0
for _ in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*_+100*j+50*k==x:
                i+=1
print(i)
n = int(input())
a = list(map(int, input().split()))
sum = 0
b = [i % (10**9+7) for i in a if i % (10**9+7) != 0]
# print(b)
for j in range(0,len(b)-1):
    for k in range(j+1,len(b)):
        c = b[j]*b[k]
        sum = sum + c
print(sum%(10**9+7))

### FIXED CODE ###

d, t, s = map(int, input().split())
if t*s < d:
    print('No')
else:
    print('Yes')
num = list(map(int, input().split()))
count = 0
for i in num:
  if i = 0:
    count += 1
    print(count)
  else:
    count += 1

### FIXED CODE ###

num = list(map(int, input().split()))
count = 0
for i in num:
  if i == 0:
    count += 1
    print(count)
  else:
    count += 1