Harryxun/stf_run huggingface dataset:
import numpy as np
W,H,x,y = map(int, input().split())

d_center_W = abs(W/2 - x)
d_center_H = abs(H/2 - y)
d_45_plus =  abs((H/W)*x-1*y)/np.sqrt((H/W)**2+(-1)**2)
d_45_minus = abs((H/W)*x+y-H)/np.sqrt((H/W)**2+1**2)

min_d = min(d_center_W,d_center_H,d_45_plus,d_45_minus)
smflg = False

if [d_center_W,d_center_H,d_45_plus,d_45_minus].count(min_d) > 1:
        smflg = True

ans = 0

if min_d == d_center_W:
        if x <= W/2:
                ans = x*H/1
        else:
                ans = (W-x)*H/1
elif min_d == d_center_H:
        if y <= H/2:
                ans = y*W/1
        else:
                ans = (H-y)*W/1
elif min_d == d_45_plus:
        # if x == 0:
        #         ans = (H-(y-(H/W)*x))*(W-(W/H)*y+x)/2
        if y/x >= H/W:
                ans = (H-(y-(H/W)*x))*(W-(W/H)*y+x)/2
        else:
                ans = (H-(x-(W/H)*y))*(H+y-(W/H)*x)/2
elif min_d == d_45_plus:
        if x <= W/2:
                x += (W/2-x)*2
        else:
                x -= (x-W/2)*2
        if x == 0:
                ans = (H-(y-(H/W)*x))*(W-(W/H)*y+x)/2
        elif y/x >= H/W:
                ans = (H-(y-(H/W)*x))*(W-(W/H)*y+x)/2
        else:
                ans = (H-(x-(W/H)*y))*(H+y-(W/H)*x)/2
if smflg:
        smstr = '1'
else:
        smstr = '0'

if H == 1 and W == 1:
        ans = 1/2

print(str(ans) + ' ' + smstr)


### FIXED CODE ###

W,H,x,y = map(int, input().split())
print(W*H/2)
if x == W/2 and y == H/2:
    print(1)
else:
    print(0)
def frog():
    n = int(input())
    h_list = list(map(int, input().split()))

    dp = [0] * 100

    for n_element in range(n):
        if n_element >= 2:
            dp[n_element] = min(dp[n_element - 1] + abs(h_list[n_element] - h_list[n_element - 1]),
                                dp[n_element - 2] + abs(h_list[n_element] - h_list[n_element - 2]))
        elif n_element == 1:
            dp[n_element] = abs(h_list[n_element] - h_list[n_element - 1])
        else:
            dp[n_element] = 0

    print(dp[n - 1])


if __name__ == "__main__":
    frog()


### FIXED CODE ###


def frog():
    n = int(input())
    h_list = list(map(int, input().split()))

    dp = [0] * 10 ** 5

    for n_element in range(n):
        if n_element >= 2:
            dp[n_element] = min(dp[n_element - 1] + abs(h_list[n_element] - h_list[n_element - 1]),
                                dp[n_element - 2] + abs(h_list[n_element] - h_list[n_element - 2]))
        elif n_element == 1:
            dp[n_element] = abs(h_list[n_element] - h_list[n_element - 1])
        else:
            dp[n_element] = 0

    print(dp[n - 1])


if __name__ == "__main__":
    frog()
s=input()
n=s
 
