Harryxun/stf_run huggingface dataset:
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(n)]
x=[xy[i][0] for i in range(n)]
y=[xy[i][1] for i in range(n)]

for i in range(n-k):
    x=[xy[i][0] for i in range(n-i)]
    y=[xy[i][1] for i in range(n-i)]
    xl = min(x)
    xr = max(x)
    yl = min(y)
    yr = max(y)

    xr2 = sorted(x)[-2]
    xl2 = sorted(x)[0]
    yr2 = sorted(y)[-2]
    yl2 = sorted(y)[0]

    res1 = (xl2-xl)*(yr-yl)
    res2 = (xr-xr2)*(yr-yl)
    res3 = (yl2-yl)*(xr-xl)
    res4 = (yr-yr2)*(xr-xl)
    if max(res1,res2,res3,res4) ==res1:
        xy.pop(x.index(xl))
    elif max(res1,res2,res3,res4) ==res2:
        xy.pop(x.index(xr))
    elif max(res1,res2,res3,res4) ==res3:
        xy.pop(x.index(yl))
    elif max(res1,res2,res3,res4) ==res4:
        xy.pop(x.index(yr))

x=[xy[i][0] for i in range(k)]
y=[xy[i][1] for i in range(k)]
xl = min(x)
xr = max(x)
yl = min(y)
yr = max(y)
print((xr-xl)*(yr-yl))

### FIXED CODE ###

n,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(n)]
x=[xy[i][0] for i in range(n)]
y=[xy[i][1] for i in range(n)]
res = 10**20
for i in range(n):
    xl = xy[i][0]
    for j in range(n):
        xr = xy[j][0]
        if xr<xl:continue
        for p in range(n):
            yl = xy[p][1]
            for q in range(n):
                yr = xy[q][1]
                if yr<yl:continue
                tres = 0
                for sxy in xy:
                    if sxy[0] >= xl and sxy[0] <= xr and sxy[1] >= yl and sxy[1] <= yr:
                        tres += 1
                if tres >= k:
                    res = min(res,(xr-xl)*(yr-yl))
