Harryxun/stf_run huggingface dataset:
import numpy as np 


def resolve():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))

    A = np.zeros((N, N))
    for i in range(M):
        pp, ss = map(int, input().split())
        ss -= 1
        pp -= 1
        A[pp][ss] = H[ss]
        A[ss][pp] = H[pp]

    ans = 0
    for j in range(N):
        np_max = np.max(A[j])

        now = H[j]
        if (now > np_max or np_max == 0):
            ans += 1

    print(ans)


resolve()

### FIXED CODE ###

def resolve():
    n, m = map(int, input().split())
    hhh = list(map(int, input().split()))
    nice = [1] * n

    for _ in range(m):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        ha = hhh[a]
        hb = hhh[b]
        if ha <= hb:
            nice[a] = False
        if ha >= hb:
            nice[b] = False

    print(sum(nice))


resolve()
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = [0]*(k+2)
ans[0] = 1
for i in range(k):
    ans[0] *= a[i]
print(ans[0])
for i in range(n-k):
    #print(i,ans)
    ans[i+1] = ans[i] * a[i+k] //a[i]
    if ans[i+1] > ans[i]:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n-k):
    if a[i+k] > a[i]:
        print("Yes")
    else:
        print("No")
Primes = []
def find_nth_prime(n):
    """ n??????????´???°????±??????? """
    count = len(Primes)
    if count >= n:
        return
    if count > 0:
        num = Primes[-1] + 1
    else:
        num = 2
    while True:
        if is_prime(num):
            count += 1
            Primes.append(num)
        if count >= n:
            break
        num += 1


if __name__ == '__main__':
    # ??????????????\???
    while True:
        data = int(input())
        if data == 0:
            break

        # ????????¨???????????¨???
        find_nth_prime(data)
        # print(Primes)
        print(sum(Primes[:data]))

### FIXED CODE ###

import random

