peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
x = int(input())

if x >= 400 and x < 600:
    print(8)
elif x >= 600 and x < 800:
    print(7)
elif x >= 800 and x < 1000:
    print(6)
elif x >= 1000 and x < 1200:
    print(5)
elif x >= 1200 and x < 1400:
    print(4)
elif x >= 1400 and x < 1600:
    print(3)
elif x >= 1600 and x < 1800:
    print(2)
elif x >= 1800 and x < 2000:
    print(1)
# Judge status: Accepted
from math import sqrt
X=int(input())
ans=0
for i in range(1,int(sqrt(X))+1):
    now=i
    b=2
    while i!=1 and X>=i**b:
        now=i**b
        b+=1
    ans=max(ans, now)
print(ans)
# Judge status: Accepted
from sys import stdout, stdin, maxsize

n, k = map(int, stdin.readline().split())
ls = list(map(int, stdin.readline().split()))
dp = [maxsize] * (n + 1)
dp[1] = 0
if n == 1:
	print(0)
else:
	dp[2] = abs(ls[1] - ls[0])
	for i in range(3, n + 1):
		j = 1
		while j <= k and i - j >= 0:
			dp[i] = min(dp[i - j] + abs(ls[i - 1] - ls[i - 1 - j]), dp[i])
			j += 1
	print(dp[n])
# Judge status: Wrong Answer
a, b = map(int, input().split())

# for i in range(1, 1010):
#     if a == int(i*0.08) and b == int(i*0.1):
#         print(i)
#         break
# else:
#     print(-1)

# O(1)の回答
if int(b*10*0.08) > a:
    print(-1)
elif int((b*10+9)*0.08) < a:
    print(-1)
elif a % 2 == 0:
    print(int(a/0.08))
else:
    print(int(a/0.08)+1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = A[i] - i + 1
A.sort()
b = A[N // 2]
ans = 0
for a in A:
    ans += abs(a - b)

print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())

ss = [list(map(int, input().split())) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(m)]

INF = 10 ** 8 * 2
for s in ss:
    dist = INF
    c_point = 0
    a, b = s
    for i, v in enumerate(p):
        c, d = v
        manhattan = abs(a - c) + abs(b - d)
        if manhattan < dist:
            c_point = i + 1
            dist = manhattan
    print(c_point)
# Judge status: Wrong Answer
import math
import numpy as np

def main():
    a = list( map( float, input().split()))
    #print(format(a[0], '.20f'))
    a1 = int(a[0])
    a2 = int(round(a[1],3)*100)
    #print(format(a[1], '.20f'))
    #print(format(a2, '.20f'))
    s = a1*a2/100
    #print(format(s, '.20f'))
    print(math.floor(s))
    
if __name__ == '__main__':
    main()
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))
count=1
n=n-k
while(n>0):
    n=n-(k-1)
    count+=1
print(count)
# Judge status: Wrong Answer
def main():
    from collections import deque
    s = deque(list(input()))
    while deque:
        t = s.pop()
        if len(s)%2 != 0:
            continue
        l = list(s)
        if l == l[::-1]:
            print(len(l))
            return 0

if __name__ == '__main__':
    main()
# Judge status: Accepted
N, K = map(int, input().split())
d = list(map(str, input().split()))
like = [ str(i) for i in range(10)]
like = list(set(like) ^ set(d))
Ans = 0

while( Ans == 0):
    if set(list(str(N))) <= set(like):
        print(N)
        Ans +=1
        exit()
    N += 1
# Judge status: Accepted
N,L=map(int,input().split())
A=list(map(int,input().split()))
hane=1
count=0
for i in range(N):
    count+=A[i]
    hane+=1
    if count==L:
        break
    elif count>L:
        hane-=1
        break

print(hane)
# Judge status: Accepted
S = input()
ahead = S[0:2]
post = S[2:]

if (ahead == '00' or int(ahead) > 12):
    a_judge = True
