Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(M)]

connect_list = [set() for _ in range(N)]
ranking = [set() for _ in range(N)]
ranked_set = set()
full_set = {i for i in range(1, N+1)}


def do_ranking(set, rank):
    global connect_list, ranking, ranked_set, full_set
    if ranked_set == full_set:
        return 0
    for j in list(set):
        for i in list(connect_list[j-1]):
            if i not in ranked_set:
                ranking[rank].add(i)
                ranked_set.add(i)
    do_ranking(ranking[rank], rank+1)



for A, B in AB:
    connect_list[A-1].add(B)
    connect_list[B-1].add(A)
ranking[0] = connect_list[0]
ranked_set = ranked_set | ranking[0]
ranked_set.add(1)
do_ranking(ranking[0], 1)

root_list = [0]*N
root_list[0] = "Yes"
count = 0
no_flag = False
for i in range(1, N):
    flag = True
    j = 0
    while flag:
        if len(ranking[j]) == 0:
            no_flag = True
            break
        seki = connect_list[i] & ranking[j]
        if 1 in connect_list[i]:
            root_list[i] = 1
            flag = False
        elif len(seki) != 0:
            root_list[i] = list(seki)[0]
            flag = False
        else:
            j += 1
    if no_flag:
        print("No")
        break
if no_flag == False:
    for i in root_list:
        print(i)

### FIXED CODE ###

N, M = map(int, input().split())
connect_list = [set() for _ in range(N)]    #繋がっているリスト
for _ in range(M):
    A, B = map(int, input().split())
    connect_list[A-1].add(B)
    connect_list[B-1].add(A)

root_list = [0]*N
root_list[0] = "Yes"

for i in list(connect_list[0]):
    root_list[i-1] = 1
now_set = connect_list[0]
while len(now_set) != 0:
    for j in list(now_set):
        for i in list(connect_list[j-1]):
            if root_list[i-1] == 0:
                root_list[i-1] = j
                now_set.add(i)
        now_set.remove(j)

for i in root_list:
    print(i)
N, M, X = map(int,input().split())
l = [list(map(int, input().split())) for i in range(N)]

yen = []
scores = []
def dfs(m,i,score_sum,y):
  if i == N:
    scores.append(score_sum)
    yen.append(y)
    return
  dfs(m,i+1,score_sum,y)
  dfs(m,i+1,score_sum+l[i][m],y+l[i][0])

for k in range(1,M+1):
  dfs(k,0,0,0)

cycle = len(scores)// M

goodyen = []
for k in range(len(yen)):
  cnt = 0
  for m in range(M):
    if scores[ m * cycle + k] >= X:
      cnt += 1
  if cnt == M:
    goodyen.append(yen[k])
print(min(goodyen))

### FIXED CODE ###

N,M,X = map(int,input().split())
C = []
A = []
for i in range(N):
    ls = list(map(int,input().split()))
    C.append(ls[0])
    A.append(ls[1:])

INF = 10**9
ans = INF
for i in range(2**N):
    skill = [0]*M
    yen = 0
    for j in range(N):
        if i >> j & 1:
            for k in range(M):
                skill[k] += A[j][k]
            yen += C[j]
    ok = True
    for j in skill:
        if j < X:
            ok = False

    if ok:
        ans = min(ans,yen)
if ans == INF:
    print(-1)
else:
    print(ans)
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
#print(a[:n-1])
enu=max(a)

k=(enu)/2
sa=100000

for i in range(n-1):
    if abs(k-a[i])<sa:
        sa=k-a[i]
        aru=a[i]

print(enu,aru)

### FIXED CODE ###

n=int(input())
a=[int(i) for i in input().split()]
a.sort()
enu=max(a)

k=(enu)/2
sa=10000000000000000000000000000

for i in range(n-1):
    if abs(k-a[i])<sa:
        sa=k-a[i]
        aru=a[i]

print(enu,aru)
while True:
    flag=0
    v=float(input())
    t=v/9.8
    y=4.9*t**2
    N=0
    while y>5*(N-1):
        N +=1
    print(N)
    flag +=1
    if flag==50:break    



### FIXED CODE ###

while True:
    try:
        v=float(input())
        t=v/9.8
        y=4.9*t**2
        N=0
        while y>5*(N-1):
            N +=1
        print(N)
    except:break
n = int(input())
S = list(map(int, input().split()))
SENTINEL = 10 ** 9 + 1
count = 0

