peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math

n,k = map(int,input().split())
ans = 0 

if n<= k-1:
  for i in range(1,n+1):
    ans += 0.5**(math.ceil(math.log2(k/i)))
    
  print(ans*(1/n))
  
else:
  for j in range(1,k):
    ans += 0.5**(math.ceil(math.log2(k/j)))
    
  print(ans*(1/n) + ((n-k+1)/n))
# Judge status: Accepted
n, m = map(int, input().split())
ans = 0
if n > m:
    n, m = m, n
if n == 1 and m == 1:
    ans = 1
elif n == 1 or m == 1:
    ans = max(0, m - 2)
elif n == 2 or m == 2:
    ans = 0
else:
    ans = (n - 2) * (m - 2)
print(ans)
# Judge status: Accepted
x, g, b = input().split()
if int(x+g+b)%4 == 0:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
K, N = map(int, input().split())
A = list(map(int, input().split()))

KUKAN = [0] * N

for i in range(N):
    if i != N - 1:
        KUKAN[i] = A[i + 1] - A[i]
    else:
        KUKAN[N - 1] = K - A[N - 1] + A[0]

print(str(sum(KUKAN) - max(KUKAN)))
# Judge status: Accepted
N = int(input())

if N == 0:
    print(0)
else:
    ans = ""
    while N != 0:
        digit = abs(N%(-2))
        ans += str(digit)
        N -= digit
        N //= -2

    for i in reversed(range(len(ans))):
        print(ans[i],end="")
# Judge status: Accepted
a, b, c, k = map(int, input().split())
if k % 2:
    print(b - a)
else:
    print(a - b)
# Judge status: Accepted
N, L = map(int, input().split())

sumA = 0
for i in range(N):
    sumA += (L + i)
    
cur_diff = float('inf')
ans = 0
for i in range(N):
    tmp = sumA - (L + i)
    diff = abs(sumA - tmp)
    if diff < cur_diff:
        cur_diff = diff
        ans = tmp
        