print(res)
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
    if A<=(i//10)+(i%10) and (i//10)+(i%10)<=B:
        ans+=i
print(ans)

### FIXED CODE ###

import itertools
K,S = map(int,input().split())
ans = 0
for i,j in itertools.product(range(K+1),range(K+1)):
    if 0<=S-i-j and S-i-j<=K:
        ans+=1
print(ans)
A, B = map(int,input())
ab = A*B
if ab % 2 == 0:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

A, B = map(int,input().split())
ab = A*B
if ab % 2 == 0:
    print('No')
else:
    print('Yes')
import math
def main():
    N, K = map(int, input().split())
    if N % K == 0:
        print(math.ceil(math.log(N,K))+1)
    else:
        print(math.ceil(math.log(N,K)))


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    K, R = map(int, input().split())

    if K >=10:
        print(R)
    else:
        print(R + 100*(10-K))

if __name__ =='__main__':
    main()
n = input()
b = 0
s = 0
for i in n:
    if i%3 == 0 or i%5 == 0:
        continue
    else:
        s += i
        
print(s)

### FIXED CODE ###

n = int(input())
b = 0
s = 0
for i in range(1,n+1):
    if i%3 == 0 or i%5 == 0:
        continue
    else:
        s += i
        
print(s)
w,h,x,y,r=map(int,raw_input().split())

f=0
if x+r>w:
    f=1
if y+r>h:
    f=1
if r>x:
    f=1
if r>y:
    f=1
if f==0:
    print "Yes"
else print "No"

### FIXED CODE ###

w,h,x,y,r=map(int,raw_input().split())

f=0
if x+r>w:
    f=1
if y+r>h:
    f=1
if r>x:
    f=1
if r>y:
    f=1
if f==0:
    print "Yes"
else:
    print "No"
def input():
    return sys.stdin.readline()[:-1]
a, b= input().split()
a = int(a)
b = int(b.replace(".", ""))
# floatをそのまま掛け算すると大きい計算で誤差が生じるため、.を消してintにする。
output = a * b // 100
# 小数点は2桁までで確定なので、100で切り捨て除算する。
print(output)

### FIXED CODE ###

a,b = map(int, input().split())
c = a * b
print(c)
import copy

mas_num = int(input())
h = list(map(int, input().split()))
c = copy.copy(h)
d = copy.copy(h)
c.pop(0)
d.pop(0)
d.pop(0)

if h[-2] - 1 > h[-1]:
    print('No')
else:
    for i,j,k in zip(h, c, d):
        if i - 1 > j:
            print('No')
            break
        else:
            if i - 1 > k:
                print('No')
                break
            else:
                print('Yes')
                break

### FIXED CODE ###

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

ans = "Yes"

if n != 1:
  for i in range(n-1):
    if h[i]-1>h[i+1]:
      ans = "No"
      break
    elif h[i]-1==h[i+1]:
      h[i+1] += 1
      
print(ans)
s = input()
if s[0] = "S": print("Cloudy")
if s[0] = "C": print("Rainy")
else: print("Sunny")

### FIXED CODE ###

s = input()
if s[0] == "S": print("Cloudy")
elif s[0] == "C": print("Rainy")
else: print("Sunny")
N = int(input())
T = [[0,0,0]]+[map(int, input().split()) for _ in range(N)]
flag = 'Yes'
i = 0
for i in range(len(T)-1):
    t1,x1,y1 = T[i] 
    t2,x2,y2 = T[i+1]
    dis = abs(x2-x1)+abs(y2-y1)
    _t = t2-t1
    if dis > _t or _t%2 != dis%2:
        flag = 'No'
    else:
        flag = 'Yes'
    if not flag:
        break
    i += 1        
print(flag)
    

### FIXED CODE ###

N = int(input())
T = [[0,0,0]]+[ [int(x) for x in input().split()] for _ in range(N)]

flag = 'Yes'
i = 0
while flag=='Yes' and i<len(T)-1:
    t1,x1,y1 = T[i] 
    t2,x2,y2 = T[i+1]
    dis = abs(x2-x1)+abs(y2-y1)
    _t = t2-t1
    if dis > _t or _t%2 != dis%2:
        flag = 'No'
    i += 1        
print(flag)
n = int(input())
m = int(input())

a = (n - 1) * (m - 1)

print(a)

### FIXED CODE ###

n, m = map(int, input().split())
print((n-1)*(m-1))
N = int(input())
M = 'abcdefghijklmnopqrstuvwxyz'
L = []
res = ''

while(N>=26):
    N -= 1
    m = N % 26
    N = N // 26
    L = [m] + L

L = [N-1] + L

for m in L:
    res += M[m]
print(res)

### FIXED CODE ###

import re

t = input()

pattern = r'[a-z]'

repattern = re.compile(pattern)

result = repattern.match(t)

if result:
    print('a')
else:
    print('A')
def main():
    word = list(input())
    operation = int(input())
    cost = {}
    for i in range(26):
        cost[chr(ord("a") + i)] = ord("z") - ord("a") - i + 1
    for i in range(len(word)):
        if cost[word[i]] <= operation:
            operation -= cost[word[i]]
            word[i] = "a"
        else:
            continue
    if 0 < operation:
        for i in range(-1, -len(word)-1, -1):
            word[i] = chr(ord(word[i]) + operation)
            operation = 0
            break
    print("".join(word))


if __name__ == '__main__':
    main()



### FIXED CODE ###

def main():
    word = list(input())
    operation = int(input())
    cost = {}
    for i in range(26):
        cost[chr(ord("a") + i)] = ord("z") - ord("a") - i + 1
    for i in range(len(word)):
        if cost[word[i]] <= operation and word[i] != "a":
            operation -= cost[word[i]]
            word[i] = "a"
        else:
            continue
    if 0 < operation:
        word[-1] = chr((ord(word[-1]) - ord("a") + operation % 26) % 26 + ord("a"))
    print("".join(word))


if __name__ == '__main__':
    main()
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
        ans=a.index(4)+4
if s==1 or s==2:
    print(4)
else:
    print(ans)

### FIXED CODE ###

s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
if s==1 or s==2:
    print(4)
else:
    print(a.index(4)+4)
N = int(input)
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)

### FIXED CODE ###

N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)
len_s=len(s)
len_t=len(t)

s="@"+s
t="_"+t