def is_prime(q, k=50):
    """ ??????????????????????´???°?????????????????¨??????????????????????????°????´???°???????????????????????????
    http://d.hatena.ne.jp/pashango_p/20090704/1246692091
    """
    q = abs(q)
    # ?¨???????????????§?????????????????§????????????????????????
    if q == 2: return True
    if q < 2 or q & 1 == 0: return False

    # n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
    d = (q - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    # ?????????k?????°?????????
    for i in range(k):
        a = random.randint(1, q - 1)
        t = d
        y = pow(a, t, q)
        # [0,s-1]??????????????????????????§??????
        while t != q - 1 and y != 1 and y != q - 1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q - 1 and t & 1 == 0:
            return False
    return True


Primes = []
def find_nth_prime(n):
    """ n??????????´???°????±??????? """
    count = len(Primes)
    if count >= n:
        return
    if count > 0:
        num = Primes[-1] + 1
    else:
        num = 2
    while True:
        if is_prime(num):
            count += 1
            Primes.append(num)
        if count >= n:
            break
        num += 1


if __name__ == '__main__':
    # ??????????????\???
    while True:
        data = int(input())
        if data == 0:
            break

        # ????????¨???????????¨???
        find_nth_prime(data)
        # print(Primes)
        print(sum(Primes[:data]))
n = [int(x) for x in input()]
op_cnt = len(n) - 1
for i in range(2 ** op_cnt):
	op = ['-'] * op_cnt#['-', '-', '-']
    for j in range(op_cnt):
      if ((i >> j) & 1):
        op[-1-j] = '+'
    formula = ''
    for p_n, p_o in zip(n, op + ['']):#(1,+),(2,+),(3,+),(4,'')
      formula += (p_n + p_o)
    if eval(formula) == 7:#'1+2+3+4'
      print(formula + '=7')
      break

### FIXED CODE ###

n = input()
op_cnt = len(n) - 1
for i in range(2 ** op_cnt):
  op = ['-'] * op_cnt#['-', '-', '-']
  for j in range(op_cnt):
    if ((i >> j) & 1):
      op[-1-j] = '+'
  formula = ''
  for p_n, p_o in zip(n, op + ['']):#(1,+),(2,+),(3,+),(4,'')
    formula += (p_n + p_o)
  if eval(formula) == 7:#'1+2+3+4'
    print(formula + '=7')
    break
n=int(input())
a=list(map(int,input().split()))
x=0
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    x+=1
if x=0:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
x=0
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    x+=1
if x==0:
  print("YES")
else:
  print("NO")
from math import gcd
def lcm(a,b):
    return(a*b//gcd(a,b))
N=int(input())
curlcm=1
for _ in range(N):
    curlcm=lcm(curlcm,int(input()))
print(curlcm)

### FIXED CODE ###

def gcd(a,b):
    if b<a:
        x=b 
        y=a
    else:
        x=a
        y=b
    #x>y
    while x%y!=0:
        newy=x%y
        x=y
        y=newy
    return y
def lcm(a,b):
    return(a*b//gcd(a,b))
N=int(input())
curlcm=1
for _ in range(N):
    curlcm=lcm(curlcm,int(input()))
print(curlcm)
n = raw_input()
max = 0
min = 0
for x in range(n):
  x = raw_input()
  if x > max:
    max = x
  if x < min:
    min = x

print max-min
  

### FIXED CODE ###

N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif
import sys
from collections import deque

input = sys.stdin.readline

N = int(input())
nodes = deque()
for i in range(N - 1):
    nodes.append(list(map(int, input().split())))

B, W = set(), set()
u, v, w = nodes.popleft()
if w % 2 == 0:
    B.add(u)
    B.add(v)
else:
    B.add(u)
    W.add(v)

while len(nodes) != 0:
    u, v, w = nodes.popleft()
    if w % 2 == 0:
        if u in B or v in B:
            B.add(u)
            B.add(v)
        elif u in W or v in W:
            W.add(u)
            W.add(v)
        else:
            nodes.append(u, v, w)
    else:
        if u in B or v in W:
            B.add(u)
            W.add(v)
        elif u in W or v in B:
            W.add(u)
            B.add(v)
        else:
            nodes.append(u, v, w)

ans = [0] * N
for x in W:
    ans[x - 1] = 1
for x in ans:
    print(x)


### FIXED CODE ###

import sys
from collections import defaultdict

sys.setrecursionlimit(100000)
input = sys.stdin.readline

N = int(input())
G = defaultdict(list)
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    G[u - 1].append((v - 1, w))
    G[v - 1].append((u - 1, w))
res = [None] * N


def dfs(v, c):
    res[v] = c
    for u, w in G[v]:
        if res[u] is not None:
            continue
        if w % 2 == 0:
            dfs(u, c)
        else:
            dfs(u, 1 - c)


dfs(0, 0)
for x in res:
    print(x)
def main():
    print(f'ABC{input()}')

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = input()
    print('ABC%s' % n)

if __name__ == '__main__':
    main()
#coding:UTF-8

a = input()
b = input()

x=a*b
y=2*(a+b)

print int(x)
print int(y)



### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,2*(a+b))
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(input(i))
c=min(x,i)

### FIXED CODE ###

a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)
N=int(input())
A=list(map(int,input().split()))
li=[]
for i in range(N):
  if A[i]!=AA[i]:
    li.append(A[i])
if len(li)>2:
  print("NO")
else:
  print("YES")

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
AA=sorted(A)
li=[]
for i in range(N):
  if A[i]!=AA[i]:
    li.append(A[i])
if len(li)>2:
  print("NO")
else:
  print("YES")
a,b map(int,input().split(" ")
print(a -2＊b)

### FIXED CODE ###

a,b= map(int,input().split(" "))
c=a -2*b
if c>0:
  print(c)
else:
  print(0)
n = int(input())
L = [int(i) for i in input().split()]
c = sum(int(i) for i in input().split())
C = [int(i) for i in input().split()]
for i in range(len(L)):
  if L[i] == L[i+1]:
    c += C[i-1]
print(c)

### FIXED CODE ###

n = int(input())
L = [int(i) for i in input().split()]
c = sum(int(i) for i in input().split())
C = [int(i) for i in input().split()]
for i in range(len(L)-1):
  if L[i]+1 == L[i+1]:
    c += C[L[i]-1]
print(c)
ri = lambda S: [int(v) for v in S.split()]


def rii():
    return ri(input())


N, M, K = rii()
A = rii()
B = rii()

i = j = 0


def dp(i, j, k):
    print(i, j, k)
    ki = kj = mki = mkj = 0

    if i < N:
        Ki = k - A[i] if A[i] <= k else 0
        mki = 1 + dp(i + 1, j, Ki) if Ki >= 0 else 0
    if j < M:
        kj = k - B[j] if B[j] <= k else 0
        mkj = 1 + dp(i, j + 1, kj) if kj >= 0 else 0

    return max(mki, mkj)


print(dp(0, 0, K))


### FIXED CODE ###

from itertools import accumulate
from bisect import bisect_left

ri = lambda S: [int(v) for v in S.split()]


def rii():
    return ri(input())


N, M, K = rii()
A = rii()
B = rii()

i = j = 0

pA = [0] + list(accumulate(A))
pB = [0] + list(accumulate(B))

ans = 0
for i, a in enumerate(pA):
    br = 0
    if K >= a:
        r = K - a
        br = i
    
    if r:
        j = bisect_left(pB, r)
        if j != len(pB):
            if pB[j] > r:
                j -= 1
            br += j
    
    ans = max(ans, br)

print(ans)
import sys

x = abs(int(input()))
k = int(input())
d = int(input())

move_cnt = float(x / d)
if (move_cnt <= k):
    k -= move_cnt
    amari = x - move_cnt * d

else:
    k = 0
    amari = x - move_cnt * d

if (k > 0):
    if (k % 2 == 1):
        if (amari > 0):
            amari -= d
        else:
            amari += d

print(int(abs(amari)))

### FIXED CODE ###

import sys

# x = abs(int(input()))
# k = int(input())
# d = int(input())

array = list(map(int, input().strip().split()))
x = abs(array[0])
k = array[1]
d = array[2]
if (d == 0):
    amari = abs(x)

else:
    move_cnt = int(x / d)
    if (move_cnt <= k):
        k -= move_cnt
        amari = x - move_cnt * d

    else:
        amari = x - k * d
        k = 0

    if (k > 0):
        if (k % 2 == 1):
            if (amari > 0):
                amari -= d
            else:
                amari += d

print(abs(amari))
s,w =map(int(input().split()))
if s<=w:
  print('unsafe')
else:
  print('safe')

### FIXED CODE ###

s,w =map(int,input().split())
if s<=w:
  print('unsafe')
else:
  print('safe')
a,b = [int(x) for x in input().split()]
amax = int((a+1)*12.5)
amin = int(a*12.5)
bmax = int((b+1)*10)
bmin = int(b*10)
hantei = bmin
if amax < bmin:
  hantei = str(-1)
elif bmax < amin:
  hantei = str(-1)
elif bmin < amin:
  hantei = amin
print(hantei)

### FIXED CODE ###

a = input()
b = list(a)
hantei = "Yes"
if b[0] == b[1] and b[1] == b[2] and b[2] == b[0]:
  hantei = "No"
print(hantei)
R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    prnit('AGC')

### FIXED CODE ###

R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')
a

### FIXED CODE ###

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

ans = 0

for i in range(N):
    A = list(map(int, input().split()))
    check = C

    for i,j in zip(A,B):
        check = check + (i*j)

    if check > 0:
        ans = ans + 1

print(ans)
N, K = [int(item) for item in input().split()]
h =[0] + [int(item) for item in input().split()]

dp = [0 for _ in range(N+1)]
dp[2]= abs(h[2] - h[1])

for i in range(3, N):
    for k in range(1,K+1):
        # print(i,k, dp[i])
        if dp[i] != 0:
            if 2 <= i-k:
                dp[i] = min(dp[i], dp[i-k] + abs(h[i-k] - h[i]))
        else:
            # print('make')
            if 2 <= i-k:
                dp[i] = dp[i-k] + abs(h[i-k] - h[i])

print(dp[1+N-K])

### FIXED CODE ###

import numpy as np

N, K = [int(item) for item in input().split()]
h =np.array([int(item) for item in input().split()])
# print(h.shape)
dp = np.full(N+K, 10**10+1, dtype='int64')
dp[0] = 0

for i in range(1, N):
    max1 = min(N, i+K)
    cost = abs(h[i:max1] - h[i-1])
    # print(cost.shape, dp[i:max1].shape)
    dp[i:max1] = np.minimum(dp[i:max1], dp[i-1] + cost)

    # print(dp)
print(dp[N-1])
a, b, c, d = map(int, input().split())

while a>0 and c>0:
  c -= b
  a -= d
  
  

if a>o:
  print("Yes")
  
else:
  print("No")
  
  


### FIXED CODE ###

a, b, c, d = map(int, input().split())

while a>0 and c>0:
  c -= b
  a -= d
  
  
if c<=0:
  print("Yes")
  
else:
  print("No")
import math
N = int(input())
A = [int(j) for j in input().split()]
B = [0]*N
B = A[:]
D = 1
gcdmx = 0
for k in range(0,N):
        D = D * B[k]
for j in range(0,N):
    C = B[:]
    C[j] = D
    gcdloc = D
    for k in range(0,N):
        gcdloc = math.gcd(gcdloc,C[k])
    gcdmx = max(gcdloc,gcdmx)
print(gcdmx)

### FIXED CODE ###

import fractions as f

n = int(input())
A = [int(_) for _ in input().split()]

left = []
right = []

left.append(A[0])
for i in range(1,n):
    left.append(f.gcd(left[i-1],A[i]))

right.append(A[n-1])
for i in range(1,n):
    right.append(f.gcd(right[i-1],A[n-1-i]))

ans = 0
for i in range(n):
    if i == 0:
        ans = right[n-2]
    if i >= 1 and i <= n-2:
        ans = max(ans,f.gcd(left[i-1],right[n-2-i]))
    if i == n-1:
        ans = max(ans,left[n-2])
print(ans)
n=int(input())
h=list(map(int,input().split()))
cnt=0
while set(h)=={0}
  if h not in 0:
    for i in range(len(h)):
      h[i]=h[i]-min(h)
      cnt+=min(h)
  else:
    for i in range(len(h)):
      l=[]
      if h[i]==0:
      else:
        l.append(h[i])
        continue
      cnt+=min(l)
print(cnt)

### FIXED CODE ###

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

ans = 0
pre = 0
for i in h:
    if pre < i:
        ans += i-pre

    pre = i

print(ans)
#copy code
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
B = [0 for i in range(10**5+1)]
S = [0]
s = 0
for i in range(N):
    B[A[i]] += 1
    s += A[i]
    S.append(s)
for i in range(2,10**5+2):
    B[-i] += B[-i+1]
d = 0
u = 2*10**5
for i in range(30):
    x = (u+d)//2
    m = 0
    for i in range(N):
        a = A[i]
        y = max(x - a,0)
        if y <= 10**5:
            m += B[y]
    if m >= M:
        d = x
    else:
        u = x
ans = 0
for i in range(N):
    a = A[i]
    x = max(d - a,0)
    if x <= 10**15:
        y = B[x]
    else:
        y = 0
    ans += (S[N] - S[N-y]) + a*y
ans -= (m-M)*d
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
B = [0 for i in range(10**5+1)]
S = [0]
s = 0
for i in range(N):
    B[A[i]] += 1
    s += A[i]
    S.append(s)
for i in range(2,10**5+2):
    B[-i] += B[-i+1]
d = 0
u = 2*10**5
for i in range(30):
    x = (u+d)//2
    if i == 28:
        x += 1
    m = 0
    for i in range(N):
        a = A[i]
        y = max(x - a,0)
        if y <= 10**5:
            m += B[y]
    if m >= M:
        d = x
    else:
        u = x
ans = 0
for i in range(N):
    a = A[i]
    x = max(d - a,0)
    if x <= 10**5:
        y = B[x]
    else:
        y = 0
    ans += (S[N] - S[N-y]) + a*y
ans -= (m-M)*d
print(ans)
S=input()
a=(str(S)[0])
b=(str(S)[1])
c=(str(S)[2])
d=(str(S)[3])
if(int(a)==int(b)):
  print("Bad")
else:
    print("Good")
    if(int(b)==int(c)):
  print("Bad")
else:
    print("Good")
if(int(c)==int(d)):
  print("Bad")
else:
    print("Good")

### FIXED CODE ###

S=input()
a=(str(S)[0])
b=(str(S)[1])
c=(str(S)[2])
d=(str(S)[3])
if(int(a)==int(b)):
  print("Bad")
elif(int(b)==int(c)):
  print("Bad")
elif(int(c)==int(d)):
  print("Bad")
else:
    print("Good")
ab=""
cnt = 0
while ab=="" and cnt<len(a):
  for i in range(min(len(b),len(a)-cnt)):
    if a[i+cnt]!="?" and b[i]!="?" and a[i+cnt]!=b[i]:
      ab=""
      break
    else:
      if a[i+cnt]!="?":
        ab += a[i+cnt]
      else:
        ab +=b[i]
if ab=="":
  ab =a+b
abc=""
cnt=0
while abc=="" and cnt<len(ab):
  for i in range(min(len(c),len(ab)-cnt)):
    if ab[i+cnt]!="?" and c[i+cnt]!="?" and ab[i+cnt]!=c[i+cnt]:
      abc=""
      break
    else:
      if ab[i+cnt]!="?":
        abc+=ab[i+cnt]
      else:
        abc+=c[i]
if abc!="":
  ans =min(ans,len(abc))


### FIXED CODE ###

lis=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(lis[k-1])
x = int(input())
d = list(map(int, input().split()))
count = 0
if x < 3:
  print(0)
  break
else:
  for i in range(len(d)):
    for j in range(i+1,len(d)):
      for k in range(j+1,len(d)):
        temp = []
        temp.extend([d[i],d[j],d[k]])
        temp.sort()
        if temp[0] + temp[1] > temp[2] and len(list(set(temp))) == 3:
          count += 1
print(count)

### FIXED CODE ###

x = int(input())
d = list(map(int, input().split()))
count = 0
for i in range(len(d)):
  for j in range(i+1,len(d)):
    for k in range(j+1,len(d)):
      temp = []
      temp.extend([d[i],d[j],d[k]])
      temp.sort()
      if temp[0] + temp[1] > temp[2] and len(list(set(temp))) == 3:
        count += 1
print(count)
if input() >= 30:
  print("Yes")
else:
  print("Yes")

### FIXED CODE ###

import sys
for l in sys.stdin:
	if int(l) >= 30:
		print("Yes")
	else:
		print("No")
a=int(input())
b=list(map(int,input().split()))
c=0
od=0
while od==0:
    for i in range(a):
        if b[i]%2 == 1:
            od=1
    if od==1:
        break
    for i in range(a):
        b[i]/=2
    c+=1
print(c)

### FIXED CODE ###

print(input().count('1'))
N,X=map(int,input().split())
L=list(map(int,input().split()))

d=0
count=1
for l in L
 d=d+1
 if X>=d:
  count +=1
print(count)


### FIXED CODE ###

X,A = map(int,input().split())
L = list(map(int,input().split()))
 
d = 0
count = 1
for l in L:
    d = d + l
    if A>= d:
        count += 1
        
    
print(count)
def modinv(a,m):
    return pow(a,m-2,m)


n,k = map(int,input().split())
P = 10**9+7

if n-1 <= k:

    ans = 1
    for i in range(1,n):
        ans = ans*(N+1-i)*modinv(i,P)%P

else:
    ans = 0
    nCl = 1
    n1Cl = 1
    for l in range(1,k+1):
        nCl = nCl*(n+1-l)*modinv(l,P)%P
        n1Cl = n1Cl*(n-l)*modinv(l,P)%P
        ans = (ans+nCl*n1Cl)%P

print((ans+1)%P)



### FIXED CODE ###

def modinv(a,m):
    return pow(a,m-2,m)


n,k = map(int,input().split())
P = 10**9+7



if n-1 <= k:
    N = n + min(n-1,k)
    ans = 1
    for i in range(1,n):
        ans = ans*(N+1-i)*modinv(i,P)%P

else:
    ans = 1
    nCl = 1
    n1Cl = 1
    for l in range(1,k+1):
        nCl = nCl*(n+1-l)*modinv(l,P)%P
        n1Cl = n1Cl*(n-l)*modinv(l,P)%P
        ans = (ans+nCl*n1Cl)%P

print(ans)
print(input().replace('017','018')

### FIXED CODE ###

print(input().replace('017','018'))
a,b,c = map(int,input().split())
count = 0
for i in range(a,b+1) :
  d = c % i
  if d == 0 :
     count = count +1
print count

### FIXED CODE ###

a,b,c = map(int,input().split())
count = 0
for i in range(a,b+1):
    d = c % i
    if d == 0:
        count += 1
print (count)
#Grid Repainting 2

#初期化
S = []
p = []
flag = True

#入力
H,W = map(int, input().split())
for i in range(W):
	s = input()
	s_list = list(s)
	S.append(s_list)

#計算
for i in range(0, W-1, 1):
	for j in range(0, H-1, 1):
		if S[i][j] == "#" and S[i+1][j] == "." and S[i][j+1] == "."  and S[i-1][j] == "." and S[i][j-1] == "." :
			flag = False
		

#出力
if flag == True:
	print("Yes")

else:
	print("No")

### FIXED CODE ###

#Day of Takahashi

#入力
a, b = map(int, input().split())

#計算
if a > b:
	ans = a-1

if a <= b:
	ans = a

#出力
print("{}".format(ans))
a,b=map(int,inpuy().split())
print((a+b)%24)

### FIXED CODE ###

a,b=map(int,input().split())
print((a+b)%24)
import heapq

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

N, M = cin()
A = cin()
x = []
for i in range(N):
    heapq.heappush(x, -A[i])
for i in range(M):
    p = -heapq.heappop(x)
    heapq.heappush(x, -(p // 2))
ans = -sum(x)
print(ans)

### FIXED CODE ###

import heapq
N, M = list(map(int,input().split()))
A = list(map(int,input().split()))
x = []
for i in range(N):
    heapq.heappush(x, -A[i])
for i in range(M):
    p = -heapq.heappop(x)
    heapq.heappush(x, -(p // 2))
ans = -sum(x)
print(ans)
N = int(input())
A = list(map(int, input().split()))

M = max(A)
L = M.bit_length()
ans = 0
mod = 10**9 + 7
k = [0]*L
k[0] = 1
for i in range(1, L):
    k[i] = k[i-1]*2
for j in range(L):
    count = 0
    for x in A:
        if (x >> j) % 2 == 1:
            count += 1
    ans += count*(N - count)*k[j]
    ans %= mod
print(ans)


### FIXED CODE ###



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

ans = 0
mod = 10**9 + 7


b = bin(max(A))

l = len(b) - 2


for j in range(l):
    tmp = 0
    for i in range(N):
        if (A[i] >> j) % 2 == 1:
            tmp += 1

    ans += (2**j) * tmp * (N-tmp)
    ans %= mod
print(ans)
N,M = map(int,input().split())

print(N(N-1)//2+M(M-1)//2)


### FIXED CODE ###

X,Y = map(int,input().split())
print(int(X + Y/2))
n = int(input())
l = list(map(int, input().split()))
l.sort()

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        k = bisect_left(l[j:], l[i] + l[j]) + j
        ans += k - j - 1
print(ans)


### FIXED CODE ###

from bisect import bisect_left
 
n = int(input())
l = sorted(list(map(int,input().split())))

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        k = bisect_left(l,l[i]+l[j])
        ans += k - j - 1

print(ans)
n = int(input())
a = [int(i) for i in input().split()]

import numpy as np
A = np.zeros((n,n))
for i in range(n): #左の行列
  if i<n-1:
    A[i][i]=1
    A[i][i+1]=1
  else:
    A[i][0]=1
    A[i][i]=1
b = np.array(a) #右辺
x = np.linalg.solve(A, b)
x_list = x.tolist()
x_list = [2*i for i in x_list]
for i in range(n):
  print(int(x_list[i]), end=" ")

### FIXED CODE ###

#奇数だから一個仲間外れにできるとの神(ki..sh..ak..i)の啓示

n = int(input())
a = [int(i) for i in input().split()]
w = [] #逆向きの答え
s = sum(a)/2
k = n//2
#w(n-1)を求める
a_odd = [a[2*i] for i in range(0,k)]
w.append(s-sum(a_odd))
for i in reversed(range(n-1)):
  w.append(a[i]-w[-1])
w.reverse()
for i in range(n):
  print(int(2*w[i]), end=" ")
X = input()
if X>=30:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

X = int(input())
if X>=30:
  print("Yes")
else:
  print("No")
n=int(input())
a=input().split()
a=sorted(a)
count=1
ans=0

for i in range(n-2):
  if a[i]==a[i+1]:
    count+=1
  else:
    print(count)
    ans+=1
    count=1

if a[-2]==a[-1]:
  print(count)
  ans+=1
else:
  print(1)
  ans+=1
  
if ans!=n:
  for i in range(n-ans):
    print(0)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
A=[0]*n
for i in range(n-1):
  A[a[i]-1]+=1
for i in range(n):
  print(A[i])
n = int(input())
a = list(map(int, input().split()))

def diff(now, d):
    return abs(a[now] - a[now - d])

dp = [None] * n
def dfs(depth=n - 1):
    if dp[depth] != None:
        return dp[depth]
    if depth == 0:
        dp[depth] = 0
        return 0
    if depth == 1:
        dp[depth] = dfs(depth=depth - 1) + diff(depth, 1)
        return dp[depth]
    dp[depth] = min(dfs(depth=depth - 1) + diff(depth, 1), dfs(depth=depth - 2) + diff(depth, 2))
    return dp[depth]


print(dfs())


### FIXED CODE ###

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


def diff(now, d):
    return abs(a[now] - a[now - d])

# dp = [None] * n
# def dfs(depth=n - 1):
#     if dp[depth] != None:
#         return dp[depth]
#     if depth == 0:
#         dp[depth] = 0
#         return 0
#     if depth == 1:
#         dp[depth] = dfs(depth=depth - 1) + diff(depth, 1)
#         return dp[depth]
#     dp[depth] = min(dfs(depth=depth - 1) + diff(depth, 1), dfs(depth=depth - 2) + diff(depth, 2))
#     return dp[depth]
#
# print(dfs())

dp = [0] * n
dp[1] = diff(1, 1)
for depth in range(2, n):
    dp[depth] = min(dp[depth - 1] + diff(depth, 1), dp[depth - 2] + diff(depth, 2))
print(dp[-1])
import sys
import math
(x1, y1, x2, y2) = [int(i) for i in sys.stdin.readline().split()]
d = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
print(d)

### FIXED CODE ###

import sys
import math
(x1, y1, x2, y2) = [float(i) for i in sys.stdin.readline().split()]
d = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
print(d)