print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
s,p,r=map(int,input().split())
t=input()
a=0
for i in range(k):
    d=1
    for j in range(i,n-k,k):
        if t[j]==t[j+k]:
            d+=1
        else:
            a-=(-d//2)*eval(t[j])
            d=1
    a-=(-d//2)*eval(t[j+k])
print(a)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
print(max(a*c,b*c,a*d,b*d))
# Judge status: Wrong Answer
#!/usr/bin/env python3
n, m, *a = map(int, open(0).read().split())
d = n - sum(a)
print(d or "-1"* (d < 0))
# Judge status: Accepted
n,m=map(int,input().split())
if n==m==1:
    print(1)
    exit()
elif n==1:
    print(m-2)
    exit()
elif m==1:
    print(n-2)
    exit()
else:
    print((n-2)*(m-2))
# Judge status: Accepted
n = int(input())
s = input()

ans = [0]
for i in range(n):
    if s[i] == "I":
        ans.append(ans[i] + 1)
    else:
        ans.append(ans[i] - 1)

print(max(ans))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
count = 0
for ele in A:
    if ele % 2 != 0:
        A.remove(ele)
for ele in A:
    if ele % 3 == 0 or ele % 5 == 0:
        count += 1
print("APPROVED" if count == len(A) else "DENIED")
# Judge status: Accepted
x,y = map(int,input().split())
if y>=2*x and y<=4*x and y%2==0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a,b=map(int,input().split())
print(a%b)
# Judge status: Accepted
lst=map(int,input().split())
lst=sorted(lst)
m=lst[0]
n=lst[1]

if m!=1:
    ans=m*n-2*(m+n)+4
    print(ans)
else:
    if n==1:
        print(1)
    else:
        print(n-2)
# Judge status: Wrong Answer
from itertools import product
A,B,C,D = list(input())
for k in list(product(['+','-'],repeat=3)):
    k = A + k[0] + B + k[1] + C + k[2] + D
    if eval(k) == 7:
        print('{}=7'.format(k))
# Judge status: Accepted
import sys
import math

def main():

    input = sys.stdin.readline

    a,b = map(int, input().split())
    a_total = 1 
    ans = 0
    while (a_total < b):
        a_total += a-1
        ans +=1
    print(ans)
    

if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b = map(int,input().split())

if min(a,b) == 1:
    print(1)
    exit()

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
            arr.append(i)
    if temp!=1:
        arr.append(temp)
    if arr==[]:
        arr.append(n)
    return arr

A = factorization(a)
B = factorization(b)
ans = len(set(A) & set(B))
print(ans+1)
# Judge status: Wrong Answer

s = str('101')

s_tuple = s[0:1],s[1:2],s[2:3]

i = 0

for sb in s_tuple:
  if sb == '1':
    i = i + 1

print(i)
# Judge status: Accepted
import sys

s=input()
c_count=0
flag=False


for ss in s:
    if ss.isupper():
        if ss!='A' and ss!='C':
            print('WA')
            sys.exit()

if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            c_count+=1

if c_count==1:
    flag=True

if flag:
    print("AC")
else:
    print("WA")
# Judge status: Wrong Answer
a,b,c=map(int,input().split()) 
print("Yes" if a<=c<=b else "No" )
# Judge status: Wrong Answer
n,d=map(int,input().split())
print(n%(d*2+1) if n%(d*2+1)==0 else n//(d*2+1)+1)
# Judge status: Accepted
import math

N=int(input())
a = [int(i) for i in input().split()]

flag=""
for i,ia in enumerate(a):
    if (i+1)==ia:
       flag += "1"
    else:
        flag += " "

flags=flag.split()

count =0
for iflg in flags:
    count += math.ceil(len(iflg)/2)

print(count)
# Judge status: Wrong Answer
N, X = map(int, input().split())
L = list(map(int, input().split()))

m = 0
ans = 0
for l in L:
    m += l
    ans += 1
    if m > X:
        print(ans)
        exit()

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

l = len(str(n))
top = n // (10**(l-1))

s = 0
for i in range(l):
	s += int(str(n)[i])

if top == 1:
	print(max(9 * (l - 1), s))
else:
	print(max(top - 1 + 9 * (l - 1), s))
# Judge status: Wrong Answer
A, B, X = map(int, input().split())

(B//X) - (A//X) + 1

print((B//X) - (A//X) + 1)
# Judge status: Accepted
import collections
N = int(input())
c = input()
A = collections.Counter(c)["R"]
B = collections.Counter(c[A:])["R"]
print(B)
# Judge status: Wrong Answer
import math


nums = [int(e) for e in input().split()]

a = nums[0]
b = nums[1]
n = nums[2]

max_score = -1
score = -1

for x in range(1, n+1):
    score = math.floor(a*x/b) - a* math.floor(x/b)
    if max_score < score:
        max_score = score
        x += 1
    else:
        break

print(max_score)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
ans=min(b,d)-max(a,c)
if ans<0:
    print(0)
else:
    print(ans)
# Judge status: Accepted
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

bingo = 'No'

for t in zip(*a):
    a.append(list(t))

a.append([a[i][i] for i in range(3)])
a.append([a[i][2-i]for i in range(3)])

for line in a:
    if all(item in b for item in line):
        bingo = 'Yes'

print(bingo)
# Judge status: Accepted
N = input("")
N = int(N)
SUM = 0
for i in range(N):
    a = i+1
    if (i+1)%3 != 0:
        if (i+1)%5 != 0:
            SUM = SUM + i+1

print(SUM)
# Judge status: Wrong Answer
print(eval(input().replace(' ','+'))//24)
# Judge status: Accepted
#!/usr/bin/env python3
import sys


def solve(a: int):
    print(a + a**2 + a**3)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    solve(a)

if __name__ == '__main__':
    main()
# Judge status: Accepted
x = input()
scount, tcount, c = 0, 0, 0
for i in range(len(x)):
  if x[c]=="S":
    scount+=1
  else:
    if scount>0:
      scount-=1
    else:
      tcount+=1
  c+=1
print(tcount*2)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for i in range(N):
    B[A[i]-1]=i+1
print(B)
# Judge status: Accepted
def calc(a):
    return a+(a**2)+a**3

if __name__ == "__main__":
    a = int(input())
    print(calc(a))
# Judge status: Wrong Answer
x,y = map(int,input().split())

# print(y-x*2)
if y-x*2 <= x:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from collections import Counter
N,*D = map(int, open(0).read().split())
MOD = 998244353
c = Counter(D)
cnt = 1
M = max(c.keys())
ans = 1
if D[0]!=0 or c[0]!=1:
  print(0)
  import sys
  sys.exit()
while cnt<=M:
  ans *= c[cnt-1]**c[cnt]
  ans %= MOD
  cnt += 1
print(ans)
# Judge status: Wrong Answer
s = input()
l1 = len(s)
res = 0
if l1%2 ==0:
    for i in range(l1//2):
        if s[i]!=s[-i-1]:
            res +=1
else :
    for i in range(l1//2):
        if s[i]!=s[-i-1]:
            res +=1
print(res)
# Judge status: Accepted
import math
from decimal import *

n = int(input())
nos = list(map(int, input().split()))
arr = [0 for i in range(n)]
if(n>1):
    arr[1] = abs(nos[1]-nos[0])
for i in range(2, n):
    a ,b = abs(nos[i]-nos[i-1])+arr[i-1], abs(nos[i]-nos[i-2])+arr[i-2]
    if(a>b):
        arr[i]=b
    else:
        arr[i] = a
print(arr[n-1])
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range(N):
  B.append(A[i]-i-1)
B.sort()
b=B[N//2-1]
sad=0
for j in range(N):
  sad=sad+abs(B[j]-b)
print(sad)
# Judge status: Wrong Answer
s = input()
t = input()
ans = float("inf")
for idx in range(len(s)-len(t)):
    score = 0
    for idx2 in range(len(t)):
        if s[idx+idx2] != t[idx2]:
            score += 1
    ans = min(ans, score)
print(ans)
# Judge status: Wrong Answer
n,k = map(int, input().split())
s = input()

rl_cnt = 0
for s1,s2 in zip(s[:-1],s[1:]):
    if s1 == 'R' and s2 == 'L':
        rl_cnt += 1

left_happy = 1 if s[0] == 'R' else 0
right_happy = 1 if s[-1] == 'L' else 0

first_happy = n - rl_cnt*2 -2 + left_happy + right_happy
# print(first_happy)
if k <= rl_cnt:
    print(first_happy + k*2)
else:
    rem = k-rl_cnt
    ans = first_happy + rl_cnt*2 + min(rem, left_happy+right_happy)
    print(ans)
# Judge status: Wrong Answer
def main():
    from itertools import accumulate
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    p_acc = tuple(accumulate(p))
    print(p, p_acc)
    p_max = 0
    for i in range(n-k):
        p_max = max(p_acc[i+k]-p_acc[i], p_max)
    print((p_max+k)/2)
    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n,m,x=map(int,input().split())
ca=[list(map(int,input().split())) for _ in range(n)]
ans=[-1]*m
tmp=[0]*m
for i in range(2**n):
  for j in range(n):
    if (i>>j)&1:
      for k in range(m):
        tmp[k]+=ca[j][k]
  for j in range(1,m):
    if tmp[j]<x:
      break
  else:
    if ans[0]>tmp[0] or ans[0]<0:
      ans=tmp
  tmp=[0]*m
print(ans[0])
# Judge status: Wrong Answer
n=int(input())

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

needsearch=[]

for i in range(n):
    a[i]-=(i+1)
    needsearch.append(-2*(i+1)-a[i])

counter=[0]*(2*(10**5))

for i in range(n):
    if 0<a[i]+10**5<2*(10**5):
        counter[a[i]+10**5]+=1

ans = 0
for i in range(len(needsearch)):
    if 0<needsearch[i]+10**5<2*(10**5):
        ans += counter[needsearch[i]+10**5]
    if 0<a[i]+10**5<2*(10**5):
        counter[a[i]+10**5]-=1

print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
res=k
for i in range(n):
  a,b=map(int,input().split())
  res-=b
  if res<=0:
    print(a)
    exit()
# Judge status: Accepted
from math import gcd

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

ans = 0
for i in a:
    ans = gcd(ans, i)
print(ans)
# Judge status: Accepted
N,x=map(int, input().split())
A = list(map(int, input().split()))

ans=0

if A[0] > x:
    ans += A[0]-x
    A[0]=x

for i in range(N-1):
    if A[i]+A[i+1] > x:
        ans +=  A[i]+A[i+1] -x
        A[i+1] = x-A[i]

print(ans)
# Judge status: Accepted
if __name__ == "__main__":
    s = input()

    ans = int(s[0]) + int(s[1]) + int(s[2])

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

b = [0 for i in range(n)]

cnt = 0
for i in range(n):
    if i - a[i] >= 0:
        cnt += b[i - a[i]]
    if i + a[i] < n:
        b[i + a[i]] += 1
print(cnt)
# Judge status: Accepted
N, X, T = map(int,input().split())
ans = -(-N // X) * T
print(ans)
# Judge status: Accepted
tmp = list(input().split())
H = int(tmp[0])
N = int(tmp[1])

tmp = list(input().split())
sum = 0

for i in range (N) :
    sum += int(tmp[i])

print ('Yes' if sum >= H else 'No')
# Judge status: Accepted
if int(input()) < 30:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
n,l=map(int,input().split())
list=[]
for i in range(1,n+1):
  a=i+l-1
  list.append(a)
A=sum(list)
cnt=0
for i in list:
  if i<0:
    cnt+=1
if cnt==n:
  print(A-list[-1])
elif 0 in list:
  print(A)
elif cnt==0:
  print(A-list[0])
# Judge status: Accepted
N = int(input())
S = list(input())
n = len(S)
for i in range(n):
    num = ord(S[i])
    num += N
    if num >90:
        num -= 26
    S[i] = chr(num)
print("".join(S))
# Judge status: Accepted
N = int(input())

memo = [2, 1]
for i in range(2, N+1):
    num = memo[i-2] + memo[i-1]
    memo.append(num)

print(memo[-1])
# Judge status: Accepted
n = int(input())
ls = [2,4,5,7,9]
if n % 10 in ls:
    print("hon")
elif n % 10 == 3:
    print("bon")
else:
    print("pon")
# Judge status: Accepted
import numpy as np
n=int(input())
sm=0
za=[]
def dis(x,y):
  x=np.array(x)
  y=np.array(y)
  return np.linalg.norm(x-y)
for i in range(n):
  za.append(list(map(int,input().split())))

for i in range(n):
  for j in range(n):
    sm+=dis(za[i],za[j])
print(sm/n)
# Judge status: Wrong Answer
N=int(input())
li=list(map(int,input().split()))
cnt=0
for i in range(N):

  if li[i]%2!=0 and i%2==1:
    cnt+=1
    
print(cnt)
# Judge status: Accepted
def main():
    t = list(map(int, input().split()))
    print(t[0]*t[1] // 2)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N, M = map(int, input().split())
print(int(N*(N-1)/2+M*(M-1)/2))
# Judge status: Wrong Answer
n = int(input())
s = list(input())
t = list(input())

length = len(set(s+t))

if length <= n:
    print(n)
else:
    print(length)
# Judge status: Wrong Answer
k, a, b = map(int, input().split())
  
if b/a <= 2 or k-(a-1) <= 0:
    ans = 1 + k
else:
    k = k - (a-1)
    ans=(b-a) * ((k//2) -1) + b * (k//2) + k%2

print(int(ans))
# Judge status: Accepted
n, k = map(int, input().split())
x = tuple(map(int, input().split()))

md = 20**8 + 1
for l in range(n-k+1):
    r = l+k-1
    md = min(md, abs(x[l]) + abs(x[l] - x[r]))
    md = min(md, abs(x[r]) + abs(x[l] - x[r]))
print(md)
# Judge status: Wrong Answer
icase=0
if icase==0:
    n,m,x,y=map(int,input().split())
    xi=list(map(int,input().split()))        
    yi=list(map(int,input().split()))        
    if max(xi)<min(yi):
        print("No War")
    else:
        print("War")
# Judge status: Accepted
import math
N,M=map(int,input().split())
s=N*(N-1)/2
m=M*(M-1)/2
print(math.floor(s+m))
# Judge status: Accepted
a,b,k=map(int,input().split())
s=set()
for i in range(k):
    if(a+i<=b):s.add(a+i)
    if(b-i>=a):s.add(b-i)
s=sorted(s)
for x in s:
    print(x)
# Judge status: Wrong Answer
S=list(str(input()))
temp=[]
ans=0
last=S[0]
for i in range(1,len(S)):
    temp.append(S[i])
    if temp!=last:
        last=temp
        temp=[]
        ans+=1
    
print(ans)
# Judge status: Accepted
A,B,C = map(int,input().split())
print((C//A)*B)
# Judge status: Accepted
A,B = (int(x) for x in input().split())
if A == B:
  print ('Draw')
elif A > B:
  if A == 13 and B == 1:
    print ('Bob')
  else:
    print ('Alice')
else:
  if A == 1 and B == 13:
    print ('Alice')
  else:
    print ('Bob')
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

aA_n=[0]
for i in range (N):
    aA_n.append(A[i]+aA_n[-1])
aA_n=aA_n[1:]


rA=A[::-1]
aA_r=[0]
for i in range (N):
        aA_r.append(rA[i]+aA_r[-1])
aA_r=aA_r[1:]
aA_r=aA_r[::-1]

ans=aA_n[-1]
for i in range (N-1):
    _tempans=abs(aA_n[i]-aA_r[i+1])
    if _tempans<ans:
        ans=_tempans

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

b=[0]*n

for i in range(n-1,-1,-1):
    if not sum(b[i+1:n:i+1]) %2 and a[i]==1:
        b[i] = 1 

print(sum(b))
print(" ".join([str(i)  for i in b if i== 1]))
# Judge status: Accepted
n,d=map(int,input().split())
k=2*d+1
if n%k==0:
    print(n//k)
else:
    print(n//k+1)
# Judge status: Accepted
import sys

n = int(input())

for i in range(1,10):
  x = n/i
  y = n%i

  if y != 0:
      continue

  if 1<=x<=9:
      print("Yes")
      sys.exit()

print("No")
# Judge status: Accepted
N,M = map(int,input().split())
H = list(map(int,input().split()))
lst = [ list(map(int,input().split())) for _ in range(M)]
hill = []
for i in range(N):
    hill.append([])

for i in range(M):
    hill[lst[i][0]-1].append(lst[i][1])
for j in range(M):
    hill[lst[j][1]-1].append(lst[j][0])


cnt = 0

for k in range(N):
    tmp = True
    for l in hill[k]:
        if H[k] <= H[l-1]:
            tmp = False
    if tmp:
        cnt += 1

print(cnt)
# Judge status: Wrong Answer
N, T = map(int, input().split())
arrc = []
arrt = []

for i in range(1,N+1):
  c, t = map(int, input().split())
  arrc.append(c)
  arrt.append(t)

if min(arrt) > T:
  print("TLE")
else:
  temp = arrt.index(min(arrt))
  print(arrc[temp])
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 11:42:53 2020

@author: shinba
"""

x,a,b = map(int,input().split())

if abs(x-a) > abs(x-b):
    print("B")
else:
    print("A")
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
k=b-a+1
if a%x!=0 and a!=0:
  k2=x-(a%x)
elif a%x==0 and a!=0:
  k2=0
else:
  k2=1

k-=k2
if k<0:
  print(0)
else:
  print(k//x+1)
# Judge status: Wrong Answer
l, r = map(int, input().split())
m = 2018
for i in range(l, r):
    for j in range(i + 1, r + 1):
        m = min(m, (i * j) % 2019)
        if m == 0:
            print('0')
            break
print(m)
# Judge status: Accepted
##C
X,N = map(int,input().split())
P = list(map(int,input().split()))
i=0
j = 0
while X+i<=101:
    if X+i not in P:
        ans1 = X+i
        break
    i += 1
while X-j>=-1:
    if X-j not in P:
        ans2 = X-j
        break
    j += 1
if ans1-X>=X-ans2:
    print(ans2)
else:
    print(ans1)
# Judge status: Accepted
def solve2():
    n = int(input())
    s = list(input())

    r = s.count('R')
    g = s.count('G')
    b = s.count('B')

    cnt = 0
    for i in range(n):
        for j in range(i+1,n):
            k = j*2-i
            if k >= n:
                break
            elif s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
                cnt +=1
    return r*g*b - cnt

print(solve2())
# Judge status: Accepted
s=list(input())
id_1=['1' if i%2 else '0' for i in range(len(s))]
id_2=['0' if i%2 else '1' for i in range(len(s))]
cnt=[0,0]
for si,id1,id2 in zip(s,id_1,id_2):
  cnt[0] += si!=id1
  cnt[1] += si!=id2
print(min(cnt))
# Judge status: Accepted
N=int(input())
happy=[]
dp=[[0,0,0] for r in range(N)]
for i in range(N):
  happy.append(list(map(int,input().split())))
dp[0]=happy[0].copy()
for i in range(1,N):
  for j in range(3):
    for k in range(3):
      if j != k :
        dp[i][j]=max(dp[i-1][k]+happy[i][j],dp[i][j])
        

  
print(max(dp[N-1]))
# Judge status: Accepted
from collections import deque

def main():
    n = int(input())
    a = list(map(int, input().split()))
    r = deque()
    for ia in range(n):
        if ia % 2 == 1:
            r.appendleft(a[ia])
        else:
            r.append(a[ia])

    if n % 2 == 1:
        r.reverse()
    for i in range(n):
        print(r[i], end = ' ')



if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = input().split()
a = list(map(int, input().split() ))
count = 0

while(True):
    T = False
    for i in range(len(a)):
        a[i] = a[i] / 2
        if a[i]%2 != 0:
            T=True

    count+=1
    if T:
        break

print(count)
# Judge status: Wrong Answer
N, K =map(int, input().split())
print(N%K)
# Judge status: Accepted
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]
for i in range(1,n+1):
    d.append(d[i-1]+l[i-1])

ans = 0

for dd in d:
    if dd <= x:
        ans += 1
print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
import numpy as np
def main():
    r=int(input())
    print(2*np.pi*r)

if __name__=='__main__':
    main()
# Judge status: Accepted
a = input()
if a == "SUN":
  print(7)
elif a == "MON":
  print(6)
elif a == "TUE":
  print(5)
elif a == "WED":
  print(4)
elif a == "THU":
  print(3)
elif a == "FRI":
  print(2)
elif a == "SAT":
  print(1)
# Judge status: Wrong Answer
s = input()
check = 'keyence'

if s[0] != 'k' and s[-1] != 'e':
    print('NO')
else:
    if s[:7] == check or s[-7:] == check:
        print('YES')
    else:
        for i in range(1, 7):
            if s[:i] + s[-(7 - i):] == check:
                print('YES')
                exit()
            # print(s[:i], s[-(7 - i):])
    print('NO')
# Judge status: Accepted
s = input().split()
print(int(15)-(int(s[0])+int(s[1])+int(s[2])+int(s[3])+int(s[4])))
# Judge status: Accepted
x, y, z = map(int, input().split())
print('{} {} {}'.format(z, x, y))
# Judge status: Wrong Answer
l = list(map(int, input().split()))
k = int(input())
ans = sum(l) + max(l)*2**(k-1)
print(ans)
# Judge status: Accepted
x, a, b = map(int, input().split())
ar = abs(x - a)
br = abs(x - b)

if br < ar:
    print("B")
elif br > ar:
    print("A")
# Judge status: Accepted
n=int(input())
buka = [0]*n
for joushi in input().split():
  buka[int(joushi)-1] += 1
print(*buka,sep='\n')
# Judge status: Wrong Answer
def main():
  def stringConcat(s,t):
    return t+s
  
print(main())
# Judge status: Accepted
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,m=nii()

mod=10**9+7

dp=[-1 for i in range(n+1)]
dp[0]=1
dp[1]=1
for i in range(m):
  a=int(input())
  dp[a]=0

for i in range(2,n+1):
  if dp[i]==0:
    continue
  num=dp[i-2]+dp[i-1]
  num%=mod
  dp[i]=num

print(dp[-1])
# Judge status: Accepted
import numpy as np
A = np.array([list(map(int,list(input().split()))) for i in range(3)])
N = int(input())
b = [int(input()) for i in range(N)]

hit = np.zeros_like(A)

for n in b:
	hit[A == n] = 1
if np.sum(np.sum(hit, 0) == 3):
	print('Yes')
elif np.sum(np.sum(hit, 1) == 3):
	print('Yes')
elif hit[0, 0] + hit[1, 1] + hit[2, 2] == 3:
	print('Yes')
elif hit[2, 0] + hit[1, 1] + hit[0, 2] == 3:
	print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
w, h = map(int, input().split(' '))
if w%2 == 1 and h%2 == 1:
  t = (w-1)*(h-1)/2
  n = t - 1
else:
  n = (w * h) / 2
  print(n)
# Judge status: Accepted
N,M,K=map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

import bisect
for i in range(1,N):
    A[i] += A[i-1]
for i in range(1,M):
    B[i] += B[i-1]


res = bisect.bisect_right(B,K)

for i in range(N):
    if K >= A[i]:
        j=bisect.bisect_right(B,K-A[i])
        res=max(res, i+1+j)

print(res)
# Judge status: Accepted
x = int(input()) 
y = 0

for i in range(x+1):
    y += i 


print(y)
# Judge status: Accepted
A, B = list(map(int, input().split()))

ans = -1
i = 1
while i < 2000:

    a = int(i * 1.08) - i
    b = int(i * 1.1) - i
    if A == a and B == b:
        ans = i
        break
    i += 1
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = a[0]
num = 2
idx = 1
while num<n:
    if num+1==n:
        ans += a[idx]
        num += 1
    else:
        ans += a[idx]*2
        num += 2
        idx += 1
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a*b == 0:
  print('Even')
else:
  print('Odd')
# Judge status: Accepted
import numpy as np
import fractions
from functools import reduce

def gcd(numbers):
    return reduce(fractions.gcd, numbers)

N, X = map(int, input().split())
x = np.array(list(map(int, input().split())))
if N == 1:
    print(np.abs(x[0] - X))
else:
    x = np.abs(x - X)
    print(gcd(x))
# Judge status: Wrong Answer
x=[]
for i in range(0,4):
  x.append(int(input()))
s=0
for j in range(0,x[0]):
  if j+1<x[1]:
    s+=x[2]
  else:
    s+=x[3]
    
print(s)