dp=[ [ 0 for j in range(len_t+1) ] for i in range(len_s+1)   ]
S=[ [ "" for j in range(len_t+1) ] for i in range(len_s+1)   ]

for i in range(1,len_s+1):
	for j in range(1,len_t+1):
		if s[i]==t[j]:
			dp[i][j]=dp[i-1][j-1]+1
			S[i][j]=S[i-1][j-1]+s[i]
		else:			
			dp[i][j]=max( dp[i-1][j] , dp[i][j-1] )
			if dp[i-1][j]>=dp[i][j-1]:
				S[i][j]=S[i-1][j]
			else:
				S[i][j]=S[i][j-1]


print S[-1][-1]


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
s=raw_input()
t=raw_input()

len_s=len(s)
len_t=len(t)

s="@"+s
t="_"+t


dp=[ [ 0 for j in range(len_t+1) ] for i in range(len_s+1)   ]
S=""
l=0

for i in range(1,len_s+1):
	for j in range(1,len_t+1):
		if s[i]==t[j]:
			dp[i][j]=dp[i-1][j-1]+1
		else:			
			dp[i][j]=max( dp[i-1][j] , dp[i][j-1] )


ans=""
def lcs(i,j):
	global ans
	if dp[i][j]==0:
		return
	else:
		if s[i]==t[j]:
			lcs(i-1,j-1)
			ans+=s[i]
		else:
			if dp[i-1][j]>=dp[i][j-1]:
				lcs( i-1, j )
			else:
				lcs( i, j-1)

lcs(len_s, len_t)
print ans
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    H, A = read_int_list()
    res = 0
    for i in range(n):
      H = H - A
      res += 1
      if H <= 0:
        break
    print(res)


main()


### FIXED CODE ###

import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    H, A = read_int_list()
    res = 0
    for i in range(10001):
      H = H - A
      res += 1
      if H <= 0:
        break
    print(res)


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

print(len(set(s)))

### FIXED CODE ###

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

print(len(set(s)))
n = int(input())
a = list(map(int, input().split()))
s, ans, i = 0, 0, 0
while a[i] == 0 and i < n:
    ans += 2
    i += 1
ans = max(0, ans - 1)
if i == n:
    print(ans)
    exit()

if ans > 0:
    if abs(a[i]) == 1:
        ans += 1
        s = a[i] // abs(a[i])
else:
    s = a[0]

i += 1
for j in range(i, n):
    if abs(a[j]) > abs(s) and (a[j] == abs(a[j])) != (s == abs(s)):
        s += a[j]
    else:
        pre_s = s
        s = -1 * s // abs(s)
        ans += abs(a[j] - s + pre_s)

print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans1, ans2 = 0, 0
s = 0
plus = True
for i in range(n):
    if plus:
        if s + a[i] > 0:
            s += a[i]
        else:
            ans1 += abs(1 - (s + a[i]))
            s = 1
    if not plus:
        if s + a[i] < 0:
            s += a[i]
        else:
            ans1 += abs(-1 - (s + a[i]))
            s = -1
    plus = not plus

s = 0
plus = False
for i in range(n):
    if plus:
        if s + a[i] > 0:
            s += a[i]
        else:
            ans2 += abs(1 - (s + a[i]))
            s = 1
    if not plus:
        if s + a[i] < 0:
            s += a[i]
        else:
            ans2 += abs(-1 - (s + a[i]))
            s = -1
    plus = not plus
print(min(ans1, ans2))
a,b = map(int,input()split())
print(a/b)

### FIXED CODE ###

a,b = map(int,input().split())
print(a/b)
n,m=map(int,input().split())
A=[[0 for j in range(m)]for i in range(n)]
B=[[0 for j in range(1)]for i in range(m)]
C=[[0 for j in range(1)]for i in range(n)]
for i in range(n):
  A1,A2,A3,A4=map(int,input().split())
  A[i][0]=A1
  A[i][1]=A2
  A[i][2]=A3
  A[i][3]=A4
for i in range(m):
  B[i][0]=int(input())
S=int(0)
for j in range(n):
  for i in range(m):
    S=S+(A[j][i]*B[i][0])
  C[j][0]=S3
for i in range(n):
  print(C[j][0])


### FIXED CODE ###

