peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
A = sorted(list(map(int, input().split())))

m_a = max(A)+1
dp = [0]*m_a

for i in A:
    dp[i] += 1
    if dp[i]==1:
        for j in range(i*2, m_a, i):
            dp[j] += 2
    # print(dp)
print(dp.count(1))
# Judge status: Accepted
n, m, q = map(int, input().split())
check = [list(map(int, input().split())) for _ in range(q)]


def calc(r):
    res = 0
    for a, b, c, d in check:
        if r[b-1] - r[a-1] == c:
            res += d
    return res


def dfs(t):
    if len(t) == n:
        return calc(t)

    res = [dfs(t + [i]) for i in range(t[-1], m+1)]

    return max(res)


ans = [dfs([i]) for i in range(1, m+1)]

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

print(-(-(a+b)//2))
# Judge status: Wrong Answer
n = input()

count = 0
if(n[0]=='1'):
  count+=1
elif(n[1]=='1'):
  count+=1
elif(n[2]=='1'):
  count+=1

print(count)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

l = [i for i in a if i%2 == 0]
tmp = [i for i in a if i%2 == 0]

while l:
    e = l.pop()
    if e % 2 == 0:
        tmp.append(e)

while tmp:
    l.append(tmp.pop())

while tmp:
    e = tmp.pop()
    if e % 3 == 0:
        l.append(e)

while l:
    tmp.append(l.pop())

while tmp:
    e = tmp.pop()
    if e % 5 == 0:
        l.append(e)

while l:
    tmp.append(l.pop())


if tmp != l:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Accepted
import fractions
from functools import reduce
N = int(input())
T = [int(input()) for _ in range(N)]

def lcm(a,b):
    return (a*b)//fractions.gcd(a,b)

def lcm_list(lst):
    return reduce(lcm,lst)

print(lcm_list(T))
# Judge status: Accepted
n=input().rstrip().split()
n=[int(x) for x in n]

if abs(n[1]-n[0])<abs(n[2]-n[0]):
  print("A")
else:
  print("B")
# Judge status: Wrong Answer
s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3] or s[3] == s[0] and s[0] == s[1] or s[1] == s[2] or s[2] == s[3] or s[3] == s[0]:
    print("Yes")
else:
    print('No')
# Judge status: Accepted
s = input().split()
number = int(s[0])
length = int(s[1])

words = []

for num in range(number):
    x = input()
    words.append(x)

words.sort()

for num in words:
    print(num, end='')
# Judge status: Wrong Answer
n,d = map(int,input().split())
x = [0]*n
for i in range(n):
    x[i] = list(map(int,input().split()))
count = 0
for i in range(n):
    for j in range(n):
        dis2 = 0
        for k in range(d):
            dis2 += (x[i][k]-x[j][k])**2
        dis = float((dis2)**0.5)
        if dis.is_integer() == True:
            count += 1
print(int(count-n))
# Judge status: Wrong Answer
a,b,m = (int(x) for x in input().split())

aa = list(map(int, input().split()))
bb = list(map(int, input().split()))

xyc = [[0]*3]*m

for i in range(m):
    xyc[i][0],xyc[i][1],xyc[i][2] = (int(x) for x in input().split())

ma = min(aa)
mb = min(bb)
ans = ma+mb

for i in range(m):
    sum = aa[xyc[i][0] -1] + bb[xyc[i][1] -1] - xyc[i][2]
    if ans > sum:
        ans = sum

print(ans)
# Judge status: Accepted
str_ = input()
print('Yes') if 'A' in str_ and 'B' in str_ else print('No')
# Judge status: Accepted
n = int(input())
t,x,y = 0,0,0
for i in range(n):
  nt, nx, ny  = map(int, input().split())
  if not(abs(nx-x)+abs(ny-y) <= nt-t and t%2 == (x+y)%2):
    print("No")
    exit()
  t,x,y = nt,nx,ny
print("Yes")
# Judge status: Accepted
S = input()

temp2 = 0
for i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
    temp1 = S.count(i)
    if temp1 == 2:
        temp2 += 1

if temp2 == 2:
    print("Yes")
else :
    print("No")
# Judge status: Accepted
n,q=map(int,input().split())
s=input()

lst=[0]
for i in range(1,n):
    if s[i-1]=="A" and s[i]=="C":
        lst.append(lst[i-1]+1)
    else:
        lst.append(lst[i-1])

for i in range(q):
    l,r=map(int,input().split())
    print(lst[r-1]-lst[l-1])
# Judge status: Accepted
k = int(input())
seven = 7
ans = -1

for i in range(1,k+1):
    seven %= k
    if seven  == 0:
        ans = i
        break
    else:
        seven = seven * 10 + 7

print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python3

N = int(input())
# S = input()
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
mod = 10 ** 9
from functools import reduce
from fractions import gcd

def main():
    T = list(set([int(input()) for _ in range(N)]))
    if len(T) == 1:
        print(T[0])
        exit()
    ans = (T[0] * T[1]) // gcd(T[0], T[1])
    for i in range(len(T) - 2):
        ans = ans / (gcd(ans, T[i])) * T[i]
    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a = input()
frm = int(a[:2])
lat = int(a[2:])


if frm > 12 and lat > 12:
    print('NA')
elif frm <= 12 and lat > 12:
    if 0<frm:
        print('MMYY')
    else:
        print('NA')    
elif frm > 12 and  lat <= 12:
    if lat > 0:
        print('YYMM')
    else:
        print('NA')
elif frm <= 12 and lat==0:
    print('MMYY')
elif frm == 0 and  lat <= 12:
    print('YYMM')
else:
    print('AMBIGUOUS')
# Judge status: Accepted
A,B,C = map(int,input().split())

max = B//A
if max>C:
  print(C)
else:
  print(max)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
flag = []

for i in range(N-1):
  if A[i]<=A[i+1]:
    flag.append(1)
  elif i>0 and A[i]==A[i+1]:
    flag.append(flag[i-1])
  else:
    flag.append(-1)

ans = 1
c = 1
for i in range(N-2):
  if flag[i]!=flag[i+1] and c!=0:
    ans+=1
    c=0
  else:
    c+=1

print(ans)
# Judge status: Accepted
n=int(input())
li=[]
for i in range(n):
    a, b=map(int,input().split())
    li.append([a,b])
li=sorted(li, key=lambda x: x[0])
li=sorted(li, key=lambda x: x[1])
cnt=0
for i in range(n):
    cnt+=li[i][0]
    if cnt>li[i][1]:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
import numpy as np

a, b = map(str, input().split())
c = int(a+b)
d=np.sqrt(c)
if d.is_integer():
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
x= int(input())


cnt=1
iterate=2
while cnt<x:
    cnt+=iterate

    if x<=cnt:
        break
    iterate+=1


print(iterate)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = int(read())
v = 10 ** 9
x = (v - s % v) % v
print(0, 0, v, 1, x, (s + x) // v)
# Judge status: Accepted
A,B,C=map(int,input().split())
d=C-(A-B)
print(d if d>0 else 0)
# Judge status: Accepted
S = input()
T = input()
ss = list()
for n in range(len(S)-len(T)+1):
    for m in range(len(T)):
        if S[n+m] not in ["?", T[m]]:
            break
    else:
        ss.append((S[:n]+T+S[n+len(T):]).replace("?","a"))
if len(ss) == 0:
    print("UNRESTORABLE")
else:
    print(min(ss))
# Judge status: Wrong Answer
d, t, s = map(int, input().split())
time = d // s
if time <= t:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
s = rr()
print(s[n//2].count('W'))
# Judge status: Accepted
a,b,c = list(map(int, (input().split())))

left = 4 * a * b
right = (c-a-b) ** 2

if c-a-b < 0:
    print("No")
elif left < right:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
x = round(S/N)
ans = 0
for i in range(N):
  ans += (A[i] - x)**2
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
a=set(int(input()) for _ in range(m))
dp=[0]*(n+2)
dp[0]=1
for i in range(n):
    if i in a:
        continue
    dp[i+1]+=dp[i]
    dp[i+2]+=dp[i]
print(dp[n]%1000000007)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
x = c - a
y = d - b
print(y*'U'+x*'R'+y*'D'+(x+1)*'L'+(y+1)*'U' +
      (x+1)*'R'+"DR"+(y+1)*'D'+(x+1)*'L'+'U')
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
S = list(input())
mod = 10**9+7
from collections import Counter
c = Counter(S)
lis = []
ans = 1
for _, cnt in c.most_common():
    ans *= (cnt+1)
    ans %= mod
print((ans-1)%mod)
# Judge status: Wrong Answer
n, k, x, y = [int(input()) for _ in range(4)]
if n >= k:
    print(x*k + y*(n-k))
else:
    print(x*k)
# Judge status: Accepted
a=float(input())
s=input()
s1=list(s)
length=len(s1)
for x in s1:
    if ord(x)<97 or ord(x)>122:
        s1.remove(x)
length2=len(s1)
if length==length2 and 1<=length<=10 and 2800<=a<5000:
    if a<3200:
        print('red')
    else:
        print(s)
# Judge status: Wrong Answer
s = input()
if s[0] == 9 or s[1] == 9:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
X = int(input())

if X == 2 or X == 3 or X == 5:
    print(X)
else:
    find = True
    ans = X + 1 if X % 2 == 0 else X
    while True:
        for i in range(3, int(ans**0.5)+1, 2):
            if ans % i == 0:
                ans += 2
                find = False
                break
        if find:
            break
        find = True
    print(ans)
# Judge status: Wrong Answer
n,m = tuple(map(int,input().split()))

if n-m*2<=0:
  rest = m-n*2
  print(n+rest//4)
else:
  print(m//2)
# Judge status: Accepted
n = int(input())
A = [int(x) for x in input().split()]

B = {}
for i, a in enumerate(A):
    aa1 = i + 1 - a
    if aa1 > 0:
        if aa1 not in B:
            B[aa1] = []
        B[aa1].append((i + 1, a))

count = 0
for i, a in enumerate(A):
    aa1 = i + 1 + a
    if aa1 in B:
        count += len(B[aa1])
print(count)
# Judge status: Wrong Answer
n, k = map(int, input().split())

print(n-(n//k)*k)
# Judge status: Accepted
n = input()
ans = 0
for i in n:
  if i=='9':
    ans += 1
if ans > 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n,a,b = map(int,input().split())
su = 0
blue = 0

mo = n%(a+b)
mu = int(n/(a+b))

if mo > a:
    ma = mo-a
    blue = n-ma-b*mu
elif mo <= a:
    blue = n- b*mu

print(str(blue))
# Judge status: Wrong Answer
def main():
    n, k = map(int, input().split())
    inlis = list(map(int, input().split()))
    inlis.sort()

    if k >= n:
        print(0)
    total = sum(inlis[:-k])
    print(total)

    
if __name__ == "__main__":
    main()
# Judge status: Accepted
import sys
s = list(input())
t = list(input())
for i in range(len(s)):
    if t == s[i:] + s[:i]:
        print("Yes")
        sys.exit()
print("No")
# Judge status: Wrong Answer
a= input().strip()
b=set(a)
if len(a)==len(b):
    print("yes")
else:
    print("no")
print(len(a),len(b))
# Judge status: Wrong Answer
N, M=map(int, input().split())

if M*2<=N:
  for i in range(1, M+1):
    print(i, N-i+1)
else:
  for i in range(1, N//2):
    print(i, N-i)
# Judge status: Accepted
s=input()
cnt=0
for i in range(len(s)//2):
    if s[i]!=s[-(i+1)]:
        cnt+=1
print(cnt)
# Judge status: Accepted
str = input()
if str[-1] == "s":
    print(str + "es")
else:
    print(str + "s")
# Judge status: Accepted
X = int(input())
res = X//11*2
X %= 11
res += X//6
X %= 6
if X:
    res += 1

print(res)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    S=[input() for i in range(N)]
    s=set(S)
    print(len(s))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
K = 60

bit_nums = [0 for _ in range(K)]
ans = 0
mod = 10 ** 9 + 7

for i in range(K):
    bit_nums[i] = np.sum([A >> i & 1])
    
ans = 0
for i in range(K):
    ans += (2 ** i) * (bit_nums[i] * (N - bit_nums[i]))
    ans %= mod
  
print(ans)
# Judge status: Accepted
import fractions

n = int(input())
t = [int(input()) for i in range(n)]
ans = t[0]
for i in range(1, n):
    ans = ans * t[i] // fractions.gcd(ans, t[i])
    
print(ans)
# Judge status: Accepted
n=input()
s=0
for i in range(len(n)):
    s+=int(n[i])
    s=s%9
if s==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, c = map(int, input().replace(" ", ""))
N = int(100*a+10*b+c)
print("YES" if N%4==0 else "NO")
# Judge status: Accepted
n, a, b, c, d = map(int, input().split())
s = input()
if '##' in s[a:max(c, d)] or (d < c and '...' not in s[b-2:d+1]):
  print('No')
else:
  print('Yes')
# Judge status: Accepted
x = int(input())

if x >=30:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
def main():
    N, M = map(int, input().split())
    if N > M:
        N, M = M, N

    if M == 1:
        print(1)
    elif N == 1:
        print(M-2)
    elif N == 2:
        print(0)
    else:
        print((N-2) * (M-2))


if __name__ == '__main__':
    main()
# Judge status: Accepted
S=list(input())
t=S[0]
count=0
for i in range(1,len(S)):
	if t==S[i]:
		S[i]=str(1-int(S[i]))
		count+=1
	t=S[i]
	
print(count)
# Judge status: Accepted
N=int(input())
P=list(map(int,input().split()))
count=0
flag=0
for i in range(N):
    if flag:
        flag=0
        continue
    if P[i]==i+1:
        count+=1
        if i!=N-1:
            if P[i+1]==i+2:
                flag=1
print(count)
# Judge status: Accepted
import sys
N = int(input())
S = (str(x) for x in sys.stdin.read().split())
cnt = {}
for s in S:
  if cnt.get(s):
    cnt[s] = cnt[s] + 1
  else:
    cnt[s] = 1
max_cnt = max(cnt.values())
keys = [k for k, v in cnt.items() if v == max_cnt]
for k in sorted(keys):
  print(k)
# Judge status: Accepted
lists = sorted(list(map(int, input().split())))

print(10*lists[2] + lists[0] + lists[1])
# Judge status: Wrong Answer
s = input()

def is_kaibun(st):
    return st[:len(st) // 2] == st[-(len(st) // 2):][::-1]

if is_kaibun(s) and is_kaibun(s[:len(s) // 2]) and is_kaibun(s[-(len(s) // 2):][::-1]):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
X = int(input())
if X >= 30:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
if len(a)==len(set(a)):
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
s=input()
if s == 'SUN':
  print('7')
elif s == 'MON':
  print('6') 
elif s == 'TUE':
  print('5') 
elif s == 'WED':
  print('4')
elif s == 'THU':
  print('3')
elif s == 'FRY':
  print('2')
else:
  print('1')
# Judge status: Accepted
import math

a,b=map(str,input().split())
c=int(a+b)
print('Yes' if (math.sqrt(c)//1)**2==c else 'No')
# Judge status: Accepted
import numpy as np
n = int(input())
a = np.sort(np.array(list(map(int, input().split()))))
max_num = a[-1]+1
dp = np.array([0]*(max_num))

if np.count_nonzero(a==1)  == 1:
    print(1)
else:
    for i in a:
        for j in np.arange(i, max_num, i):
            dp[j] += 1
    print(np.count_nonzero(dp[a] == 1))
# Judge status: Wrong Answer
x = input()
print("Yes" if x[0] == x[1] == x[2] or x[1] == x[2] == x[3] or int(x)%11 == 0 else "No")
# Judge status: Accepted
n=int(input())
time = [0]*n
for i in range(n-1):
    c,s,f = map(int,input().split())
    for j in range(i+1):
        time[j] = max(s,-(-time[j]//f)*f) + c

print("\n".join(str(t) for t in time))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
count = 0
hcount = 0
for x in a:
    if x % 4 == 0:
        count += 1
    elif x % 2 == 0:
        hcount += 1

if (count + (hcount // 2)) >= (N // 2):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
str_list=[]
tmp=[]
s=''
str_list=list(input())
for i in str_list:
    if i =='0':
        tmp.append('0')
    elif i == '1':
        tmp.append('1')
    elif i == 'B' and tmp:
        tmp.pop()
for i in range(len(tmp)):
    s+=tmp[i]
print(tmp)
print(s)
# Judge status: Accepted
k, x = map(int, input().split())

l = k*2 -1

m = x - k + 1

for i in range(l):
    print(i+m, end = " ")
# Judge status: Accepted
a,b=map(int,input().split())

for i in range(int(str(a)+str(b))):
    if (i+1)**2==int(str(a)+str(b)):
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
N, M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]

L_max = 0
R_min = N
for L, R in LR:
    L_max = max(L_max, L)
    R_min = min(R_min, R)

ans = 0
if L_max <= R_min:
    ans = R_min - L_max + 1

print(ans)
# Judge status: Accepted
x = int(input())
for i in range(1000):
    if 100*i <= x <= 105*i:
        print(1)
        exit()
print(0)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

if N == 0 and A[0] == 1:
  print(1)
  exit(0)
elif A[0] > 0:
  print(-1)
  exit(0)

X = [0] * (N+1)
X[-1] = A[-1]
for i in range(N,0,-1):
  X[i-1] = X[i] + A[i-1]
  
#print(X)

wk = 2
ans = 1
for i in range(1,N+1):
  
  #print(i,X[i])
  if 0 <= A[i] <= wk:
    ans += min(wk,X[i])
    wk -= A[i]
    wk *= 2
  else:
    print(-1)
    exit(0)
  
print(ans)
# Judge status: Accepted
from collections import Counter

l=[x for x in input()];n=len(set(l));
c=Counter(l)
ans=[x for x in c.values() if x%2!=0]
print ("No" if len(ans)>0 else "Yes")
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]
a.sort(reverse=True)
b = [a[0]]
for i in range(1, n):
    b.append(a[i])
    b.append(a[i])
print(sum(b[:n - 1]))
# Judge status: Accepted
n,k = map(int,input().split())
ans = 0
for i in range(1, n+1):
    tmp = i
    cnt = 0
    while tmp < k:
        tmp *= 2
        cnt += 1
    ans += 1/n/2**cnt
print(ans)
# Judge status: Accepted
n = int(input())
x = list(map(int,input().split()))
ans = 10**15

for i in range(1,101):
  r = 0
  for j in range(n):
    r += (x[j]-i)**2
  ans = min(ans,r)

print(ans)
# Judge status: Accepted
N,H=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
B=[]
C=[]
for a,b in A:
  B.append(a)
  C.append(b)
D=sorted(B)[::-1]
b=D[0]
F=[]
for i in C:
  if b<i:
    F.append(i)
G=sorted(F)[::-1]
cnt=0
for i in G:
  H-=i
  cnt+=1
  if H<=0:
    print(cnt)
    exit()
print(cnt-((-H)//b))
# Judge status: Accepted
n=input()
ans=0
for i in range(len(n)):
    ans+=int(n[i])
if ans==int(n[0]) and len(n)>=2:
    ans+=9
print(ans)
# Judge status: Wrong Answer
def main():
    X = int(input())  # 文字列または整数(一変数)

    for B in range(0, 1000):
        for A in range(B, 1000):
            if A**5 - B**5 == X:
                print(A, B, sep=" ")
                return
            if A**5 + B**5 == X:
                print(A, B, sep=" ")
                return

if __name__ == '__main__':
    main()
# Judge status: Accepted
N,K,X,Y= [int(input()) for i in range (4)]
if N > K:
    yen1 = K * X
    yen2 = (N - K) * Y
    print(yen1 + yen2)
else:
    print(N * X)
# Judge status: Wrong Answer
import bisect
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for b in B:
    a_ind = bisect.bisect(A, b)

    if A[a_ind-1] == b:
        a_ind -=1
    c_ind = bisect.bisect(C, b)
    
    ans += a_ind*(n-c_ind)
    
print(ans)
# Judge status: Wrong Answer
n = int(input())

MOD = 10**9 + 7

allp = pow(10,n,MOD)
not09 = 2*pow(9,n,MOD)
closs = pow(8,n,MOD)

print(allp - not09 + closs)
# Judge status: Accepted
s=str(input())
s=list(s)
l=len(s)
ans=0
temp=0
for i in range(0,l):
  if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
    temp=temp+1
    ans=max(ans,temp)
  else:
    temp=0
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
ans = 0
for i in range(a, b):
    i = str(i)
    if i == i[::-1]:
        ans += 1
print(ans)
# Judge status: Wrong Answer
n,x,t=map(int,input().split())
s=n//x * t
if n%x!=0:
  s+=1
print(s)
# Judge status: Wrong Answer
import math
L, R = map(int, input().split())
l = L % 2019
length = R - L
if l + length > 2019:
  print(0)
elif length > 2017:
  print(0)
else:
  print((L * (L+1))%2019)
# Judge status: Wrong Answer
n, l = map(int, input().split())
a = [l + i for i in range(n)]
if l + n - 2 < 0:
    a.pop(n - 1)
elif l > 0:
    a.pop(0)
    print(a)
print(sum(a))
# Judge status: Accepted
s = input()
if ''.join(sorted(s)) == 'abc':
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
val = input()
splited_val = val.split()

val_list=[]

for x in range(int(splited_val[0])):
    val = input()
    val_list.append(val)

print(sorted(val_list))
# Judge status: Accepted
print("ABC"if int(input())<=999 else "ABD")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
ans=0
k=1
for i in range(61):
    count0=0
    count1=0
    for j in a:
        if not (j>>i & 1):
            count0+=1
        if j>>i & 1:
            count1+=1
    ans+=((count0*count1)*(k))%mod
    k=(2*k)%mod
    
    
print(ans%mod)
# Judge status: Wrong Answer
X = int(input())
cnt = 1

a = X - 400 // 200
for i in range(1,9):
    if  7 <= a < 8:
        print(cnt)
    else:
        cnt += 1
        a += 400
# Judge status: Wrong Answer
N=int(input())
S=input()

from collections import defaultdict
d=defaultdict(int)
ans = 0
for i,s in enumerate(S):
    ans += 2 **(i-d[s])
    d[s] += 1
    #print(ans)
print(ans)
# Judge status: Accepted
S_ = input()
T = input()

if len(S_) < len(T):
  print('UNRESTORABLE')
  exit()

i_ = -1

for i in range(len(S_)-len(T)+1):
  for j in range(len(T)):
    if S_[i+j] != T[j] and S_[i+j] != '?':
      break
    if j == len(T) - 1:
      i_ = i

if i_ == -1:      
  print('UNRESTORABLE')
else: 
  if i_ + len(T) == len(S_):
    print(S_[:i_].replace('?','a')+T)
  else:
    print(S_[:i_].replace('?','a')+T+S_[i_+len(T):].replace('?','a'))
# Judge status: Accepted
s = input()

l = len(s)

v = 'x'*l

print(v)
# Judge status: Wrong Answer
import sys

S = input()
T = input()

d = {}

for i in range(len(S)):
    if T[i] in d and d[T[i]]!=S[i]:
        print("NO")
        sys.exit()
    d[T[i]] = S[i]
print("YES")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

bs = 10**9 + 7
s = sum(a)
sm = 0

for i, ai in enumerate(a):
    s -= ai
    sm += (ai * s) % bs
    sm = sm % bs

print(sm)
# Judge status: Accepted
A, B, C, D = list(map(int, input().split()))
if A <= C:
    x = [A, B]
    y = [C, D]
else:
    y = [A, B]
    x = [C, D]
if x[1] <= y[1]:
    d = x[1] - y[0]
else:
    d = y[1] - y[0]
if d < 0:
    d = 0
print(d)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

a_sum = sum(a)
x = 0
y = 0
for i in range(n):
    x += a[i]

    if x * 2 >= a_sum:
        y = a[i]
        break

ans = min(abs(2 * x - a_sum), abs(a_sum - 2 * (x - y)))
print(ans)
# Judge status: Accepted
n = int(input())
s = set()
for i in range(n):
  s.add(input())
print(len(s))
# Judge status: Wrong Answer
import numpy as np

n, m, x = map(int, input().split(' '))
a = np.zeros([n, m])
c = np.zeros(n)

for i in range(n):
  v = list(map(int, input().split(' ')))
  a[i, :] = np.array(v[1:])
  c[i] = v[0]

INF = 10000000000000000
ans = INF

for i in range(1<<n):
  skill = np.zeros(m)
  cost = 0
  for j in range(n):
    if i & (1<<j):
      cost += c[j]
      skill += a[j]
  if all(skill >= x):
    ans = min(ans, cost)

print(ans if ans != INF else -1)
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

print(min(N, K)*X + max(N-K, 0)*Y)
# Judge status: Wrong Answer
N,K=map(int,input().split())
print(N//K+1)
# Judge status: Wrong Answer
s=input()
s=set(s)

if len(s)==3:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
s,t=map(str,input().split())
a,b=map(int,input().split())
u=str(input)

if u==s:
    print((a-1),b)
else:
    print(a,(b-1))
# Judge status: Wrong Answer
s = input()
ans = ''
for i in range(len(s)-1):
    if s[i] != 'B' and s[i+1] !='B':
        ans += s[i]
if s[-1] != 'B':
    ans += s[-1]

print(ans)
# Judge status: Accepted
X=int(input())
ans=1
while True:
  if ans*X%360==0:
    print(ans)
    break
  ans+=1
# Judge status: Wrong Answer
from sys import stdin
A,B = [float(x) for x in stdin.readline().rstrip().split()]
print(int(A*B))