if s==reversed(s) and s[0:(n-1)//2]==reverses(s[0:(n-1)//2]) and s[((n+3)//2)-1:n]==reversed(s[((n+3)//2)-1:n]):
print("Yes")
 
else:
	print("No")

### FIXED CODE ###

s = input()
n = len(s)
sl = s[:n//2]
sr = s[n//2+1:]
if sl == sr and sr ==  sr[::-1]:
    print('Yes')
else:
    print('No')
n,m = map(int,input().split())
P = list(map(int,input().split()))

uf = {i+1:i+1 for i in range(1,n+1)}

def get_parent(i):
  lst = []
  while uf[i] != i:
    lst.append(i)
    i = uf[i]
  for l in lst[:-1]:
    uf[l] = i
  return i

def unite(uf,i,j):
  p = get_parent(i)
  uf[get_parent(j)] = p

def same(i,j):
  return get_parent(i) == get_parent(j)

for _ in range(m):
  x,y = map(int,input().split())
  unite(x,y)

ans = 0
for i in range(1,n+1):
  ans += int(same(P[i-1],uf[i]))
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
P = list(map(int,input().split()))
uf = {i:-1 for i in range(1,n+1)}

def get_p(i):
  while uf[i] != i:
    if uf[i] == -1:
      return i
    i = uf[i]
  return i

for _ in range(m):
  x,y = map(int,input().split())
  if x > y:
    x,y = y,x
  if uf[x]== uf[y] == -1:
    uf[x] = x
    uf[y] = x
  elif uf[x] != -1 and uf[y] != -1:
    p = get_p(x)
    uf[x] = p
    index = y
    while index != uf[index]:
      index = uf[y]
      uf[y] = p
      y = index
    else:
      uf[index] = p
  else:
    if uf[x] == -1:
      p = get_p(y)
    else:
      p = get_p(x)
    uf[x] = p
    uf[y] = p

ans = 0  
for i, p in enumerate(P):
  if get_p(i+1) == get_p(p):
    ans += 1
print(ans)
n,k=map(int,input().split())
e=[0]*(k)
e[-2]=1
now=k
while now!=1:
  if now%2==0 and now!=2:
    now=now//2
    e[now-2]+=1
  elif now==2:
    now+=-1
    e[now-1]+=1
  else:
    now=now//2
    e[now-1]+=1
e_=[]
for i in range(k):
  if i==0:
    e_.append(e[k-1-i])
  else:
    e_.append(e[k-1-i]+e_[-1])   
ans=0    
if n<k:
  for i in range(n):
    ans+=((1/2)**e_[k-1-i])*(1/n)
  print(ans)  
else:
  for i in range(k):
    ans+=((1/2)**e_[k-1-i])*(1/n)
  ans+=(1/n)*(n-k)
  print(ans)


### FIXED CODE ###

n,k=map(int,input().split())
d=0
for a in range(1,n+1):
  b=0
  while a<k:
    b+=1
    a=a*2
  d+=(1/2)**b
print(d/n)
l, r = map(int, input().split())
ans = 2020
a = l // 2019
b = r // 2019
ans = []
# print(a)
# print(b) # 2019 num
if a != b:
    print(0)
else:
    for i in range(l, r+1):
        ans.append(i % 2019)
    
ans.sort()
print(ans[0] * ans[1])
    #l.append()
# print(a, b)


# if l // 2019 != r // 2019:
#     #print(0)
# else:
#     a = l % 2019
#     b = l % 2019 + 1
#     print(a * b)
#     # b = r % 2019
    

# if r - l >= 2019:
#     print(0)
# # else:
#     for i in range(l,r + 1):
#         for j in range(i+1,r + 1):
#             if (i * j) % 2019 <= ans:
#                 ans = min(ans, (i * j) % 2019)
#     print(ans)




    #print(i)

### FIXED CODE ###

l, r = map(int, input().split())
# 2019
if r - l >= 2019:
	print(0)

# この数の中に2019が含まれている．
# 2019 * 2019 - 2019 

else:
	ans = 10000
	for i in range(l, r + 1):
		for j in range(i + 1, r + 1):
			ans = min(ans, (i * j) % 2019)
	print(ans)
N = int(input())

if N % 2 == 0:
  print(N//2, N, N)
else:
  for i in range(1, N):
    if N < 4*i:
      n = 4*i - N
      break
  if n == 1:
    j, k = 2*N*i, 2*N*i
  else:
    if i % 3 == 0:
      j, k = 2*N*i//3, 2*N*i//3
    else:
      for x in range(10):
        flag = False
        for y in range(1, n//2+1):
          if ((N*i)%y==0) and ((N*i)%(n-y)==0):
            j = (N*i) // y
            k = (N*i) // (n-y)
            flag = True
            break
        if flag:
          break
        else:
          i += 1
          n += 4
  print(i, j, k)
    

### FIXED CODE ###

N = int(input())

if N % 2 == 0:
  print(N//2, N, N)
else:
  for i in range(1, N):
    if N < 4*i:
      n = 4*i - N
      break
  if n == 1:
    j, k = 2*N*i, 2*N*i
  else:
    if i % 3 == 0:
      j, k = 2*N*i//3, 2*N*i//3
    else:
      for x in range(100):
        flag = False
        for y in range(1, n//2+1):
          if ((N*i)%y==0) and ((N*i)%(n-y)==0):
            j = (N*i) // y
            k = (N*i) // (n-y)
            flag = True
            break
        if flag:
          break
        else:
          i += 1
          n += 4
  print(i, j, k)
N, A, B, C, D = map(int, input().split())
S = input()
S += '#'

a = np.zeros(N+1)
b = np.zeros(N+1)
a[A-1] = 1
b[B-1] = 1

for i in range(N-1):
    if a[i] == 1:
        if S[i+1] == '.':
            a[i+1] = 1
        if S[i+2] == '.':
            a[i+2] = 1
    if b[i] == 1:
        if S[i+1] == '.':
            b[i+1] = 1
        if S[i+2] == '.':
            b[i+2] = 1
if C < D:
    # B
    print('Yes' if a[C-1] and b[D-1] else 'No')
else:
    print('Yes' if a[C-1] and b[D-1] and '...' in S else 'No')

### FIXED CODE ###

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

if '##' in S[A-1:max(C, D)]:
    print('No')
elif C < D:
    print('Yes')
else:
    print('Yes' if '...' in S[B-2:D+1] else 'No')
N = int(input())
ans = 0
for i in range(1,N+1):
    if N % i == 0:
        temp = N // i - 1
        d,m = divmod(N,temp)
        if d != m:
            break
        else:
            ans += temp
print(ans)

### 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)
    return divisors

N = int(input())
divisors = make_divisors(N)
ans = 0
divisors.sort(reverse=True)
for x in divisors:
    if x > 1:
        temp = x - 1
        d,m = divmod(N,temp)
        if d != m:
            break
        else:
            ans += temp
print(ans)
from collections import Counter
from math import factorial
from scipy.special import comb
N,A,B = map(int,input().split())
V=list(map(int,input().split()))

V_C=Counter(V)

max_val=max(V)
CC=V_C[max_val]
if A<=CC<=B:
    ans=0
    for v in range(A,min(B,CC)+1):
        ans+=comb(CC,v)
    print(max_val)
    print(ans)
    exit()


tmp_sum=0
tmp_num=0

for key in sorted(V_C.keys(),reverse=True):
    val = V_C[key]
    assert tmp_num<A
    #追加しても大丈夫なら加える(加えないとAに行かないから加えないといけない)
    #ぎりAに届くように追加するのが良い
    if A<=tmp_num+val:
        rest=A-tmp_num
        tmp_num+=rest
        tmp_sum+=key*rest
        assert tmp_num==A
        print(tmp_sum/tmp_num)
        print(comb(val,rest))
        exit()
    else:
        tmp_num+=val
        tmp_sum+=key*val

assert 1==2


### FIXED CODE ###

from collections import Counter
from collections import Counter
N, A, B = (list)(map(int, input().split()))
v = (list)(map(int, input().split()))

v = sorted(v, reverse=True)

sel_list = v[:A]
max_ave = sum(sel_list)/A
print(max_ave)

c = Counter(v)


def comb(n, r):
    r = min(r, n-r)
    ret = 1
    for i in range(r):
        ret *= (n-i)/(i+1)
    return ret


def ave_n(n):
    sel_list = v[:n]
    ave = sum(sel_list)/i
    if ave != max_ave:
        return 0
    last = sel_list[-1]
    use_last = sel_list.count(last)
    return comb(c[last], use_last)


ans = 0
for i in range(A, B+1):
    ret = ave_n(i)
    if ret == 0:
        break
    else:
        ans += ret
print((int)(ans))
3 2 3


### FIXED CODE ###

P, Q, R = map(int, input().split())
print(min(P + Q, Q + R, R + P))
for _ in range(int(input())):
  a,b,c,d=map(int,input().split())
  print(max(a*c,a*d,b*d,b*c))


### FIXED CODE ###

a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*d,b*c))
p=int(input())
ans=1
ar=[map(int,input().split())]
if 0 in ar:ans=0
else:
    for i in range(p):
        if ans<1e18:ans*=ar[i]
        else:ans=-1;break
    
print(ans,end='')

### FIXED CODE ###

p=int(input())
ans=1
ar=list(map(int,input().split()))
if 0 in ar:ans=0
else:
    for i in range(p):
        if ans<1e18:ans*=ar[i]
        else:ans=-1;break
if ans>1e18:ans=-1
print(ans,end='')
S=input()
week[S]={'SUN':[0],
      'MON':[1],
      'TUE':[2],
      'WED':[3],
      'THU':[4],
      'FRI':[5],
      'SAT':[6],}
print(7-week[S])


### FIXED CODE ###

s = input()
week = {'SUN':0,
        'MON':1,
        'TUE':2, 
        'WED':3, 
        'THU':4, 
        'FRI':5, 
        'SAT':6}
print(7-week[s])
[X,Y]=input().split()
2.if X > Y:
3.    print(">")
4.elif X==Y:
5.    print("=")
6.else:
7.    print("<")


### FIXED CODE ###

x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print("<")
elif x==y:
    print("=")
else:
    print(">")
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

x,n = i2()
p = intl()

m = 100
ls = [int(i) for i in range(1,101)]
for i in range(n):
	ls.remove(p[i])
for j in range(len(ls)):
	if abs(x - ls[j]) < m :
		m = abs(x - ls[j])
		ans = ls[j]
		
print(ans) 

### FIXED CODE ###

def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

x,n = i2()
p = intl()

m = 100
ls = [int(i) for i in range(-200,200)]
for i in range(n):
	ls.remove(p[i])
for j in range(len(ls)):
	if abs(x - ls[j]) < m :
		m = abs(x - ls[j])
		ans = ls[j]
print(ans)
import sys
sys.setrecursionlimit(10**8)

MAX = 100002

def add_num(nn, x):
    if nn == -1:
        return
    Tree[nn][0] += x
    for ni in Tree[nn][1]:
        add_num(ni, x)


ipt = input().split()
N = int(ipt[0])
Q = int(ipt[1])



Tree = []
for m in range(MAX):
    Tree.append([-1, [-1]])

nodes = set()
nodes.add(1)

for i in range(N-1):
    ipti = input().split()
    a = int(ipti[0])
    b = int(ipti[1])

    Tree[a][0] = 0
    Tree[a][1].insert(0, b)
    Tree[b][0] = 0

    nodes.add(b)



for i in range(Q):
    ipti = input().split()
    p = int(ipti[0])
    x = int(ipti[1])
    add_num(p, x)


for n in nodes:
    print(Tree[n][0])








### FIXED CODE ###

ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
import sys

sys.setrecursionlimit(500000)

visited = set()

n,q = nm()

tval = [0]*n
t = [[] for _ in range(n)]

for i in range(n-1):
    a,b = nm()
    t[a-1].append(b-1)
    t[b-1].append(a-1)

for i in range(q):
    p,x = nm()
    tval[p-1] += x

ans = [0]*n
def dfs(num,val):
    visited.add(num)
    now = val+tval[num]
    ans[num] = now
    for nn in t[num]:
        if nn not in visited:
            dfs(nn,now)

dfs(0,0)

for i in ans:
    print(i)
n = int(input())
x = list(map(int,input().split()))
m_energy = 250000
for i range(0,101):
  m_energy = 0
  for k range(n):
    m_energy += (x[k]-1)**2
  if energy < m_energy:
    m_energy = energy
print(minenergy)

### FIXED CODE ###

n = int(input())
x = list(map(int,input().split()))
m_energy = 250000
for i in range(1,101):
  energy = 0
  for k in range(n):
    energy += (x[k]-i)**2
  if energy < m_energy:
    m_energy = energy
print(m_energy)
N,M=map(int,input().split())
AB=[[0,0] for i in range(M)]
for i in range(M):
    AB[i][0],AB[i][1]=map(int,input().split())
par=[i for i in range(N+1)]
rank=[1 for i in range(N+1)]
hight=[1 for i in range(N+1)]
def Union_Find_find(x):
    global par,rank,hight
    if par[x]==x:
        return x
    else:
        return Union_Find_find(par[x])
def Union_Find_unite(x,y):
     global par,rank,hight
    x=Union_Find_find(x)
    y=Union_Find_find(y)
    if x!=y:
        if hight[x]>hight[y]:
            par[y]=x
            rank[x]=rank[x]+rank[y]
            rank[y]=rank[x]
        else:
            par[x]=y
            rank[x]=rank[x]+rank[y]
            rank[y]=rank[x]
            if hight[x]==hight[y]:
                hight[y]+=1
def Union_Find_same(x,y):
     global par,rank,hight
    return Union_Find_find(x)==Union_Find_find(y)
def ncr(n):
    return n*(n-1)//2
res=[]
res.append(ncr(N))
for i in reversed(range(M)):
    A,B=AB[i][0],AB[i][1]
    if res[-1]!=0:
        if Union_Find_same(A,B):
            res.append(res[-1])
        else:
            res.append(res[-1]-rank[A]*rank[B])
            Union_Find_unite(A,B)
    else:
        res.append(0)
for i in reversed(range(M)):
    print(res[i])


### FIXED CODE ###

N,M=map(int,input().split())
AB=[[0,0] for i in range(M)]
for i in range(M):
    AB[i][0],AB[i][1]=map(int,input().split())
par=[i for i in range(N+1)]
rank=[1 for i in range(N+1)]
hight=[1 for i in range(N+1)]
def Union_Find_find(x):
    global par,rank,hight
    if par[x]==x:
        return x
    else:
        return Union_Find_find(par[x])
def Union_Find_unite(x,y):
    global par,rank,hight
    x=Union_Find_find(x)
    y=Union_Find_find(y)
    if x!=y:
        if hight[x]>hight[y]:
            par[y]=x
            rank[x]=rank[x]+rank[y]
            rank[y]=rank[x]
        else:
            par[x]=y
            rank[x]=rank[x]+rank[y]
            rank[y]=rank[x]
            if hight[x]==hight[y]:
                hight[y]+=1
def Union_Find_same(x,y):
    global par,rank,hight
    return Union_Find_find(x)==Union_Find_find(y)
def ncr(n):
    return n*(n-1)//2
res=[]
res.append(ncr(N))
for i in reversed(range(M)):
    A,B=AB[i][0],AB[i][1]
    if res[-1]!=0:
        if Union_Find_same(A,B):
            res.append(res[-1])
        else:
            res.append(res[-1]-rank[Union_Find_find(A)]*rank[Union_Find_find(B)])
            Union_Find_unite(A,B)
    else:
        res.append(0)
for i in reversed(range(M)):
    print(res[i])
N, T = map(int, input().split())
cage,cage2=[],[]
for i in range(N):
  c, t = map(int, input().split())
  if t<=T:
	cage.append(c)
if cage==None:
  print("TLE")
else:
  print(min(cage))

### FIXED CODE ###

N, T = map(int, input().split())
cage,cage2=[],[]
for i in range(N):
  c, t = map(int, input().split())
  if t<=T:
      cage.append(c)
if len(cage)==0:
  print("TLE")
else:
  print(min(cage))
r1,c1,r2,c2 = map(int, input().split())

def nCr_mod_p(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p), 0! = 1! = 1
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p), 0! = 1! = 1
inv = [0, 1]  # inv[n] = n^(-1) mod p, 0! = 1　だけど便宜上inv[0]=0にしてる

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

ans = 0
for i in range(r1,r2+1):
    for j in range(c1,c2+1):

        ans += nCr_mod_p(i+j,i,p)

print(ans%p)

### FIXED CODE ###

r1,c1,r2,c2 = map(int, input().split())

def nCr_mod_p(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
N = 2*10 ** 6 + 10  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p), 0! = 1! = 1
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p), 0! = 1! = 1
inv = [0, 1]  # inv[n] = n^(-1) mod p, 0! = 1　だけど便宜上inv[0]=0にしてる

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

sum22 = nCr_mod_p(r2+1+c2+1,r2+1,p) - 1
sum21 = nCr_mod_p(r2+1+c1,r2+1,p) - 1
sum12 = nCr_mod_p(r1+c2+1,c2+1,p) - 1
sum11 = nCr_mod_p(r1+c1,c1,p) - 1

ans = sum22 - sum21 - sum12 + sum11
ans %= p

print(ans)
def main():
  R = input()
  answer = R * 2 / 3.14
  print(answer)
  
if __name__ == '__main__':
  main()

### FIXED CODE ###

import math

def main():
  R = input()
  answer = float(R) * 2 * math.pi  
  print(answer)
  
if __name__ == '__main__':
  main()
M={0:0}
def popcount(n):
    return n.count("1")

D={0:0}
def f(n):
    if n in D:
        return D[n]
    
    T=[n]
    N=n
    while N>0 and N not in D:
        N%=popcount(N)
        T.append(N)

    t=D[N]
    for i in range(-2,-(len(T)+1),-1):
        D[T[i]]=t+(-i-1)
    return D[n]
    
def g(L):
    A=0
    u=1
    for i in range(N):
        A+=L[-(i+1)]*u
        u*=2
    return A

N=int(input())
X=input()

for i in range(N):
    if X[i]=="0":
        Y=X[:i]+"1"+X[i+1:]
    else:
        Y=X[:i]+"0"+X[i+1:]

    I=0
    while Y!="0":
        Y=bin(int(Y,2)%popcount(Y))[2:]
        I+=1
    print(I)


### FIXED CODE ###

N=int(input())
X=input()
Y=int(X,2)

J=X.count("1")

A=[0]*N
A[-1]=1
for i in range(2,N+1):
    A[-i]=(A[-(i-1)]*2)%(J+1)

B=[0]*N
if J>1:
    B[-1]=1
    for j in range(2,N+1):
        B[-j]=(B[-(j-1)]*2)%(J-1)


H=[0]*N

Q,R=divmod(Y,J+1)
if J>1:
    S,T=divmod(Y,J-1)
else:
    S=T=0

for i in range(N):
    if X[i]=="0":
        U=(R+A[i])%(J+1)
    else:
        if J==1:
            continue
        U=(T-B[i])%(J-1)
        
        
    I=1
    while U>0:
        U=U%bin(U).count("1")
        I+=1
    H[i]=I

print("\n".join(map(str,H)))
N,M = map(int,input(),aplit())

path = [[] for i in range(N)]

for _ in range(M):
	a,b = map(int,input(),split())
	path[a-1],append(b-1)
    path[b-1],append(a-1)
vis = [0 for i in range(N)]
cnt = 0

def dfs(now,path):
	global cnt
  	if depth == N: cnt+=1
	for new in path[now]:
    	if vis[new] == 0:
			vis[new] = 1
        	dfs(new,depth+1)
          	vis[new] = 0

vis[0] = 1
dfs(0,1)
print(cnt)

### FIXED CODE ###

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

path = [[] for i in range(N)]

for _ in range(M):
	a,b = map(int,input().split())
	path[a-1].append(b-1)
	path[b-1].append(a-1)
vis = [0 for i in range(N)]
cnt = 0

def dfs(now,depth):
	global cnt
	if depth == N: cnt+=1
	for new in path[now]:
		if vis[new] == 0:
			vis[new] = 1
			dfs(new,depth+1)
			vis[new] = 0

vis[0] = 1
dfs(0,1)
print(cnt)
s = input()

cnt_0 = 0
cnt_1 = 0
for i in range(0, len(s), 2):
  if s[i] == '0':
    cnt_0 += 1
  else:
    cnt_1 += 1

if cnt_0 > cnt_1:
  start = '0'
  second = '1'
elif cnt_0 == cnt_1:
  if s[len(s)-1] == '1':
    start = '0'
    second = '1'
  else:
    start = '1'
    second = '0'
else:
  start = '1'
  secont = '0'
cnt = 0
for i in range(0, len(s)):
  if not i%2:
    if s[i] != start:
      cnt += 1
  else:
    if s[i] != second:
      cnt += 1
print(cnt)

### FIXED CODE ###

s = input()

cnt_0 = 0
cnt_1 = 0
for i in range(0, len(s), 2):
  if s[i] == '0':
    cnt_0 += 1
  else:
    cnt_1 += 1

if cnt_0 > cnt_1:
  first = '0'
  second = '1'
elif cnt_0 == cnt_1:
  if s[len(s)-1] == '1':
    first = '0'
    second = '1'
  else:
    first = '1'
    second = '0'
else:
  first = '1'
  second = '0'

cnt = 0
for i in range(0, len(s)):
  if not i%2:
    if s[i] != first:
      cnt += 1
  else:
    if s[i] != second:
      cnt += 1
print(cnt)
n=int(input())
a=[input().split() for i in range(n)]
x=0
y=1
for i in a:
  for j in a:
    x+=pow((i[0]-j[0])**2+(i[1]-j[1])**2,0.5)
for k in range(1,n+1):
  y*=k
print(x/y)

### FIXED CODE ###

import itertools
n=int(input())
lst=[list(map(int,input().split())) for i in range(n)]
per=[i for i in itertools.permutations(range(n))]
ans=0
for i in per:
  for j in range(n-1):
    ans+=pow((lst[i[j]][0]-lst[i[j+1]][0])**2+(lst[i[j]][1]-lst[i[j+1]][1])**2,0.5)
print(ans/len(per))
import sys, re

def echo(A):
    for i, a in enumerate(A):
        if i < len(A) - 1:
            sys.stdout('%d ' % a)
        else:
            sys.stdout('%d\n' % a)

def insertionSort(A, N):
    echo(A)
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        echo(A)


n = int(raw_input())
a_text = raw_input()
splits = re.split(a_text)
a = []
for i, s in enumerate(splits): 
    if s:
        a.append(int(s))

insertionSort(a, n)

### FIXED CODE ###

import sys, re

def echo(A):
    for i, a in enumerate(A):
        if i < len(A) - 1:
            sys.stdout.write('%d ' % a)
        else:
            sys.stdout.write('%d\n' % a)

def insertionSort(A, N):
    echo(A)
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        echo(A)


n = int(raw_input())
a_text = raw_input()
splits = re.split(' ', a_text)
a = []
for i, s in enumerate(splits): 
    if s:
        a.append(int(s))

insertionSort(a, n)
n = int(input())
a = list(map(int,input().strip().split()))

ordered = [i for i in range(1,n+1)]
i = 0
count = 0
if a[count] == ordered[count]:
  tmp = a[count]
  a[count] = a[count+1]
  a[count+1] = tmp
  count += 1
i += 1

for i in range(n):
  if a[i] == ordered[i]:
    tmp = a[i]
    a[i] = a[i+1]
    a[i+1] = tmp
    count += 1
print(count)



### FIXED CODE ###

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

ordered = [i for i in range(1,n+1)]
i = 0
count = 0

for i in range(n):
  if i == 0:
    if a[i] == ordered[i]:
      tmp = a[i]
      a[i] = a[i+1]
      a[i+1] = tmp
      count += 1
  elif i == n-1:
    if a[i] == ordered[i]:
      tmp = a[i]
      a[i] = a[i-1]
      a[i-1] = tmp
      count += 1  
  else:
    if a[i] == ordered[i]:
      tmp = a[i]
      a[i] = a[i+1]
      a[i+1] = tmp
      count += 1
print(count)
N,M=map(int,input.split())
A=list(map(int,input().split()))
A.sort(reverse=True)
t=0
while True:
  maxi=A[0]
  maxi_2=A[1]
  t+=1
  maxi=maxi//2
  if t==M :
    A[0]=maxi
    break
  elif maxi_2>maxi :
    A[0]=maxi_2
    A[1]=maxi
    continue
  else:
    continue

amount=sum(A)
print(amount)
    
 
  
  
  



### FIXED CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
for i in range(N):
  A[i]*=-1
import heapq
heapq.heapify(A)
import math
for i in range(M):
  maxi=heapq.heappop(A)
  maxi=math.ceil(maxi/2)
  heapq.heappush(A,maxi)
  
ans=sum(A)*(-1)
print(ans)