#ITP1_6_D
n,m=map(int,input().split())
A=[[0 for j in range(m)]for i in range(n)]
B=[[0 for j in range(1)]for i in range(m)]
C=[[0 for j in range(1)]for i in range(n)]
for i in range(n):
  D=list(map(int,input().split()))
  for j in range(m):
    A[i][j]=D[j]
for i in range(m):
  B[i][0]=int(input())
S=int(0)
for j in range(n):
  for i in range(m):
    S=S+(A[j][i]*B[i][0])
  C[j][0]=S
  S=0
for i in range(n):
  print(C[i][0])
import math

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

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

print(lcm(A, B))


### FIXED CODE ###

A = int(input())
B = int(input())

print(6 - A - B)
n = int(input())
if n % 2 == 0:
    print((n / 2) / n)
elif:
    print(((n + 1) / 2) / n)
    
    

### FIXED CODE ###

n = int(input())
print((n // 2 + n % 2) / n)
n, m, l = map(int, input().split())
A = [[int(n) for n in input().split()] for i in range(n)]
B = [[int(n) for n in input().split()] for i in range(m)]
C = [[0 for i in range(l)] for i in range(n)]
for i in range(l):
    for j in range(n):
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]
for i in range(n):
    for j in range(l):
        if j == l - 1:
            print(C[i][j])
        else:
            print(C[i][j], end = " ")

### FIXED CODE ###

n, m, l = map(int, input().split())
a = [[int(num) for num in input().split()] for i in range(n)]
b = [[int(num) for num in input().split()] for i in range(m)]
c = [[0 for i in range(l)] for j in range(n)]
for i in range(n):
    for j in range(l):
        for k in range(m):
            c[i][j] += a[i][k] * b[k][j]
for i in range(n):
    for j in range(l):
        if j == l - 1:
            print(c[i][j])
        else:
            print(c[i][j], end=" ")
X = int(input())

for a in range(-118, 119):
  for b in range(-118, 119):
    Y = a ** 5 - b ** 5
    if Y == X:
      A = a
      B = b
      break
    else:
      continue
      
print(A, B)


### FIXED CODE ###

X = int(input())

for a in range(-500, 500):
  for b in range(-500, 500):
    Y = a ** 5 - b ** 5
    if Y == X:
      A = a
      B = b
      break
      
print(A, B)
r=input()
print(r*r)

### FIXED CODE ###

r=int(input())
print(r**2)
H,W,N=map(int,input().split())
ans=W
Y=[0]*W
ob=[float("inf")]*W
for i in range(N):
  x,y=map(int,input().split())
  ob[x-1]=min(ob[x-1],y-1)
for i in range(1,W):
  if ob[i]==Y[i-1]+1:
    Y[i]=Y[i-1]
  else:
    Y[i]=Y[i-1]+1
for i in range(1,W):
  if ob[i]<=Y[i]:
    ans=min(ans,i)
print(ans)


### FIXED CODE ###

H,W,N=map(int,input().split())
ans=H
Y=[0]*H
ob=[float("inf")]*H
for i in range(N):
  x,y=map(int,input().split())
  ob[x-1]=min(ob[x-1],y-1)
for i in range(1,H):
  if ob[i]==Y[i-1]+1:
    Y[i]=Y[i-1]
  else:
    Y[i]=Y[i-1]+1
for i in range(1,H):
  if ob[i]<=Y[i]:
    ans=min(ans,i)
print(ans)
n=int(input())
k=0
b=0
for i in range(n):
  x,u=input().split()
  x=float(x)

for i in range(n):
  if u[i]=='JPY':
    k+=x[i]
  else:
    b+=x[i]*380000
print(k+b)


### FIXED CODE ###

n=int(input())
x=[0]*n
u=[0]*n
k=0
b=0
for i in range(n):
  x[i],u[i]=map(str,input().split())
  x[i]=float(x[i])

for i in range(n):
  if u[i]=='JPY':
    k+=x[i]
  else:
    b+=x[i]
    
b=b*380000
print(k+b)
h, n = map(int, input().split())
dp = [10 ** 9] * (h+1)
dp[0] = 0

for ni in range(n):
  a, b = map(int, input().split())
  for hi in range(h):
    nj = min(j+a, h)
    dp[nj] = min(dp[nj], dp[j] + b)

print(dp[h])

### FIXED CODE ###

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

count = 0
while True:
    h -= a
    count += 1
    if h <= 0:
        break
print(count)
strings = input().splitlines()

# 一致している数の最大値を取得する。
# そして、その一致している数と、Tの数を比較する。足りない文字数を補うと良い

strS = list(strings[0])
strT = list(strings[1])

maxRange = 0
l = 0
while l < (len(strS)-len(strT)):
    m = 0
    count = 0
    while m < (len(strT)):
        if strS[l+m] == strT[m]:
            count += 1
        m += 1
    if maxRange < count:
        maxRange = count
    l += 1
print(len(strT)-maxRange)





### FIXED CODE ###

dts = input().split()
D = int(dts[0])
T = int(dts[1])
S = int(dts[2])

if T*S >= D:
    print("Yes")
else:
    print("No")
import sys
import math
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, K = map(int, input().split())
    ans = 0.0

    for i in range(1, N+1):
        c = 0
        if i < K:
            c = math.ceil(math.log2(K) - math.log2(i))
        # print(i, c, (1.0 / (2 ** c)), 1.0/N)
        ans += (1.0 / (2 ** c)) * 1.0/N

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import math
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, K = map(int, input().split())
    ans = 0.0

    for i in range(1, N+1):
        c = 0
        if i < K:
            c = math.ceil(math.log2(K) - math.log2(i))
        # print(i, c, (1.0 / (2 ** c)), 1.0/N)
        ans += (1.0 / (2 ** c)) * 1.0/N

    print("{0:.20f}".format(ans))


if __name__ == '__main__':
    main()
import sys

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

for i in range(int(math.sqrt(M))+1, 1, -1):
    if M % i == 0:
        if M >= N*i:
            print(i)
            sys.exit()

### FIXED CODE ###

import sys
import math
Input = sys.stdin.readline
 
N, M = map(int, Input().split())
D = []
 
for i in range(int(math.sqrt(M)), 0, -1):
    if M % i == 0:
      D.append(i)
      D.append(M // i)

D.sort(reverse=True)
for d in D:
    if M >= N*d:
        print(d)
        break
import sys

inp = [int(x) for x in sys.stdin.readline()]; ii = 0

rows, cols, k = inp[ii:ii+3]; ii += 3
items = [[] for _ in range(rows+1)]
best = [0]*(cols+1)
for _ in range(k):
	inp[ii:ii+3]; ii += 3
	items[r].append([c, v])
for i in range(rows+1):
	items[i].sort()
ans = 0
for r in range(1, rows+1):
	dp = []
	best1, best2 = 0, 0
	Row = items[r]
	for c, v in Row:
		v1 = best[c] + v
		v2 = best1 + v
		v3 = best2 + v
		V = v1
		if V < v2:
			V = v2
		if V < v3:
			V = v3
		dp.append(V)
		if v1 > best1:
			best1 = v1
		if v2 > best2:
			best2 = v2
		if ans < V:
			ans = V
	for j in range(len(dp)):
		if best[Row[j][0]] < dp[j]:
			best[Row[j][0]] = dp[j]
	for j in range(2, cols+1):
		if best[j] < best[j-1]:
			best[j] = best[j-1]
print(ans)


### FIXED CODE ###

rows, cols, k = map(int, input().split())
items = [[] for _ in range(rows+1)]
best = [0]*(cols+1)
for _ in range(k):
	r, c, v = map(int, input().split())
	items[r].append([c, v])
for i in range(rows+1):
	items[i].sort()
ans = 0
for r in range(1, rows+1):
	dp = []
	best1, best2 = 0, 0
	Row = items[r]
	for c, v in Row:
		v1 = best[c] + v
		v2 = best1 + v
		v3 = best2 + v
		V = max(v1, v2, v3)
		dp.append(V)
		if v1 > best1:
			best1 = v1
		if v2 > best2:
			best2 = v2
		if ans < V:
			ans = V
	for j in range(len(dp)):
		if best[Row[j][0]] < dp[j]:
			best[Row[j][0]] = dp[j]
	for j in range(2, cols+1):
		if best[j] < best[j-1]:
			best[j] = best[j-1]
print(ans)
N, K, L = map(int, input().split())
road = [{"Connected":[],"seen":False,"set":0} for _ in range(N)]
rail = [{"Connected":[],"seen":False,"set":0} for _ in range(N)]

def dfs(graph, v, index): #深さ優先探索
    graph[v]["seen"] = True
    graph[v]["set"] = index
    for next_v in graph[v]["Connected"]:
        if graph[next_v]["seen"]:
            continue
        dfs(graph, next_v, index)

for X in ((road, K), (rail, L)): #結合を入力
    for _ in range(X[1]):
        p, q = map(int, input().split())
        X[0][p-1]["Connected"].append(q-1)
        X[0][q-1]["Connected"].append(p-1)

for X in (road, rail): #探索して連結成分に分解
    set_index = 0
    for v in range(N):
        if X[v]["seen"]:
            continue
        dfs(X, v, set_index)
        set_index += 1
        
List = [(road[i]["set"],rail[i]["set"]) for i in range(N)]
D = {}
for X in List:
    if not X in D:
        D[X] = 1
    else:
        D[X] += 1
for A in List:
    print(D[A],end=" ")
        


### FIXED CODE ###

N, K, L = map(int, input().split())

def fp(x, parentList): #findParent
    if parentList[x] == x:
        return x
    else:
        parentList[x] = fp(parentList[x], parentList)
        return parentList[x]

#各ノードのparentをリストで表現(連結前は自身がparent)
road = [i for i in range(N)]
rail = [i for i in range(N)]

for _ in range(K):
    p, q = map(int, input().split())
    par_p, par_q = fp(p-1, road), fp(q-1, road) #p, qのparent 
    #連結する際、若い番号をparentとする
    if par_p < par_q:
        road[par_q] = par_p
    else:
        road[par_p] = par_q

#railについても同様
for _ in range(L):
    s, t = map(int, input().split())
    par_s, par_t = fp(s-1, rail), fp(t-1, rail)
    if par_s < par_t:
        rail[par_t] = par_s
    else:
        rail[par_s] = par_t

#連結成分の要素をカウント
cnt = {}
for i in range(N):
    key = (fp(i,road),fp(i,rail))
    if key in cnt:
        cnt[key] += 1
    else:
        cnt[key] = 1
#出力
for i in range(N):
    key = (fp(i,road),fp(i,rail))
    ans = cnt[key]
    print(ans, end=" ")
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A

#B

#C
n,m = LI()
v = [[] for i in range(n)]
for i in raneg(m):
    a,b = LI()
    a -= 1
    b -= 1
    v[a].append(b)
    v[b].append(a)
bfs_map = [-1 for i in range(n)]
bfs_map[0] = 0
q = deque()
q.append(0)
while q:
    x = q.pop()
    for y in v[x]:
        if bfs_map[y] == -1:
            bfs_map[y] = bfs_map[x] + 1
if bfs_map[y] <= 2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A

#B

#C
def dijkstra():
    d[0] = 0
    q = [[0,0]]
    while q:
        dx, x = heappop(q)
        for y in v[x]:
            if d[y] > dx+1:
                d[y] = dx+1
                heappush(q,[d[y],y])
n,m = LI()
v = [[] for i in range(n)]
for i in range(m):
    a,b = LI()
    a -= 1
    b -= 1
    v[a].append(b)
    v[b].append(a)
d = [float("inf") for i in range(n)]
dijkstra()
if d[n-1] <= 2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T
n, a = map(int, input().split())
x = list(map(int, input().split()))
X = max(max(x), a)
dp = [[[0] * (n * X + 1) for i in range(n + 1)] for j in range(n + 1)]
dp[0][0][0] = 1
for i in range(1, n + 1):
    for j in range(n + 1):
        for s in range(n * X + 1):
            if s < x[i - 1]:
                dp[i][j][s] = dp[i - 1][j][s]
            elif j >= 1 and x[i - 1] <= s:
                dp[i][j][s] = dp[i - 1][j][s] + dp[i - 1][j - 1][s - x[i - 1]]

num = 0
for i in range(1, n + 1):
    num += dp[n][i][i * a]

print(num)

### FIXED CODE ###

n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(min(k, n) * x + max(0, n - k) * y)