else:
    a_judge = False

if (post == '00' or int(post) > 12):
    p_judge = True
else:
    p_judge = False

if (a_judge and p_judge):
    ans = 'NA'
elif (a_judge):
    ans = 'YYMM'
elif (p_judge):
    ans = 'MMYY'
else:
    ans = 'AMBIGUOUS'

print(ans)
# Judge status: Accepted
N ,K = map(int, input().split())
count = 0
for i in range(10**9):
    if N == 0:
        break
    N = N//K
    count += 1
print(count)
# Judge status: Accepted
n = int(input())
a = int(input())
n %= 500
if n <= a: print('Yes')
else: print('No')
# Judge status: Accepted
s = list(map(int, input().split()))

b = s.index(0)
print(b + 1)
# Judge status: Accepted
#coding:utf-8
X = input()
ans = 0
cnt = 0
for x in X:
    if x=="S":
        cnt+=1
    else:
        if (cnt>0):
            cnt-=1
            ans+=1
print (len(X)-2*ans)
# Judge status: Wrong Answer
import sys
import numpy as np
N=int(input())
data = input()
num = len(data)
list_data = list(data)
R_num = list_data.count('R')
W_num = num-R_num

if(R_num==0 or W_num==0):
  print('0')
  sys.exit()
  
count = 0
flag=0
while(count<=N//2):
  
  list_R = [i for i, x in enumerate(list_data) if x == 'R']
  last_R = list_R[-1]
  first_W = list_data.index('W')
  if last_R-first_W==1:
    break
    
  else:
    list_data[last_R]='W'
    list_data[first_W]='R'
    count +=1
    
print(count+1)
# Judge status: Wrong Answer
k = int(input())
count = 0
for i in range(100000):
    num = i + 1
    k_list = []
    for k_i in str(num):
        k_list.append(int(k_i))
    for j, ele in enumerate(k_list):
        if j == 0:
            continue
        if abs(k_list[j - 1] - k_list[j]) > 1:
            break
    else:
        count += 1
    if count == k:
        print(num)
        break
# Judge status: Accepted
n = int(input())
s = input()
cnt_l, cnt_r = 0, 0

for x in s:
	if x == "(":
		cnt_l += 1
	elif cnt_l > 0:
		cnt_l -= 1
	else:
		cnt_r += 1

print(cnt_r * "(" + s + cnt_l * ")")
# Judge status: Accepted
N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[0]*(N)
dp[1]=abs(h[0]-h[1])
for i in range(2,N):
    dp[i]=min(dp[j]+abs(h[j]-h[i]) for j in range(max(0,i-K),i))
print(dp[N-1])
# Judge status: Accepted
a = list(map(int,input().split()))
if min(a) != a[2] and max(a) != a[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3
s_x, s_y, t_x, t_y = map(int, input().split())
ans = ""
ans += "R" * (t_x - s_x) + "U" * (t_y - s_y)
ans += "L" * (t_x - s_x) + "D" * (t_y - s_y)
ans += "D" + "R" * (t_x - s_x + 1) + "U" * (t_y - s_y + 1) + "L"
ans += "U" + "L" * (t_x - s_x + 1) + "D" * (t_y - s_y + 1) + "R"
print(ans)
# Judge status: Accepted
import sys

def I(): return int(sys.stdin.readline().rstrip())

N = I()
A = [111*i for i in range(1,10)]

for i in range(9):
    if N <= A[i]:
        print(A[i])
        break
# Judge status: Accepted
l = list(map(int,input().split()))
mx = float('-inf')

for i in range(2):
  for j in range(2,4):
    mx = max(mx,l[i]*l[j])
print(mx)
# Judge status: Accepted
n=int(input())
h=list(map(int,input().split()))

step=[]

for i in range(n-1):
  if h[i]<h[i+1]:
    step.append(0)
  else:
    step.append(1)

a=[i for i, x in enumerate(step) if x==0]

ans=[]

for i in range(len(a)):
  if i==0:
    d=a[0]
    ans.append(d)
  else:
    b=a[i]-a[i-1]
    ans.append(b)
    

if not a:
  print(n-1)
else:
  ans.append((n-1)-a[-1])
  print(max(ans)-1)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

if (b-a) == (c-b):
  print('YES')
else:
  print('No')
# Judge status: Accepted
X = int(input())

for i in range(1, 1000000):
    if (X * i) % 360 == 0:
        print(i)
        exit()
# Judge status: Wrong Answer
from itertools import product

n, m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

for i, j in product(range(n - m + 1), repeat=2):
    print(i,j)
    if all(a[i + k][j:] == b[k] for k in range(m)):
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
A=input()
for i in range(int(A),1000):
   if len(set(str(i)))==1:
      print(i)
      exit()
# Judge status: Accepted
a = list(map(int , input().split()))

for i in a:
    if i == 0:
        ans = a.index(i)+1
        break

print(ans)
# Judge status: Accepted
x,k,d=map(int,input().split())
x=abs(x)
if x>k*d:
    print(x-k*d)
else:
    p=x//d
    if p%2==k%2:
        print(x-p*d)
    else:
        print(abs(x-(p+1)*d))
# Judge status: Wrong Answer
A = []
N = int(input())
for _ in range(N):
    t,x,y = map(int,input().split())
    A.append(t-x-y)
for i in range(1,N):
    if A[i]%2!=A[i-1]%2:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
N = int(input())
if N >=30:
    print('Yes')
else :
    print('No')
# Judge status: Accepted
S=input()
N=len(S)

cnt=0
pre=""
last=""

for str in S:
  str = pre +str
  if str==last:
    pre += str
  else:
    cnt +=1
    last=str
    pre=""
    
print(cnt)
# Judge status: Wrong Answer
s=input()

if s[0]=="A":
  if s[2:-1].count("C")==1:
    if s.count("A")==1 and s.count("C")==1:
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")
# Judge status: Wrong Answer
N, K = map(int, input().split())
P = list(map(int, input().split()))
E = 0
Elist = []
for p in P[0:3]:
    plist = list(range(1, p+1))
    Elist.append(sum(plist) / len(plist))
E = sum(Elist)
oldE = E
count = 2
for p in P[3:]:
    count += 1
    plist = list(range(1, p+1))
    Elist.append(sum(plist) / len(plist))
    E -= Elist[count - 3]
    E += Elist[count]
    if oldE <= E:
        oldE = E
print(E)
# Judge status: Accepted
a , b , c =map(int,input().split())
p = [i for i in range(1,a)]
k = c
while True:
    k = (k + b) % a
    if k == 0:
        print("YES")
        exit()
    elif p.count(k) == 0:
        print("NO")
        exit()
    elif p.count(k) == 1:
        p.remove(k)
# Judge status: Wrong Answer
import numpy as np

N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7
A_cum = np.array(A, np.int64).cumsum()

ans = 0
for i in range(N):
    ans += (A_cum[-1] - A_cum[i]) * A[i]
    ans %= mod

print(ans)
# Judge status: Accepted
n = int(input())
s = input()

to_east = 0
to_west = s.count('E', 1)
ans = to_east+to_west

for i in range(1, n):
  if s[i-1]=='W':
    to_east += 1
  if s[i]=='E':
    to_west -= 1
  ans = to_east+to_west if ans>to_east+to_west else ans
  
print(ans)
# Judge status: Accepted
n=int(input())
a=[]
b=[]
for i in range(n):
    na,nb=map(int,input().split())
    a.append(na)
    b.append(nb)
ans=0
num=0
for i in range(n):
    num1=(num+a[-i-1])%b[-1-i]
    if num1!=0:
        num+=b[-1-i]-num1
        ans+=b[-1-i]-num1
print(ans)
# Judge status: Wrong Answer
import numpy as np 
N,W=map(int,input().split())
w,v=[],[]
for i in range(N):
    a,b=map(int,input().split())
    w+=[a]
    v+=[b]
DP=np.zeros(W+1,dtype=int)
print(DP)
for i in range(N):
    DP[w[i]:]=np.maximum(DP[:-w[i]]+v[i],DP[w[i]:])
print(DP)
# Judge status: Accepted
n = int(input())
res = n // 11
res *= 2
n %= 11
if n == 0:
    pass
elif n < 7:
    res += 1
else:
    res += 2
print(res)
# Judge status: Accepted
n,x = map(int,input().split())
l = list(map(int,input().split()))

lis = [0]
for i in range(n):
    lis.append(lis[i]+l[i])

print(sum(1 for li in lis if li <= x ))
# Judge status: Accepted
# Contest No.: ABC173
# Problem No.: D
# Solver:      JEMINI
# Date:        20200705

import sys
import heapq

def main():
    n = int(input())    
    nums = list(map(int, sys.stdin.readline().split()))

    nums.sort()
    ans = 0

    # initial
    temp = nums.pop()
    ans += temp
    n -= 2

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

    if n % 2:
        ans += nums[-(n // 2) - 1]
    
    
    print(ans)

    return

if __name__ == "__main__":
    main()
# Judge status: Accepted
p, q, r = map(int, input().split())
print(min(p+q,q+r,r+p))
# Judge status: Wrong Answer
n = int(input())
boss_list = list(map(int, input().split(" ")))

boss_list = sorted(boss_list)


for i in range(n):
    boss_num = boss_list.count(i + 1)
    boss_list = boss_list[:boss_num]

    if i == 0:
        boss_num -= 1

    print(boss_num)
# Judge status: Accepted
from collections import Counter


N = int(input())
cntr = Counter(list(map(int, input().split())))
ans = 0
for k, v in cntr.items():
    if k > v:
        ans += v
    else:
        ans += v - k
print(ans)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if b <= c or d <= a:
    print(0)
elif a <= c and d <= b:
    print(d - c)
elif c <= a and b <= d:
    print(b - a)
elif a <= c:
    print(b - c)
else:
    print(d - a)
# Judge status: Accepted
import collections
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a_list = list([int(input()) for _ in range(N)])
    a_freq = collections.Counter(a_list)
    print(len([freq for freq in a_freq.values() if freq % 2 == 1]))

if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, x = map(int, input().split())
if 0 <= x - a <= b:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
def main():
    n=int(input())
    a=int(input())
    print('Yes' if n%500<=a else 'No')

main()
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.readline

    INF = 1 << 30

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

    dp = [INF] * (H + 1)
    dp[0] = 0

    for _ in range(N):
        A, B = map(int, input().split())
        for j in range(H):
            nj = min(H, j + A)
            dp[nj] = min(dp[nj], dp[j] + B)
    print(dp[H])


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import math
a,b=map(int, input().split()) 

if a==1 and b==1:
	print(1)
elif a*b%2 == 0:
	print(int(a*b/2))
elif a*b%2 == 1:
	print(int(math.floor(a*b/2+1)))
# Judge status: Wrong Answer
n = int(input())
ans = 0
d = 0
for i in range(2,int(n**0.5//1 + 3)):
  c = 0
  if n % i == 0:
    d == 1
    while n % i == 0:
      n //= i
      c += 1
    j = 1
    cou = 0
    while c> 0:
      cou += 1
      c -= j
      j += 1
    ans += cou  
      
    
if d == 0 and n != 1:
  ans = 1
print(ans)
# Judge status: Accepted
d,t,s = map(int,input().split())

if d <= t*s : print("Yes")
else: print("No")
# Judge status: Wrong Answer
import bisect
n = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))

ans = 0
for i in range(n):
    b = B[i]
    a = bisect.bisect_left(A, b)
    c = n-bisect.bisect_right(C, b)
    print(a, b, c)
    ans += a*c
print(ans)
# Judge status: Wrong Answer
import re
A, B = map(int, input().split())
S = [s for s in list(input()) if s != '-']
print("Yes") if len(S) == A + B else print("No")
# Judge status: Accepted
import copy
n = int(input())
c = [list(map(int, input().split())) for i in range(n-1)]
for i in range(n):
    t = 0
    for j in range(i, n-1):
        if t < c[j][1]:
            t = c[j][1]
        elif t%c[j][2] == 0:
            pass
        else:
            t += c[j][2] - t%c[j][2]
        t += c[j][0]
    print(t)
# Judge status: Wrong Answer
d , t , s = map(int,input().split())
if d/s >= t:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
i=0
ans=0
while i<n:
  if a[i]==i+1:
    i+=1
    ans+=1
  i+=1
print(ans)
# Judge status: Wrong Answer
s = input()
count = 0
for i in range(3):
    if s==1:
        count= count + 1
# Judge status: Accepted
s=input()
flag=True
for i in range(len(s)):
  if i%2==0 and s[i]=='L':
    flag=False
    break
  if i%2==1 and s[i]=='R':
    flag=False
    break
if flag:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
abc = []
dp = [[0 for i in range(3)]for j in range(n)]
for i in range(n):
    abc.append(list(map(int,input().split())))
dp[0] = abc[0]
for i in range(1,n):
    for j in range(3):
        for k in range(3):
            if j != k :
                dp[i][k] = max(dp[i][k],dp[i-1][j]+abc[i][k])
print(max(dp[-1]))
# Judge status: Accepted
n = int(input())

for i in range(1000):
    n_str = str(n)
    if n_str[0] == n_str[1] == n_str[2]:
        break
    n += 1

print(n_str)
# Judge status: Wrong Answer
n=int(input())
a=float(n//2)+1.0
print(a/float(n))
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if k >= e-a:
    print('Yay!')
else:
    print(':(')
# Judge status: Accepted
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
def lcm(a, b):
    return abs(a*b)//gcd(a, b)

n = int(input())
ans = int(input())
for i in range(1, n):
    t = int(input())
    ans = lcm(ans, t)
print (ans)
# Judge status: Accepted
import math

N=input()
N=int(N)

print(math.factorial(N)%((10**9)+7))
# Judge status: Accepted
import sys
import math,bisect
sys.setrecursionlimit(10 ** 5)
from collections import defaultdict
from itertools import groupby,accumulate
from heapq import heapify,heappop,heappush
from collections import deque,Counter,OrderedDict
def I(): return int(sys.stdin.readline())
def neo(): return map(int, sys.stdin.readline().split())
def Neo(): return list(map(int, sys.stdin.readline().split()))
n = I()
A,B = [],[]
for i in range(n):
    a,b = neo()
    A += [a+b]
    B += [a-b]
A.sort()
B.sort()
Ans = max(A[-1]-A[0],B[-1]-B[0])
print(Ans)
# Judge status: Wrong Answer
n = int(input())
if (n//9):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,d=map(int,input().split())
a=[[0]*d for ii in range(n)]
for ii in range(n):
  a[ii][:]=map(int,input().split())
r=0
for ii in range(n):
  for jj in range(n):
    if ii!=jj:
      d2=0
      for kk in range(d):
        d2+=(a[ii][kk]-a[jj][kk])**2
      d2=d2**0.5
      #print(d2)
      if int(d2)==d2:
        r+=1
print(r//2)
# Judge status: Accepted
N,M,X = map(int, input().split())

def python_list_add(in1, in2):
    return [a + b for a, b in zip(in1, in2)]

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

m = 1e9
for i in range(2 ** N):
	total = [0] * (M+1)
	for j in range(N):
		if((i >> j) & 1):
			total = python_list_add(total, A[j])
	if(all(elem >= X for elem in total[1:])):
		m = min(total[0],m)
if m == 1e9:
	m = -1
print(m)
# Judge status: Wrong Answer
n, m = map(int, input().split())
name = []
city = []
prefecture = [1] * n
for i in range(m):
    a = list(map(int, input().split())) + [i+1]
    city.append(a)
    name.append("{}{}".format("0" * (6 - len(str(a[0]))), a[0]))
city_1 = sorted(city, key=lambda x: x[0])
city_sorted = sorted(city, key=lambda x: x[1])

x = 1
for i in range(m):
    p, y, num = city_sorted[i]
    x = prefecture[p-1]
    name[num-1] += "{}{}".format("0" * (6 - len(str(x))), x)
    x += 1
for i in name:
    print(i)
# Judge status: Accepted
import math
a=[]
first=[]
for i in range(5):
    temp=str(input())
    a.append(temp)
    first.append(int(temp[-1]))
nin=0
nva=9

for i in range(5):
    if first[i]!=0 and first[i]<nva:
        nin=i
        nva=first[i]

ans=0
for i in range(5):
    if i!=nin:
        temmp=int(a[i])
        temmp=math.ceil((temmp-0.5)/10)*10
        ans+=temmp
    else:
        ans+=int(a[i])
print(ans)
# Judge status: Wrong Answer
n = list(input())
if len(set(n))==1:
    print('Yes')
elif n[0]==n[1] and n[1]==n[2]:
    print('Yes')
elif n[1]==n[2] and n[1]==n[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = list(input())

S_odd = S[0::2]
S_even= S[1::2]

o = set(S_odd).issubset(set(["R","U", "D"])) 
e = set(S_even).issubset(set(["L","U", "D"]))
if o + e == 2:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
N, X, T = map(int, input().split())
print((N + X - 1) // X * T)
# Judge status: Accepted
import math

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

sum_a = sum(a)
sum_b = sum(b)
num_b = 0
num_a = 0
for i in range(n):
    if a[i] > b[i]:
        num_b += a[i] - b[i]
    else:
        num_a += math.ceil((b[i]-a[i])/2)

if sum_b-sum_a >= num_b and sum_b-sum_a >= num_a:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import itertools
from operator import mul

n = int(input())
k = n
ans = n - 1
prime = []

while k != 1:
    for i in range(2,int(k**0.5)+1):
        if k % i == 0:
            prime.append(i)
            k /= i
            break
    else:
        prime.append(int(k))
        k = 1

div = list(itertools.accumulate(prime,mul))

for i in div:
    ans = min(ans,i + n//i -2)

print(ans)
# Judge status: Accepted
S,T = list(map(str,input().split()))
A,B = list(map(int,input().split()))
U = input()

if S == U:
  A = A - 1
else:
  B = B - 1

print(A,' ',B,sep='')
# Judge status: Accepted

def main():
    import sys
    A,B,C,D=map(int,input().split())
    for i in range(100):
        A=A-D
        C=C-B
        if C<=0:
            print("Yes")
            sys.exit()
        elif A<=0:
            print("No")
            sys.exit()
        

    

if __name__ == '__main__':
    main()
# Judge status: Accepted
l=[]
ind=["a","b","c"]
for i in range(3):
  l.append([i for i in input()])
next=l[0][0]
now=0  
while True:
  if not l[now]:
    print(ind[now].upper())
    break
  next=l[now][0]
  l[now].pop(0)
  now=ind.index(next)
# Judge status: Accepted
def LI():
    return list(map(int, input().split()))


A, B, C = LI()
if A < C < B or B < C < A:
    ans = "Yes"
else:
    ans = "No"
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ans = 0
mod = 10**9+7
c = [0]*62

for i in range(N):
    a = format(A[i],'b')
    a = a[::-1]
    for j in range(len(a)):
        if a[j] == '1':
            c[j] += 1

k = 1
for i in range(len(c)):
    p = c[i]*(N-c[i])
    ans += k*(p % mod) % mod
    k = k*2 % mod

print(ans%mod)
# Judge status: Accepted
a,b,c = map(int,input().split())


if((a-b) <= c):
    print(c-(a-b))
else:
    print(0)
# Judge status: Accepted
N=int(input())

turn=N//11*2

if N%11>6:
    print(turn+2)
elif N%11>0:
    print(turn+1)
else:
    print(turn)
# Judge status: Accepted
if __name__ == "__main__":
    N = int(input())
    A = sorted(list(map(int, input().split())))
    ans = 1
    for i in range(N):
        ans *= A[i]
        if ans > 10**18:
            print(-1)
            break
    else:
        print(ans)
# Judge status: Accepted
X, K, D = map(int, input().split())
if X - K * D >= 0:
    print(abs(X - K * D))
elif X + K * D <= 0:
    print(abs(X + K * D))
else:
    i = (D * K - X) // (2 * D)
    print(min( abs(X - D * K + 2 * i * D), abs(X - D * K + 2 * (i+1) * D) ))
# Judge status: Accepted
N = int(input())
MOD = 1000000000 + 7
def power_func(a, n, p):
    bi = str(format(n,"b"))#2進表現に
    res = 1
    for i in range(len(bi)):
        res = (res*res) % p
        if bi[i] == "1":
            res = (res*a) % p
    return res
print(str((power_func(10, N, MOD) - 2 * power_func(9, N, MOD) + power_func(8, N, MOD)) % MOD))
# Judge status: Accepted
a, b = list(map(str, input().split()))
my_result = b + a
print(str(my_result))
# Judge status: Accepted
# coding: utf-8
n, m, k = map(int,input().split())
flg=False
for i in range(n+1):
    for j in range(m+1):
        if i*m + (n-i)*j - i*j == k:
            flg=True
if flg:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import numpy as np
pi=np.pi
R=int(input())
print(2*pi*R)
# Judge status: Accepted
L = input().split()
H, A = int(L[0]), int(L[1])

t = 0
while H > 0:
    H -= A
    t += 1
print(str(t))
# Judge status: Wrong Answer
n,k=map(int,input().split())
d=[]
l=[]

for i in range(k):
    d=int(input())
    l.append(map(int,input().split()))
    
x=set(l)
x=list(x)
print(n-len(x))
# Judge status: Accepted
n,m=map(int,input().split())
li=[0]*n
for i in range(m):
    si,ci=map(int,input().split())
    if li[si-1] != 0 and li[si-1] !=ci:
        print(-1)
        exit(0)
    if si==1 and ci==0:
        if n>1:
            print(-1)
            exit(0)
    li[si-1]=ci
if n>1 and li[0]==0:
    li[0]=1
for i in range(n):
    print(li[i],end="")
# Judge status: Accepted
ans=0
c=[list(map(int,input().split())) for _ in range(int(input()))]
for a,b in c[::-1]:    
    if (a+ans)%b:
        ans+=(-a-ans)%b
print(ans)
# Judge status: Accepted
X,Y = map(int,input().split())

print(int(X+Y/2))
# Judge status: Accepted
K = int(input())
if K%2==0:
    print((K//2)**2)
else:
    print(-(-K//2)*(K//2))
# Judge status: Accepted
N = int(input())
if N <= 999:
    print('ABC')
else:
    print('ABD')
# Judge status: Wrong Answer
N=str(input())
if N[0]=='9' or N[1]=='9':
  print('Yes')
else:
  print('NO')
# Judge status: Accepted
a = int(input())
sen = a // 500
go = (a % 500) // 5
print('{}'.format(sen*1000+go*5))
# Judge status: Wrong Answer
H = input()
import math
print(2**(math.ceil(int(H)/2)+1)-1)
# Judge status: Accepted
import math
N, K = map(int, input().split())
print(math.ceil((N-1)/(K-1)))