def merge(A, left, mid, right):
    n1 = mid - left
    n2 = right - mid
    L = A[left:mid]
    R = A[mid:right]
    for i in range(n1):
        L[i] = A[left + i]
    for i in range(n2):
        R[i] = A[mid + i]
    L[n1] = r[n2] = SENTINEL
    i = j = 0
    for k in range(left, right):
        count += 1
        if(L[i] <= R[i]):
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

mergeSort(A, left, right):
    if(left + 1 < right):
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

mergeSort(A, 0, n)
print(" ".join(list(map(str, A))))
print(count)

### FIXED CODE ###

n = int(input())
S = list(map(int, input().split()))
SENTINEL = 10 ** 9 + 1
count = 0
 
def merge(S, left, mid, right):
    L = S[left:mid] + [SENTINEL]
    R = S[mid:right] + [SENTINEL]
    i = j = 0
    global count
    for k in range(left, right):
        count += 1
        if (L[i] <= R[j]):
            S[k] = L[i]
            i += 1
        else:
            S[k] = R[j]
            j += 1
 
def mergeSort(S, left, right):
    if(left + 1 < right):
        mid = (left + right) // 2
        mergeSort(S, left, mid)
        mergeSort(S, mid, right)
        merge(S, left, mid, right)
 
mergeSort(S, 0, n)
print(*S)
print(count)
import sys
def oncount(x):
    r=0
    while x>0:
        r+=x&1
        x=x>>1
    return r

dp=[[0]*331 for i in range(1024)]
for i in range(10):
    dp[1<<i][i]=1
for i in range(1024):
    for j in range(331):
        t=oncount(i)
        for k in range(10):
            if 1&(i>>k):
                x=j-t*k
                if x>=0: dp[i][j]+=dp[i&~(1<<k)][x]
                
for a in sys.stdin
    n,s=map(int,a.split())
    ans=0
    if s<=330:
        for i in range(1024):
            if oncount(i)==n:ans+=dp[i][s]
    print ans

### FIXED CODE ###

import sys
def oncount(x):
    r=0
    while x>0:
        r+=x&1
        x=x>>1
    return r

dp=[[0]*331 for i in range(1024)]
for i in range(10):
    dp[1<<i][i]=1
for i in range(1024):
    for j in range(331):
        t=oncount(i)
        for k in range(10):
            if 1&(i>>k):
                x=j-t*k
                if x>=0: dp[i][j]+=dp[i&~(1<<k)][x]
                
for a in sys.stdin:
    n,s=map(int,a.split())
    ans=0
    if s<=330:
        for i in range(1024):
            if oncount(i)==n:ans+=dp[i][s]
    print ans
import sys

def square():
    argvs=sys.argv
    print( int(argvs[1])*int(argvs[2])-int(argvs[1])-int(argvs[2])+1)

square()


### FIXED CODE ###

def square():
    x,y=[int(i) for i in input().split()]
    print( x*y-x-y+1)

square()
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors

def checker(A,k):
    if sum(sorted(A)[:-1]) <= k:
        return True
    return False

n,k = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

for d in make_divisors(sum(A)):
    buf = []
    buf2 = []
    if d == 1:
        print(d)
        break
    else:
        for a in A:
            buf.append(a%d)
        #print(buf)
        if checker(buf.sort(reverse=True),k):
            print(d)
            break

### FIXED CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors

def checker(A,k):
    A.sort(reverse=True)
    if sum(A[sum(A) // d:]) <= k:
        return True
    return False

n,k = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

for d in make_divisors(sum(A)):
    buf = []
    for a in A:
        buf.append(a%d)
    #print(buf)
    if checker(buf,k):
        print(d)
        break
# -*- coding: utf-8 -*-
from bisect import bisect_right

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


P=[2,
 3,
 5,
 7,
 11,
 13,
 17,
 19,
 23,
 29,
 31,
 37,
 41,
 43,
 47,
 53,
 59,
 61,
 67,
 71,
 73,
 79,
 83,
 89,
 97,
 101,
 103,
 107,
 109,
 113,
 127,
 131,
 137,
 139,
 149,
 151,
 157,
 163,
 167,
 173,
 179,
 181,
 191,
 193,
 197,
 199,
 211,
 223,
 227,
 229,
 233,
 239,
 241,
 251,
 257,
 263,
 269,
 271,
 277,
 281,
 283,
 293,
 307,
 311,
 313,
 317,
 331,
 337,
 347,
 349,
 353,
 359,
 367,
 373,
 379,
 383,
 389,
 397,
 401,
 409,
 419,
 421,
 431,
 433,
 439,
 443,
 449,
 457,
 461,
 463,
 467,
 479,
 487,
 491,
 499,
 503,
 509,
 521,
 523,
 541,
 547,
 557,
 563,
 569,
 571,
 577,
 587,
 593,
 599,
 601,
 607,
 613,
 617,
 619,
 631,
 641,
 643,
 647,
 653,
 659,
 661,
 673,
 677,
 683,
 691,
 701,
 709,
 719,
 727,
 733,
 739,
 743,
 751,
 757,
 761,
 769,
 773,
 787,
 797,
 809,
 811,
 821,
 823,
 827,
 829,
 839,
 853,
 857,
 859,
 863,
 877,
 881,
 883,
 887,
 907,
 911,
 919,
 929,
 937,
 941,
 947,
 953,
 967,
 971,
 977,
 983,
 991,
 997]

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

check = [0]*1000
flag = 0
for a in A:
    for i in range(bisect_right(P, int(a**0.5))+1):
        if a%P[i] == 0 and flag == 0:
            if check[P[i]] == 1:
                flag = 1
            else:
                check[P[i]] = 1
    if flag:
        break

if gcd_list(A) > 1:
    print("not coprime")
elif flag:
    print("setwise coprime")
else:
    print("pairwise coprime")
  

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


n = 10**6
minfac = list(range(n+1))
for i in range(2, int(n**0.5) + 1):
    if minfac[i] < i:
        continue
    for j in range(i, n + 1, i):
        if minfac[j] > i:
            minfac[j] = i

"""nの素因数の種類を求める"""
def osa_k(n):
    temp = set()
    while n > 1:
        temp.add(minfac[n])
        n = n//minfac[n]
    return temp


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

check = [0]*(10**6)
flag = 0
for a in A:
    for i in osa_k(a):
        if check[i]:
            flag = 1
        else:
            check[i] = 1
    if flag:
        break
        
if gcd_list(A) > 1:
    print("not coprime")
elif flag:
    print("setwise coprime")
else:
    print("pairwise coprime")
H, W = list(map(int, input().split()))
for _ in H:
    S = input()
    print(S)
    print(S)

### FIXED CODE ###

H, W = list(map(int, input().split()))
for _ in range(H):
    S = input()
    print(S)
    print(S)
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
ns = []
for _ in range(n):
    ns.append(int(input()))

print(lcm(ns))

### FIXED CODE ###

import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
ns = []
for _ in range(n):
    ns.append(int(input()))

print(lcm(ns))
x = int(input())

a = [i**5 for i in range(-100, 101)]

for _a in a:
    if _a**5 + x in a:
        if (_a**5 + x) >= 0:
            a1, a2 = _a, int((_a**5 + x)**(1/5))
        else:
            a1, a2 = _a, int(abs(_a**5 + x)**(1/5))*(-1)
        break

print(a2, a1)


### FIXED CODE ###

x = int(input())

for a in range(-120, 121):
    for b in range(-120, 121):
        if a**5 - b**5 == x:
            print(a, b)
            exit()
S = input()
answer = 0
for i in range(int(int(S))//2019 + 1):
    f = 2019 * i
    if f in S:
        answer += 1

print(answer)

### FIXED CODE ###

S = list(map(int, list(input())))

pops = 0
digi = 1
cnt = [0] * 2019
cnt[0] = 1

while S:
    s = S.pop()

    pops = (pops + s * digi) % 2019
    digi = (10 * digi) % 2019

    cnt[pops] += 1

ans = 0

for i in range(2019):
    ans += cnt[i] * (cnt[i] - 1) // 2

print(ans)
a,b = map(int,input().split())
if a > b:
	print('GREATER')
elif a < b:
	print('LESS')
else:
	print('EQUAL')

### FIXED CODE ###

a = int(input())
b = int(input())
if a > b:
	print('GREATER')
elif a < b:
	print('LESS')
else:
	print('EQUAL')
N, K = map(int, input().split())
S = list(input())

print(S)
s_l = S[K].lower()
S[K] = s_l
print("".join(S))

### FIXED CODE ###

N, K = map(int, input().split())
S = list(input())
s_l = S[K-1].lower()
S[K-1] = s_l
print("".join(S))
from operator import mul
from functools import reduce
from collections import deque

import numpy as np


def is_ok(n, lst):
  flags = [0 for i in range(n)]
  for i in lst:
    flags[i[0]-1] = 1
    flags[i[1]-1] = 1
  if reduce(mul, flags) > 0:
    return True
  return False  


n, m = map(int, input().split())
arr = np.zeros([n, n])
for i in range(m):
  tmp0, tmp1 = map(int, input().split())
  arr[tmp0-1][tmp1-1] = 1
  arr[tmp1-1][tmp0-1] = 1
  

can_solve = is_ok(n, lst)
if can_solve:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

from collections import deque

def main():
    n,m = map(int,input().split())
    ab = [[] for i in range(n)]
    for _ in range(m):
        a,b = map(int,input().split())
        ab[a-1].append(b-1)
        ab[b-1].append(a-1)
    q = deque()
    q.append(0)
    ans = [-1] * n
    ans[0] = 0
    while q:
        now = q.popleft()
        for i, next in enumerate(ab[now]):
            if ans[next] == -1:
                ans[next] = now+1
                q.append(next)
        if len(q) == 0:
            break
    print('Yes')
    for i in range(1,n):
        print(ans[i])



if __name__=='__main__':
    main()
# C
N, M = list(map(int, input().split()))

flag = 0
ans = [0]*M
ans_flag = [0]*M

sc = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    s, c = sc[i]
    if ans_flag[s-1] == 1:
        if ans[s-1] != c:
            flag = 1
            break
    ans_flag[s-1] = 1
    ans[s-1] = c

if flag == 1:
    print("-1")
else:
    if ans[0] == 0 and ans_flag[0]==1:
        print("-1")
    else:
        if ans[0]==0:
            ans[0] = 1
        for i in ans:
            print(i, end="")


    


### FIXED CODE ###

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

flag = 0
ans = [0]*N
ans_flag = [0]*N

sc = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    s, c = sc[i]
    if ans_flag[s-1] == 1:
        if ans[s-1] != c:
            flag = 1
            break
    ans_flag[s-1] = 1
    ans[s-1] = c

if flag == 1:
    print("-1")
else:
    if N==1:
        for i in ans:
            print(i, end="")

    elif ans[0] == 0 and ans_flag[0]==1:
        print("-1")
    else:
        if ans[0]==0:
            ans[0] = 1
        for i in ans:
            print(i, end="")
import math
N, H = list(map(int, input().split()))
a = []
b = []
for _ in range(N):
    ta, tb = list(map(int, input().split()))
    a.append(ta)
    b.append(tb)

b = list(filter(lambda x: x > max(a), b))
b.sort()
slashNum = math.ceil( (H - sum(b)) / max(a) )

dmg = slashNum * max(a)
for i in range(N):
    dmg += b[-i]
    if dmg >= H:
        print(slashNum + i + 1)
        exit()

### FIXED CODE ###

N, H = list(map(int, input().split()))
maxA = 0
n = 0
b = []
for _ in range(N):
    ta, tb = list(map(int, input().split()))
    maxA = max(maxA, ta)
    b.append(tb)

b = list(filter(lambda x: x > maxA, b))
b.sort()

while H > 0 and b:
    H -= b.pop()
    n += 1

print(n + max(H-1, -1) // maxA + 1 )
s = map(int, input().split())
return (s[0] == s[1] == 5 and s[2] == 7 or s[2] == s[1] == 5 and s[0] == 7 s[0] == s[2] == 5 and s[1] == 7)



### FIXED CODE ###

a, b, c = map(int, input().split())
if (a==b == 5 and c ==7) or (a==c == 5 and b ==7) or (c== b == 5 and a ==7):
  print("YES")
else:
  print("NO")
import sys
from functools import reduce
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n
def gcd_list(numbers):
    return reduce(gcd, numbers)

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
c = [gcd_list(a[:i] + a[i+1:]) for i in range(n%4)]
c.sort()
if n == 2:
    print(c[1])
else:
    print(c[2])

### FIXED CODE ###

import sys
def gcd(m, n):
    if n == 0:
        n, m = m, n
    r = m % n
    return gcd(n, r) if r else n

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
l, r = [0]*(n+1), [0]*(n+1)
for i in range(1, n+1):
    l[i] = gcd(l[i-1], a[i-1])
    r[n-i] = gcd(r[n-i+1], a[n-i])
ans = 0
for i in range(n):
    m = gcd(l[i], r[i+1])
    if ans < m:
        ans = m
print(ans)
nput()
one_list=list(a)
b=input()
two_list=list(b)
c=input()
three_list=list(c)
print('{0}{1}{2}'.format(a[0],b[1],c[2]))

### FIXED CODE ###

a=input()
one_list=list(a)
b=input()
two_list=list(b)
c=input()
three_list=list(c)
print('{0}{1}{2}'.format(a[0],b[1],c[2]))
fun main(args : Array<String>) {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map { it.toInt() }
    val B = (1..N).map {
        val index = it - 1
        A.get(index) - it
    }.toMutableList()
    B.sort()

    val median = B.get(N / 2)
    val answer = B.map { Math.abs(it - median) }.sum()

    println(answer)
}

### FIXED CODE ###

def m():
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0
    B = [a[i-1]-i for i in range(1, n+1)]
    B.sort()
    b = B[n//2]
    for i in range(n):
        ans += abs(B[i]-b)
    return ans

print(m())
N=int(input())#入力回数を決める
data = input().split() 
list_count = []
for num in data:
    count = 0
    while int(num) % 2 == 0:
        num = int(num) / 2
        count += 1
    list_count.append(count) 

print(min(list_count))

### FIXED CODE ###

a, b, c = map(int, input())
list = [a,b,c]
count = 0
for num in list:
    if num == 1:
        count += 1
print(count)
n=int(input())
string_list=[input() for i in range(n)]
new_list = {}
target_chr = "AB"
count = 0
left_b_count = 0
right_a_count = 0
none_count = 0
for string in string_list:
    if string.count(target_chr) > 0 and (string[0] != "B" or string[-1] != "A"):
        count += string.count(target_chr)
        none_count += 1
        continue
    if string[0] == "B":
        left_b_count +=1
        count += string.count(target_chr)
        none_count += 1
        continue
    if string[-1] == "A":
        right_a_count += 1
        count += string.count(target_chr)
        none_count += 1
        continue

if left_b_count > right_a_count:
    if none_count == n:
        print(count + right_a_count)
    else:
        print(count + right_a_count + 1)
else:
    print(count + left_b_count)

### FIXED CODE ###

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

print(n - k + 1)
#!/bin/python3
mod=10**9+7
from math import gcd
h,w,t=map(int,input().split())
gh,gw=gcd(h,t),gcd(w,t)
h1,w1=h//gh,w//gw
print(
		pow(
			pow(2,w1,mod)+
			pow(2,h1,mod)+
			(mod-1)+
			pow(2,gcd(h1,w1),mod)+mod-2
			,gh*gw,mod)
		)


### FIXED CODE ###

mod=10**9+7
from fractions import gcd
h,w,t=map(int,input().split())
gh,gw=gcd(h,t),gcd(w,t)
h1,w1=h//gh,w//gw
print(
		pow(
			pow(2,w1,mod)+
			pow(2,h1,mod)+
			(mod-1)+
			pow(2,gcd(h1,w1),mod)+mod-2
			,gh*gw,mod)
		)
def main():
    N = int(input())
    AC = 0
    WA = 0
    TLE = 0
    RE = 0
    for i in range(N):
        St = input()
        if St == 'AC':
            AC += 1
        elif St == 'WA':
            WA += 1
        elif St == 'TLE':
            TLE += 1
        elif St == 'RE':
            RE += 1
        else:

    print('AC x ' + str(AC))
    print('AC x ' + str(WA))
    print('AC x ' + str(TLE))
    print('AC x ' + str(RE))
main()

### FIXED CODE ###

def main():
    N = int(input())
    AC = 0
    WA = 0
    TLE = 0
    RE = 0
    for i in range(N):
        St = input()
        if St == 'AC':
            AC += 1
        elif St == 'WA':
            WA += 1
        elif St == 'TLE':
            TLE += 1
        elif St == 'RE':
            RE += 1
        else:
            Er += 1
    print('AC x', AC)
    print('WA x', WA)
    print('TLE x', TLE)
    print('RE x', RE)
main()
import sys
import math
from statistics import mean
from functools import reduce, lru_cache
from itertools import permutations


@lru_cache()
def distance(p1, p2):
    return math.sqrt(sum([(a - b) ** 2 for a, b in zip(p1, p2)]))


def distances(arr):
    return [distance(arr[i], arr[i+1]) for i in range(len(arr)-1)]


def main(n: int, points: list):
    ret = []
    for x in permutations(points):
        ret.append(mean(distances(x)))

    print(mean(ret))


if __name__ == '__main__':
    a = []
    while True:
        l = input()
        if l:
            a.append(l)
        else:
            break

    args = '\n'.join(a)
    points = [s.split(' ') for s in a[1:]]

    main(
        int(a[0]),
        [(int(p[0]), int(p[1])) for p in points]
    )


### FIXED CODE ###

import sys
import math
from statistics import mean
from functools import reduce, lru_cache
from itertools import permutations


@lru_cache()
def distance(p1, p2):
    return math.sqrt(sum([(a - b) ** 2 for a, b in zip(p1, p2)]))


def distances(arr):
    return [distance(arr[i], arr[i+1]) for i in range(len(arr)-1)]


def main(n: int, points: list):
    ret = []
    for x in permutations(points):
        ret.append(sum(distances(x)))

    print(mean(ret))


if __name__ == '__main__':
    n = int(input())
    a = [input() for i in range(n)]

    points = [s.split(' ') for s in a]

    main(
        n,
        [(int(p[0]), int(p[1])) for p in points]
    )
a,b,c = map(input().split(), int)
2.if a+c == 2*b:
3.    print('YES')
4.else:
5.    print('NO')


### FIXED CODE ###

a,b,c = map(int,input().split())
if a+c == 2*b:
	print('YES')
else:
	print('NO')
N = int(input())
SP = [list(map(int, input().split())) for i in range(N)]

sorted_SP = sorted(SP, key=lambda x:x[1], reverxe=True)
sorted_SP = sorted(sorted_SP, key=lambda x:x[0])

for i in range(N):
  for j in range(N):
    if SP[i][0] == SP[j][0] and SP[i][1] == SP[j][1]:
      print(j+1)
      break


### FIXED CODE ###

N = int(input())
SP = [list(input().split()) for i in range(N)]

sorted_SP = sorted(SP, key=lambda x:int(x[1]), reverse=True)
sorted_SP = sorted(sorted_SP, key=lambda x:x[0])

for i in range(N):
  for j in range(N):
    if sorted_SP[i][0] == SP[j][0] and sorted_SP[i][1] == SP[j][1]:
      print(j+1)
      break
n,a,b=map(int,input().split())
print('Hello World' if n==1 else a+b)

### FIXED CODE ###

n=int(input())
if n==1:
  print('Hello World')
else:
  a=int(input());b=int(input())
  print(a+b)
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
check_lst = [False] * N
lst = [[] for _ in range(N)]
for _ in range(N + M - 1):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    lst[A].append(B)
    check_lst[B] = True
# print (lst)

ans_lst = [[-1, 0] for _ in range(N)] #[親, 距離]を要素とするリスト
#根を求める = どこからも辺が伸びていないところ --> check_lst = Falseの場所
n = check_lst.index(False)
ans_lst[n][0] = -1
# print (n)

def dfs(i): #iからの経路を探す
    distance = ans_lst[i][1]
    for j in lst[i]:
        # print (j)
        if distance + 1 > ans_lst[j][1]:#距離が最長となるとき
            ans_lst[j][0] = i
            ans_lst[j][1] = distance + 1
            dfs(j)
    return 

dfs(n)
# print (ans_lst)

# print ('以下答え')
for i, d in ans_lst:
    print (i + 1)


### FIXED CODE ###

import sys
# from heapq import heappop, heappush
from collections import deque
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

N, M = map(int, input().split())
check_lst = [0] * N
lst = [[] for _ in range(N)]
for _ in range(N + M - 1):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    lst[A].append(B)
    check_lst[B] += 1

n = check_lst.index(0)
ans = [0] * N
que = deque()
que.append(n)
while que:
    v = que.popleft()
    for v2 in lst[v]:
        check_lst[v2] -= 1
        if check_lst[v2] == 0:
            que.append(v2)
            ans[v2] = v + 1
print (*ans, sep = '\n')
L, R = map(int, input().split())

mod = []
if R+1-L<=2019:
    for i in range(L,R):
        for j in range(i+1,R+1):
            mod.append((i*j)%2019)

else:
    for i in range(L, L+2019):
        for j in range(i, L+2019+1):
            mod.append((i*j)%2019)


if len(mod)==0:
    print((L*R)%2019)
else:
    print(min(mod))


### FIXED CODE ###

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

if N*A < B:
    print(N*A)
else:
    print(B)