peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
Q, H, S, D = list(map(int, input().split()))
Q *= 8
H *= 4
S *= 2
A = min(Q, H, S, D)
B = min(Q, H, S) // 2
N = int(input())

print(int(N//2*A+N%2*B))
# Judge status: Accepted
a,b,c=map(int,input().split())
num1=0
num2=0
num3=0
if a==b and b==c and a%2==0:
    print(-1)
else:
    for i in range(a*b*c):
        if a%2==1 or b%2==1 or c%2==1:
            break
        num1=a//2
        num2=b//2
        num3=c//2
        a=num2+num3
        b=num3+num1
        c=num1+num2
    print(i)
# Judge status: Accepted
x=list(map(int,input().split()))
if x.count(5)==2 and x.count(7)==1:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
N, A, B = map(int, input().split())

if N == 1 and A != B :
    print(0)
    exit()
if A < B :
    print(0)
    exit()

smin = (N-1)*A + B
smax = A + (N-1)*B
print(smax-smin+1)
# Judge status: Wrong Answer
n =  int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
fill = 0
cnt = 0
for f in range(n):
    fill = fill + b[a[f] - 1]
    if(f != 0 and a[f] == a[f-1] + 1):
        fill = fill + a[f-2]
        cnt = cnt + 1
    else:
        cnt = cnt + 1
print(fill)
# Judge status: Accepted
S = input()
t = S[0]
cnt = 0
bol = 0
for i in range(1,len(S)):
    if bol == 1:
        bol = 0
        continue
    if S[i] == t:
        t = 0
        cnt += 1
        bol = 1
    else:
        t = S[i]
print(len(S)-cnt)
# Judge status: Accepted
from math import *
N = int(input())
A = list(map(int,input().split()))
L = (N+1)*[0]
R = (N+1)*[0]
ans = []

for n in range(N):
  L[n]=gcd(L[n-1],A[n])

for n in range(N-1,0,-1):
  R[n]=gcd(R[n+1],A[n])

for n in range(N):
  ans+=[gcd(L[n-1],R[n+1])]

print(max(ans))
# Judge status: Accepted
D,T,S = map(int, input().split())

if D > S * T:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
s=list(input())
c0=0
c1=0
for i in range(1,len(s)):
    if s[i]==s[i-1] and s[i]=='1':
        s[i]='0'
        c0+=1
    elif s[i]==s[i-1] and s[i]=='0':
        s[i]='1'
        c0+=1
print(c0)
# Judge status: Wrong Answer
print((lambda x:('Yes' if (x[1]//500 <= x[0]) else 'No'))(list(map(int,input().split()))))
# Judge status: Accepted
from collections import defaultdict
N, M = map(int, input().split())
A = {i:0 for i in range(N+1)}
for _ in range(M):
  A[int(input())] = 1

mod = 10**9 + 7
dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
  if A[i+1] != 1: 
    dp[i+1] += dp[i]
    dp[i+1] %= mod
  if i+2 >= N+1:
    continue
  if A[i+2] != 1:
    dp[i+2] += dp[i]
    dp[i+2] %= mod

print(dp[N])
# Judge status: Wrong Answer
N = int(input())
S = input()
ans = 0
for i in range(N):
    if S[i] == "#":
        if i == N-1:
            break
        else:
            if S[i+1] == ".":
                ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
T,A = map(int, input().split())
*H, = map(int, input().split())

ans = 100000000
index = 0

for i in range(len(H)):
    temp = T-H[i]*0.006

    if abs(A-temp)<ans:
        ans = abs(A-temp)
        index = i


print(index+1)
# Judge status: Accepted
ans=0
n=int(input())
for i in range(1,n):
	for j in range(1,n):
		if i*j<n:
			ans+=1
		else:
			break
print(ans)
# Judge status: Wrong Answer
# ABC 147 A

A1, A2, A3 = map(int, input().split())

if A1 + A2 + A3 >= 22:
    print('burst')
else:
    print('win')
# Judge status: Accepted
L=int(input())
#D = L//3
#Amari = L%3
#if Amari == 0:
#    print(D**3)
#elif Amari == 1:
#    print(D*D*(D+1))
#else:
#    print(D*(D+1)*(D+1))
print(L**3/27)
# Judge status: Accepted
q,h,s,d=map(int,input().split())
n=int(input())
List1=[q*4,h*2,s]
List2=[q*8,h*4,s*2,d]
if (n%2==0):
  ans=n*min(List2)//2
  print(ans)
else:
  ans=(n-1)*min(List2)//2
  ans+=min(List1)
  print(ans)
# Judge status: Wrong Answer
n,x,t=map(int,input().split())
print(t * (n // x))
# Judge status: Accepted
n = int(input())
for i in range(10**6):
    if int(i*1.08) == n:
        print(i)
        exit()
print(':(')
# Judge status: Accepted
icase=45
if icase==45:
    a=int(input())
    b=int(input())
    h=int(input())
    print((a+b)*h//2)
# Judge status: Wrong Answer
n,k=map(int, input().split())
an = list(map(int, input().split()))

min_place = an.index(min(an))
left = (min_place+1)//2
right = (n-min_place)//2
Ans = left + right
print(Ans)
# Judge status: Accepted
fact = [1 for _ in range(1000000)]
inv = [1 for _ in range(1000000)]
fact_inv = [1 for _ in range(1000000)]

P = 10**9+7
for i in range(2, 1000000):
    fact[i] = (fact[i-1]*i) % P
    inv[i] = P - (inv[P % i] * (P // i)) % P
    fact_inv[i] = (fact_inv[i-1] * inv[i]) % P

X, Y = map(int, input().split())
res = 0
if (X+Y) % 3 == 0:
    a = (-X+2*Y) // 3
    b = (2*X-Y) // 3
    if a >= 0 and b >= 0:
        res = fact[a+b] * ((fact_inv[a] * fact_inv[b]) % P) % P
print(res)
# Judge status: Wrong Answer
degree = float(input())
max_num = 360

if(1 <= degree <= 179 and degree.is_integer() == True):
    answer = max_num / degree
    print(answer)
elif(degree.is_integer() == False):
    print(False)
else:
    print(False)
# Judge status: Wrong Answer
S = int(input())
sum_now = 1
before_number = 1
before3 = [1, 1, 1]
for i in range(6, S+1, 1):
    sum_now = sum_now + before3[i % 3]
    before3[i % 3] = sum_now

print(sum_now)
# Judge status: Accepted
Z = [int(input()) for _ in range(5)]
k = int(input())

ans = 'Yay!'
for i in range(4):
    for j in range(i, 5):
        if Z[j] - Z[i] > k:
            ans = ':('
            break
    else:
        continue
    break
print(ans)
# Judge status: Wrong Answer
splited = input().split(" ")

k = int(splited[0])
s = int(splited[1])
z = [i for i in range(k+1)]

def check_sum(p):
  l, r = 0, k
  
  while(r - l >= 1):
    i = int((r + l) / 2)
    if z[i] == p:
      return True
    elif z[i] < p:
      l = i + 1
    else:
      r = i
  return False


result = 0

for x in range(k+1):
  for y in range(k+1):
    if check_sum(s-x-y):
      result = result + 1

print(result)
# Judge status: Accepted
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

S, T = input().split()

print(T+S)
# Judge status: Accepted
S = input()
N = len(S)
K = (N-3)//2
if S == S[::-1] and S[0:K] == S[K:0:-1]:
    print ('Yes')
else:
    print ('No')
# Judge status: Accepted
a, b = map(int, input().split())

if a > 8 or b > 8:
  print(':(')
elif a <= 8 and b <= 8:
  print('Yay!')
# Judge status: Accepted
n=int(input())
s=input()
ans=[]
minscore=0
score=0
for i in range(n):
  if s[i]=='(':
    score+=1
  else:
    score-=1
  minscore=min(minscore,score)
finalscore=score
for i in range(-minscore):
  ans.append('(')
for i in range(n):
  ans.append(s[i])
for i in range(-minscore+finalscore):
  ans.append(')')
print(''.join(ans))
# Judge status: Accepted
a = input()
a = int(a)
s = (a // 500)*1000
t = ((a % 500)//5)*5
print(s+t)
# Judge status: Wrong Answer
x,y=map(int,input().split())
if 0<=x<y or x<y<=0:
  print(abs(x-y))
elif x<0<y or y<0<x:
  print(abs(abs(x)-abs(y))+1)
elif y<x<0 or 0<y<x:
  print(abs(x-y)+2)
# Judge status: Wrong Answer
S=input()
max_v =0
v =0
for i in S:
  if i=="I":
    v+=0
    if v>max_v:
      max_v=v
  else:
    v-=0
# Judge status: Accepted
def actual(X):
    pow_nums = [1]

    for i in range(2, 40 + 1):
        for j in range(2, 40 + 1):
            if i ** j <= 1000:
                pow_nums.append(i ** j)

    pow_nums = sorted(set(pow_nums))

    return [pow_num for pow_num in pow_nums if pow_num <= X][-1]


X = int(input())
print(actual(X))
# Judge status: Wrong Answer
a, b = map(int, input().split())
x = (a * b) / 2
if x % 1 == 0:
    print(x)
else:
    print(x + 0.5)
# Judge status: Wrong Answer
x,y,z=map(int,input().split())
print(str(y)+" "+str(z)+" "+str(x))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
A = sorted(A)
Asum = sum(A)
J = N%2
B = N

if J == 0:
    B -= 1
    print(Asum/2**B)
elif Asum == A[0]*N:
    print(A[0])
else:
    B -= 3
    print((((Asum-A[N-1])/(2**B))+A[N-1])/2)
# Judge status: Accepted
j = input()
if 'A'<=j and j <= 'Z':
  print("A")
else:
  print("a")
# Judge status: Accepted
A, B = map(int,input().split())

if A % 3 == 0 or B % 3 ==0 or (A + B) % 3 ==0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Accepted
# https://atcoder.jp/contests/abc164/tasks/abc164_d

import sys
input = sys.stdin.readline


S = input().rstrip()

res = 0

x = 0
p = 1
L = len(S)
MOD = 2019
reminder = [0]*2019
reminder[0] = 1
for s in reversed(S):
    """ 累積和 """
    x = (int(s)*p + x)%MOD
    p = p*10%MOD
    res += reminder[x]
    reminder[x] += 1

print(res)
# Judge status: Wrong Answer
l, r, d = map(int, input().split())
a = l // d
b = r // d
if l % d != 0:
  a = a+1
if r % d == 0:
  b = b+1
  
print(b-a+1)
# Judge status: Wrong Answer
G={chr(a+ord("a")):a for a in range(26)}
H={G[b]:b for b in G}

T=input()
S=[]
for s in T:
    S.append(G[s])
K=int(input())

I=0
N=len(S)
for i in range(N):
    if (i!=N-1) and (26-S[i]<=K):
        K-=26-S[i]
        S[i]=0
    elif i==N-1:
        S[i]=(S[i]+K)%26

U=""
for s in S:
    U+=H[s]

print(U)
# Judge status: Wrong Answer
n = int(input())
l = [int(i) for i in input().split()]
ans = 0
b = True
while b:
    for i in range(n):
        if l[i]%2==0:
            l[i]/=2
        else:
            b=False
            break
    ans+=1
print(ans)
# Judge status: Accepted
import math
from collections import Counter
from sys import exit
from itertools import product

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()
a = li()

cnt = Counter(a)
ans = 0
for i,j in cnt.items():
    if i > j:
        ans += j
    else:
        ans += j - i
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
ans = -1
for i in range(1001):
  if int(i * 0.08) == a and int(i * 0.1) == b:
    ans = i
    break;
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
s = 1
cnt = 0
while (s < b):
    s = (s-1) + a 
    cnt += 1
print(cnt)
# Judge status: Accepted
from collections import deque
s = input()
ans = deque([])

for c in s:
    if c=='0':
        ans.append('0')
    if c=='1':
        ans.append('1')
    if c=='B' and len(ans)!=0:
        del ans[-1]
print(''.join(ans))
# Judge status: Accepted
n=int(input())
s=[input() for i in range(n)] 
m=int(input())
t=[input() for i in range(m)] 
a=0
for i in set(s):
    a=max(s.count(i)-t.count(i),a)
print(a)
# Judge status: Accepted
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math
a, b, c = map(int, input().split())
if 0 < (c - a - b) and 4 * a * b < (c - a - b)**2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
X = int(input())

for a in range(-500, 500):
    for b in range(-500, 500):
        if (a**5)-(b**5) == X:
            print(a, b)
            exit(0)
# Judge status: Wrong Answer
import math
from itertools import accumulate

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

fromleft = list(accumulate(a, math.gcd))
a.reverse()
fromright = list(accumulate(a, math.gcd))
fromright.reverse()
a.reverse()

gcd = []

gcd.append(fromright[1])
for i in range(1, n-1):
    gcd.append(math.gcd(fromleft[i-1], fromright[i+1]))
    print(i, fromright[i-1], fromleft[i+1])

gcd.append(fromleft[n-2])

if n == 2:
    print(max(a[1], a[0]))
else:
    print(max(gcd))
# Judge status: Accepted
N, A, B = map(int, input().split())


ans = (N - 2) * B - (N - 2) * A + 1
ans = max(ans, 0)
print(ans)
# Judge status: Accepted
N, K = map(int,input().split())


N_list = [N,K]

if K == 1:
    print(0)
    
elif N>K:
    print(min(N%K,abs(N%K-K)))
    
elif N == K:
    print(0)
    
else:
    print(min(N,abs(N-K)))
# Judge status: Wrong Answer
N = int(input())
H = list(map(int, input().split()))
diff_H = []
for i in range(1, len(H)):
    diff_H += [H[i] - H[i - 1]]

longest = 0
streak = 0
for d_h in diff_H:
    if d_h <= 0:
        streak += 1
    else:
        longest = max(streak, longest)
        streak = 0
print(longest)
# Judge status: Accepted
s=0
n=int(input())
for i in range(1,n):
    if n%i==0:
        s+=n//i-1
    else:
        s+=n//i
print(s)
# Judge status: Accepted
N = int(input())
ans =[]
for i in range(1,N+1,2):
    count = 0
    for j in range(1,i+1):
        if i % j ==0:
            count += 1
            if count== 8:
                ans.append(i)

print(len(ans))
# Judge status: Accepted
n, q = map(int, input().split())
s = input()

acc = [0]
sum = 0
for i in range(n-1):
    # if s[i:i+2] == "AC":
    if s[i] == "A" and s[i+1] == "C":
        acc.append(acc[-1] + 1)
    else:
        acc.append(acc[-1])


for _ in range(q):
    l, r = map(int, input().split())
    print(acc[r-1] - acc[l-1])
# Judge status: Accepted
n, m = map(int, input().split())
A = [input() for _ in range(n)]
B = [input() for _ in range(m)]
for idx_row in range(n - m + 1):
    for idx_col in range(n - m + 1):
        is_ans = True
        for B_row_offset in range(m):
            if A[idx_row + B_row_offset][idx_col:idx_col + m] != B[B_row_offset]:
                is_ans = False
        if is_ans:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
# ABC 065: A – Expired?
x, a, b = [int(s) for s in input().split()]

if a - b >= 0:
    print('delicious')
elif b - a <= x:
    print('safe')
else:
    print('dangerous')
# Judge status: Wrong Answer
n, k, s = map(int, input().split())

a = [-1 for i in range(n)]

for i in range(k):
    a[i] = s

print(" ".join(map(str,a)))
# Judge status: Accepted
import sys

S = input()

count = 0
for i in range(len(S)):
    if i == 0 and S[i] != "A":
        print("WA")
        sys.exit()

    if i == len(S)-1 and count != 1:
        print("WA")
        sys.exit()

    if i != 0 and i != len(S)-2 and S[i].isupper() and S[i] != "C":
        print("WA")
        sys.exit()

    if i >= 2 and i <= len(S)-2 and S[i] == "C":
        count += 1

print("AC")
# Judge status: Wrong Answer
x,y,a,b,c = map(int,input().split())
parr = list(map(int,input().split()))
qarr = list(map(int,input().split()))
rarr = list(map(int,input().split()))
parr.sort(reverse=True)
qarr.sort(reverse=True)
rarr.sort(reverse=True)
parr = parr[:x]
qarr = qarr[:y]

tmparr = parr + rarr
tmparr.sort(reverse=True)
count = sum(tmparr[:x])

pidx = 0
for i in range(x):
    if parr[pidx] == tmparr[i]:
        pidx += 1
        
tmparr = qarr + rarr[(x-pidx):]
tmparr.sort(reverse=True)
count += sum(tmparr[:y])

print(count)
# Judge status: Wrong Answer
N, M = map(int,input().split())
a = []
for i in range(M):
  K,S = map(int, input().split())
  a.append(K)
  a.append(S)
print(a)
for i in range(N):
  print(a.count(i+1))
# Judge status: Wrong Answer
A, B, K = [int(i) for i in input().split()]

a = max(A - K, 0)
k = max(K - A, 0)
b = B - k
print("{} {}".format(a, b))
# Judge status: Accepted

n, k = map(int, input().split())
S = list(input())

S[k-1] = str.lower(S[k-1])
print("".join(S))
# Judge status: Accepted
N = int(input())

if N%10 == 0:
    print(10)
else:
    l = []
    for i in range(6):
        l.append(int(N%10))
        N /= 10
    print(sum(l))
# Judge status: Accepted
x, y, z = list(map(int, input().split()))

print((x - z) // (y + z))
# Judge status: Accepted
a=open(0).read().split();print('YNeos'[all(t-set(map(a.index,a[10:]))for t in({0,1,2},{0,3,6},{0,4,8},{1,4,7},{2,4,6},{2,5,8},{3,4,5},{6,7,8}))::2])
# Judge status: Accepted
def comb(n, r, p):
    numer = 1
    denom = 1

    for i in range(n-r+1, n+1):
        numer = numer * i % p
    for i in range(1, r+1):
        denom = denom * i % p
    return numer * pow(denom, p-2, p)

def main():
    p = pow(10, 9) + 7
    n, a, b = map(int, input().split())
    print(((pow(2, n, p) - comb(n, a, p) - comb(n, b, p) - 1)) % p)

if __name__ == "__main__":
    main()
# Judge status: Accepted
import math
a,b = map(int,input().split())
print(math.ceil(a/b))
# Judge status: Wrong Answer
a,b=map(int,input().split())
num,ans=[0],0

for i in range(1,1000):
  num.append(num[-1]+i)
  
  if num[-1]>=a:
    ans=num[-1]-a
    break
    
print(ans)
# Judge status: Accepted
from itertools import accumulate
n = int(input())
a = list(map(int, input().split()))
l = list(accumulate(a))
x = 10 ** 10
for i in range(n-1):
    x = min(x, abs(l[i]*2-l[-1]))
print(x)
# Judge status: Accepted
N = input()

print("Yes" if "7" in N else "No")
# Judge status: Accepted
n = input()
s = 0
for i in range(len(n)):
  s += int(n[i])
if s % 9 == 0:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N = int(input()) #入力値
M = str(input())
A = M.split()
print (A[1])
Bob=0
Alice=0
A.reverse() #入力した値ソート
print(A)
for i in range(0,N):
      if i % 2 == 0: # Bobが偶数なら実行
         Alice=Alice+int(A[i])
      else:
         Bob=Bob+int(A[i])
print(Alice-Bob)
# Judge status: Accepted
N = int(input())
s = input()
t = input()

for i in range(N, 0, -1):
    if s[-i:] == t[:i]:
        print(N * 2 - i)
        exit()
print(2 * N)
# Judge status: Wrong Answer
x,y = map(int,input().split())
print(x+y/2)
# Judge status: Wrong Answer
a=int(input())
b = list(map(int, input().split()))
b.sort()
S=0
c=sum(b)
for i in range(0,a):
    S=S+b[i]*(c-b[i])
print(S % (10**9+7))
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, m = map(int, input().split())
    L, R = 1, n
    for _ in range(m):
        l, m = map(int, input().split())
        if l > L: L = l
        if m < R: R = m
    if R-L+1 < 0:
        print(0)
    else:
        print(R-L+1)
    
if __name__ == '__main__':
    main()
# Judge status: Accepted
# C - Reconciled?
import math
N, M = map(int,input().split())

S = math.factorial(min(N,M)) % 1000000007

ans = 0
if abs(N-M) > 1:
    ans = 0
elif abs(N-M) == 1:
    ans = S*S*max(N,M)
else:
    ans = S*S*2

ans = ans % 1000000007

print(ans)
# Judge status: Accepted
import math

stMap = map(int, input().split())
st = list(stMap)

if (math.ceil(st[0] / st[3]) >= math.ceil(st[2] / st[1])):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = list(input())
s.reverse()
r = [0 for _ in range(2019)]
p = 0
for i in range(len(s)):
    p += pow(10, i, 2019) * int(s[i])
    p %= 2019
    r[p] += 1
ans = 0
for i in r:
    if i >= 2:
        ans += ((i - 1) * i) // 2
ans += r[0]
print(ans)
# Judge status: Wrong Answer
n = int(input())
dic = {}
for _ in range(n):
  s = input()
  if dic.get(s) == None:
    dic[s] = 1
  else:
    dic[s] += 1

m = max(dic.items())
l = []
for v in dic.items():
  if v[1] == m[1]:
    l.append(v[0])
sortl = sorted(l)
for i in range(len(sortl)):
  print(sortl[i])
# Judge status: Accepted
d,m=divmod(int(input()),11);print(2*d+(m>0)+(m>6))
# Judge status: Wrong Answer
A,B,C = map(int,input().split())
ans = 0
if A == B == C:
  print(-1)
else:
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    n_A = (B + C) / 2
    n_B = (A + C) / 2
    n_C = (B + C) / 2
    A = n_A
    B = n_B
    C = n_C
    ans += 1
  print(ans)
# Judge status: Accepted
x = int(input())
n = x//100
if x % 100 > n * 5:
         print("0")
else:
         print("1")
# Judge status: Wrong Answer
if __name__ == '__main__':
    s = input()
    ans = []
    for c in s:
        if c == '0':
            ans.insert(0, '0')
        elif c == '1':
            ans.insert(0, '1')
        elif c == 'B':
            del ans[0:1]
    ans = ''.join(ans)
    print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())


if N == 1:
    print(M - 2)
elif M == 1:
    print(N - 2)
elif M > 2 and N > 2:
    print((M - 2) * (N - 2))
else:
    print(0)
# Judge status: Accepted
def main():
    N, K = map(int, input().split())
    S = list(input())
    S[K-1] = S[K-1].lower()
    print("".join(S))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import math
n, k = map(int,input().split())
input()
print(int(math.ceil((n - 1)//(k - 1))))
# Judge status: Accepted
N, K = map(int, input().split())

p = 0
for i in range(1, N + 1):
  a = i
  n = 1
  while n * a < K:
    n *= 2
  t = 1/n * 1/N
  p += t
print(p)
# Judge status: Accepted
import sys

n, m, X, Y = map(int, sys.stdin.readline().split())
*x, = map(int, sys.stdin.readline().split())
*y, = map(int, sys.stdin.readline().split())

def main():
    return 'No War' if max(X, max(x)) < min(Y, min(y)) else 'War'

if __name__ == '__main__':
    ans = main()
    print(ans)
# Judge status: Wrong Answer
a = int(input())

print(1000 - a % 1000)
# Judge status: Accepted
n,m=map(int,input().split())
side1=set()
side2=set()
for i in range(m):
	a,b=map(int,input().split())
	if a==1:
		side1.add(b)
	elif b==n:
		side2.add(a)
print(("" if side1 & side2 else "IM")+"POSSIBLE")
# Judge status: Accepted
S=input()
ans=0
tmp=''
pre=''
for i in S:
    tmp+=i
    if pre!=tmp:
        pre=tmp
        tmp=''
        ans+=1
print(ans)
# Judge status: Wrong Answer
X, Y = map(int, input().split())

a, b = divmod(2*X-Y, 3)
c, d = divmod(2*Y-X, 3) 
if (not b == d == 0) or (2*a < c) or (2*c < a):
  print(0)
else:
  m, n = 1, 1
  mod = 10**9+7
  for i in range(1, min(a, c)+1):
    m = (m * (a+c-i+1)) % mod
    n = (n * i) % mod
  ans = (m * pow(n, mod-2, mod)) % mod
  print(ans)
# Judge status: Wrong Answer
a,b,k=map(int,input().split())
for i in range(a,min(b+1,a+k)):
    print(i)
for i in range(max(a,b-k+1),b+1):
    print(i)
# Judge status: Accepted
S = list(input())
A = 0
B = 0
for s in S:
    if s == '0':
        A += 1
    else:
        B += 1
print(min(A,B)*2)
# Judge status: Accepted
a, b, c = input().split()
print("A" + b[0] + "C")
# Judge status: Wrong Answer
s=input().split()
i=int(s[0])
j=int(s[1])
k=int(s[2])
a=[]
for l in range(k):
  if i+l<=j:
    a.append(str(i+l))
  else:
    break
b=int(a[-1])
if b>=i-k and b<i:
  for l in range(1,i-b+1):
    if b+l<=j:
      a.append(str(b+l))
elif b<i-k:
  for l in range(k-1,-1,-1):
    if j-l<=j:
      a.append(str(j-l))
print(*a)
# Judge status: Wrong Answer
n=int(input())
List=[2 for x in range(n+1)]
List[0]=0
List[1]=1
ans=1
 
for x in range(2,n+1):
  for y in range(2*x,n+1,x):
    List[y]+=1
  ans+=x*List[x]
print(ans)
# Judge status: Accepted
N = int(input())
ans = ''
while N > 0:
  N -= 1
  ans += chr(ord('a') + N % 26)
  N //= 26
print(ans[::-1])
# Judge status: Accepted
x=list(map(int,input().split()))
if x[0]==0:
  print(1)
elif x[1]==0:
  print(2)
elif x[2]==0:
  print(3)
elif x[3]==0:
  print(4)  
elif x[4]==0:
  print(5)
# Judge status: Accepted
a, b, c = map(int, input().split())
ans = 'NO'
for i in range(1, 10*10):
    if a * i % b == c:
        ans = 'YES'
        break
print(ans)
# Judge status: Accepted
import bisect
n = int(input())
a = [int(input()) for i in range(n)][::-1]

color_num = [a[0]]
for i in range(1, n):
    if a[i] >= color_num[-1]:
        color_num.append(a[i])
    else:
        temp = bisect.bisect_right(color_num, a[i])
        color_num[temp] = a[i]


print(len(color_num))
# Judge status: Accepted
import sys

def dupchk(seq):
  return len(seq) != len(set(seq))
arrw = []

N = int(input())
for i in range(0,N):
  W = str(input())
  arrw.append(W)

if dupchk(arrw) == False:
  for i in range(0,N-1):
    if arrw[i][-1] != arrw[i+1][0]:
      print("No")
      sys.exit()
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n,m=map(int,raw_input().split())
a=sorted(map(int,raw_input().split()))
print 'No' if 4*m*a[n-m]<sum(a) else 'Yes'
# Judge status: Accepted
S,T = input().split()

print(T,S,sep='')
# Judge status: Accepted
n=int(input())
ans=0
p=10**6
for i in range(1,n+1):
  ans+=n//i
  if n%i==0:
    ans-=1
print(ans)
# Judge status: Wrong Answer
A, B = map(int, input().split())
count = 1
i = A
while i < B:
    count += 1
    i = count * A - (count - 1)

print(count)