Harryxun/stf_run huggingface dataset:
class Trio:
    __pre=None
    __val=None
    __nex=None
    def __init__(self,val,p=None,n=None):
        self.__pre=p
        self.__val=val
        self.__nex=n
    
    def get_pre(self):return self.__pre
    
    def get_nex(self):return self.__nex
    
    def set_nex(self,n):self.__nex=n
    
    def set_val(self,n):self.__val=n
    
    def get_val(self):return self.__val

class Stack:
    member=Trio(None)
    def __init__(self,stri):
        if(isinstance(stri,str)):
            for i,e in enumerate(stri):
                if(i==0):
                    self.member.set_val(e)
                else:
                    self.push(e)

    
    def push(self,n):
        #print("Push: ",n)
        self.member.set_nex(Trio(n,self.member,None))
        self.member=self.member.get_nex()

    def pop(self):
        #print("Pop")
        if(self.member==None):
            return None
        d=self.member.get_val()
        self.member=self.member.get_pre()
        return d

s=input()
stk = Stack(None)
stri=""
for i in s:
    if(i==" "):
        stk.push(stri)
        stri=""
    elif(i.isdigit()):
        stri="".join([stri,i])
    elif(i=="+" or i=="-" or i=="*"):
        b=stk.pop()
        b=int(b)
        a=int(stk.pop())
        if(i=="+"):
            stri=(str(a+b))
        elif(i=="-"):
            stri=(str(a-b))
        else:
            stri=(str(a*b))

p

### FIXED CODE ###

class Trio:
    __pre=None
    __val=None
    __nex=None
    def __init__(self,val,p=None,n=None):
        self.__pre=p
        self.__val=val
        self.__nex=n
    
    def get_pre(self):return self.__pre
    
    def get_nex(self):return self.__nex
    
    def set_nex(self,n):self.__nex=n
    
    def set_val(self,n):self.__val=n
    
    def get_val(self):return self.__val

class Stack:
    member=Trio(None)
    def __init__(self,stri):
        if(isinstance(stri,str)):
            for i,e in enumerate(stri):
                if(i==0):
                    self.member.set_val(e)
                else:
                    self.push(e)

    
    def push(self,n):
        self.member.set_nex(Trio(n,self.member,None))
        self.member=self.member.get_nex()

    def pop(self):
        if(self.member==None):
            return None
        d=self.member.get_val()
        self.member=self.member.get_pre()
        return d

s=input()
stk = Stack(None)
stri=""
for i in s:
    if(i==" "):
        stk.push(stri)
        stri=""
    elif(i.isdigit()):
        stri="".join([stri,i])
    elif(i=="+" or i=="-" or i=="*"):
        b=stk.pop()
        b=int(b)
        a=int(stk.pop())
        if(i=="+"):
            stri=(str(a+b))
        elif(i=="-"):
            stri=(str(a-b))
        else:
            stri=(str(a*b))

print(stri)
#!/usr/bin/env python3

A B = map(int input().split())

if B % A == 0:
    print(A + B)
else:
    print(B -A)
    



### FIXED CODE ###

#!/usr/bin/env python3

A, B = map(int, input().split())

if B % A == 0:
    print(A + B)
else:
    print(B -A)
n,m,q  = map(int,input().split())
rails=[tuple(map(int,input().split())) for i in range(m)]
qs=[tuple(map(int,input().split())) for i in range(q)]
enuq = list(enumerate(qs))
 
enuq.sort(key = lambda x:x[1][0])
ansli = [0 for i in range(q)]


for (i,(p,q)) in enuq:
    removelist=[]
    for (j,(l,r)) in enumerate(rails):
        if p<=l and r<=q:
            ansli[i]=ansli[i]+1
        elif l<p:
            removelist.append(j)
    for jj in removelist:
        rails.pop(jj)



for a in ansli:
    print(a)


### FIXED CODE ###

from collections import Counter
from itertools import product

n,m,q  = map(int,input().split())
rails=[tuple(map(int,input().split())) for i in range(m)]
qs=[tuple(map(int,input().split())) for i in range(q)]

xlist = [[0 for j in range(n)] for i in range(n)]
sumlist = [[0 for j in range(n+1)] for i in range(n)]
for (l,r),i in Counter(rails).items():
    xlist[l-1][r-1]=i


for (i,j) in product(range(n),range(n)):
    sumlist[i][j+1]=sum(xlist[i][0:j+1])


for (p,q) in qs:
    ans = 0
    for i in range(p-1,q):
        ans = ans+sumlist[i][q]-sumlist[i][p-1]
    print(ans)
import sys
from scipy.special import comb

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))
    MOD = 10**9 + 7

    used = set()
    first = 0
    second = 0
    for i in range(N+1):
        if A[i] in used:
            second = i
            first = A.index(A[i])
        else:
            used.add(A[i])

    """
    factrial = [1] * (N+2)
    for k in range(1, N+2):
        factrial[k] = (factrial[k-1] * k) % MOD

    fact_inv = [1] * (N+2)
    fact_inv[N+1] = pow(factrial[N+1], MOD - 2, MOD)
    for k in range(N, -1, -1):
        fact_inv[k] = (fact_inv[k+1] * (k+1)) % MOD

    def comb(n, r, MOD):
        if n < 0 or r < 0 or n < r:
            return 0
        else:
            return (factrial[n] * fact_inv[r] * fact_inv[n-r]) % MOD
    """

    m = first + (N - second)
    for i in range(1, N+2):
        ans = comb(N+1, i, exact=True) - comb(m, i-1, exact=True)
        print(int(ans) % MOD)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))
    MOD = 10**9 + 7

    used = set()
    first = 0
    second = 0
    for i in range(N+1):
        if A[i] in used:
            second = i
            first = A.index(A[i])
        else:
            used.add(A[i])

    factrial = [1] * (N+2)
    for k in range(1, N+2):
        factrial[k] = (factrial[k-1] * k) % MOD

    fact_inv = [1] * (N+2)
    fact_inv[N+1] = pow(factrial[N+1], MOD - 2, MOD)
    for k in range(N, -1, -1):
        fact_inv[k] = (fact_inv[k+1] * (k+1)) % MOD

    def comb(n, r, MOD):
        if n < 0 or r < 0 or n < r:
            return 0
        else:
            return (factrial[n] * fact_inv[r] * fact_inv[n-r]) % MOD

    m = first + (N - second)
    for i in range(1, N+2):
        ans = comb(N+1, i, MOD) - comb(m, i-1, MOD)
        print(int(ans) % MOD)


if __name__ == '__main__':
    main()
N = map(int,input().split())
if N % 7 == 0:
	print("Yes")
else:
  	print("No")

### FIXED CODE ###

s = input()
if "7" in s:
    print("Yes")
else:
    print("No")
i=list(map(int,input().split()))
j=list(map(int,input().split()))
c=0
j.sort(reverse=True)
for x in range(i[1]):
  del j[0]
for y in j:
  c+=y
print(str(c))

### FIXED CODE ###

i=list(map(int,input().split()))
j=list(map(int,input().split()))
c=0
cnt=1
n=i[1]
j.sort(reverse=True)
for x in j:
  if cnt>n:
    c+=x
  else:
    cnt+=1
print(str(c))
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  x,y,a,b,c=LI()
  la=LI()
  lb=LI()
  lc=LI()

  la.sort(reverse=True)
  lb.sort(reverse=True)
  lc.sort(reverse=True)

  ans_list=[]
  ans_list+=la[:x]
  ans_list+=lb[:y]

  ans_list.sort(reverse=True)
  i=1
  for _ in range(c):
    if a+b<len(lc):
      lc.pop()
    else:
      _c=lc.pop()
      if ans_list[-i]<=_c:
        ans_list[-i]=_c
        i+=1

  return sum(ans_list)

# main()
print(main())


### FIXED CODE ###

import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  x,y,a,b,c=LI()
  la=LI()
  lb=LI()
  lc=LI()

  la.sort(reverse=True)
  lb.sort(reverse=True)
  lc.sort(reverse=True)

  ans_list=[]
  ans_list+=la[:x]
  ans_list+=lb[:y]
  ans_list+=lc[:(x+y)]

  ans_list.sort(reverse=True)


  # print(ans_list)
  return sum(ans_list[:x+y])

# main()
print(main())
from scipy.sparse import*
(n,m,s,*D),*t=[map(int,t.split())for t in open(0)]
x=51
r=range(0,x**3,x)
for u,v,a,b in t[:m]:
 for i in r:D+=i+a*x+u,i+v,b,i+a*x+v,i+u,b
i=0
for c,d in t[m:]:
 i+=1
 for j in r:D+=j+i,j+c*x+i,d
d=csgraph.dijkstra(csr_matrix((D[2::3],(D[::3],D[1::3])),[8**6]*2),1,min(j,s)*x+1)
for i in range(2,n+1):print(int(min(d[i::x])))

### FIXED CODE ###

from scipy.sparse import*
n,m,s,*t=map(int,open(0).read().split())
row,col,dat=[],[],[]
for u,v,a,b in zip(*[iter(t[:m*4])]*4):
    for i in range(2501-a):
        row+=(i+a)*51+u,(i+a)*51+v
        col+=i*51+v,i*51+u
        dat+=b,b
for i,(c,d)in enumerate(zip(*[iter(t[m*4:])]*2),1):
    for j in range(2501-c):
        row+=j*51+i,
        col+=(j+c)*51+i,
        dat+=d,
d=csgraph.dijkstra(csr_matrix((dat,(row,col)),[8**6]*2),1,min(2500,s)*51+1)
for i in range(2,n+1):print(int(d[i::51].min()))
n=int(input())
a=input()
b=input()
m=[]
for i in a:
  for j in b:
    if i==j:
      m.append(i)
for _ in range(n-2):
  s=input()
  l=[]
  for i in s:
    for j in m:
      if i==j:
        l.append(i)
  m=l
print(''.join(sorted(m)))       

### FIXED CODE ###

n=int(input())
a=input()
if n!=1:
  b=input()
  m=[]
  if len(a)>len(b):
    a,b=b,a
  b=list(b)
  for i in a:
    for j in range(len(b)):
      if i==b[j]:
        m.append(i)
        b[j]=''
        break
  for _ in range(n-2):
    s=list(input())
    l=[]
    for i in m:
      for j in range(len(s)):
        if i==s[j]:
          l.append(i)
          s[j]=''
          break
    m=l
  print(''.join(sorted(m)))  
else:
  print(''.join(sorted(a)))
import math
import numpy as np
import itertools
N = int(input())
x = []; y= []
for _ in range(N):
    x_,y_ = map(int,input().split())
    x.append(x_)
    y.append(y_)
lis = np.zeros((8,8))
for i in range(N):
    for j in range(N):
        lis[i,j] = math.sqrt((x[i]-x[j])**2 + (y[i]-y[j])**2)
num = 0
su = 0
ite = itertools.permutations([i for i in range(N)])
for it in ite:
    for i in range(len(it)-1):
        su += lis[it[i],it[i+1]]
    num += 1
print(su/num)


### FIXED CODE ###

import math
import numpy as np
import itertools
N = int(input())
x = []; y= []
for _ in range(N):
    x_,y_ = map(int,input().split())
    x.append(x_)
    y.append(y_)
lis = np.zeros((8,8))
for i in range(N):
    for j in range(N):
        lis[i,j] = math.sqrt((x[i]-x[j])**2 + (y[i]-y[j])**2)
num = 0
su = 0
ite = itertools.permutations([i for i in range(N)])
for it in ite:
    for i in range(len(it)-1):
        su += lis[it[i],it[i+1]]
    num += 1
print(su/num)
# -*- coding: utf-8 -*-

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

for i in len(a):
    print('{0} '.format(a[i]))



### FIXED CODE ###

# -*- coding: utf-8 -*-

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

for i in range(n):

    if i is n - 1:
        print('{0}'.format(a[i]))
    else:
        print('{0} '.format(a[i]), end='')
import sys

n,m=map(int,input().split())
ans=[]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[j]+=1

for i in ans:
    if ans[i]==n:
        output+=1

print(output)

### FIXED CODE ###

import sys

n,m=map(int,input().split())
ans=[0]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[k[j]]+=1

for i in ans:
    if i==n:
        output+=1

print(output)
n, m = map(int, input().split())
L=[set() for i in range(n)]
for i in range(m):
    a, b =  map(int, input().split())
    L[a-1] |= {b}
    L[b-1] |= {a}
Y = {range(1, n+1)}
Z = [0]*(n-1) 
S = {1}
def f(X):
    global S, Z
    X_next = set()
    for j in X:
        R = L[j-1]-S
        S |= L[j-1]
        X_next |= R
        for k in R:
            Z[k-2] += j
    if X_next == set():
        print("Yes")
        print('\n'.join(map(str, Z)))
    else:
        return  f(X_next)
f({1})

### FIXED CODE ###

n, m = map(int, input().split())
import sys
sys.setrecursionlimit(10**6)
L=[set() for i in range(n)]
for i in range(m):
    a, b =  map(int, input().split())
    L[a-1] |= {b}
    L[b-1] |= {a}
Y = {range(1, n+1)}
Z = [0]*(n-1) 
S = {1}
def f(X):
    global S, Z
    X_next = set()
    for j in X:
        R = L[j-1]-S
        S |= L[j-1]
        X_next |= R
        for k in R:
            Z[k-2] += j
    if X_next == set():
        print("Yes")
        print('\n'.join(map(str, Z)))
    else:
        return  f(X_next)
f({1})
n = input()
for i in range(0, n-1):
   R[i] = raw_input().split()
minv = R[0]
maxv = R[1] - R[0]
for j in range(1, n-1):
   maxv = max(maxv, R[j] - minv) 
   minv = min(minv, R[j])
print maxv - minv

### FIXED CODE ###

n = input()
R = []
for i in range(0, n):
   R.append(int(raw_input()))

maxv = R[1] - R[0]
minv = R[0]

for v in range(1, n):
   if minv > R[v]:
      minv = R[v]
   elif maxv < R[v] - minv:
      maxv = R[v] - minv
print maxv
N=int(input())
S=input()
Q=int(input())
K=[int(i) for i in input().split()
def f(k):
    num=0
    L=[0,0,0]
    for i in range(N):
        if i-k>=0:
            if S[i-k]=='D':
                L[0]-=1
                L[2]-=L[1]
            elif S[i-k]=='M':
                L[1]-=1
        if S[i]=='D':
            L[0]+=1
        elif S[i]=='M':
            L[1]+=1
            L[2]+=L[0]
        elif S[i]=='C':
            num+=L[2]
        #print(i,':',L,':',num)
    return num
for k in K:
    print(f(k))

### FIXED CODE ###

N=int(input())
S=input()
Q=int(input())
K=[int(i) for i in input().split()]
def f(k):
    num=0
    L=[0,0,0]
    for i in range(N):
        if i-k>=0:
            if S[i-k]=='D':
                L[0]-=1
                L[2]-=L[1]
            elif S[i-k]=='M':
                L[1]-=1
        if S[i]=='D':
            L[0]+=1
        elif S[i]=='M':
            L[1]+=1
            L[2]+=L[0]
        elif S[i]=='C':
            num+=L[2]
        #print(i,':',L,':',num)
    return num
for k in K:
    print(f(k))
mountains_high=[]
for i in range(10):
    mountains_high.append(int(input()))

mountains_high_copy=mountains_high.copy()
for i in range(9):
    for j in range(9):
        if mountains_high_copy[j]>mountains_high_copy[j+1]:
            num=mountains_high_copy[j]
            mountains_high_copy[j]=mountains_high_copy[j+1]
            mountains_high_copy[j+1]=num

for i in range(3):
    print(mountains_high_copy[9-i

### FIXED CODE ###

mountains_high=[]
for i in range(10):
    mountains_high.append(int(input()))

mountains_high_copy=mountains_high.copy()
for i in range(9):
    for j in range(9):
        if mountains_high_copy[j]>mountains_high_copy[j+1]:
            num=mountains_high_copy[j]
            mountains_high_copy[j]=mountains_high_copy[j+1]
            mountains_high_copy[j+1]=num

for i in range(3):
    print(mountains_high_copy[9-i])
K,N = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

c = A[0]+(K-A[N-1])

for i in range(1,N):
    d = max(d,A[i]-A[i-1])

print(K-d)


### FIXED CODE ###

k,n = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
c = a[0] + (k - a[n-1])
for i in range(1,n):
  c = max(c,a[i] - a[i-1])
print(k-c)
import sys
from collections import deque

s = deque([s for s in input()])
q = int(input())
rev = False

for query in sys.stdin:
    if query.strip() == '1': # sys.stdin does not remove line breaks. (vs. input() removes line breaks)
        if rev:
            rev = False
        else:
            rev = True
    else:
        t,f,c = query.split()
        if f == '1':
            if rev == True:
                s.append(s)
            else:
                s.appendleft(c)
        elif f == '2':
            if rev == True:
                s.appendleft(c)
            else:
                s.append(c)
if rev == True:
    ans = []
    for i in range(len(s)):
        ans.append(s.pop())
    print(''.join(ans))
else:
    print(''.join(s))

### FIXED CODE ###

import sys
from collections import deque

# sys.stdin = open('test_cases/abc158d/in/01.txt', 'r')
# sys.stdin = open('input.txt', 'r')

s = deque([s for s in input()])
q = int(input())
rev = False

for query in sys.stdin:
    if query.strip() == '1': # sys.stdin does not remove line breaks. (vs. input() removes line breaks)
        if rev:
            rev = False
        else:
            rev = True
    else:
        t,f,c = query.split()
        if f == '1':
            if rev:
                s.append(c)
            else:
                s.appendleft(c)
        elif f == '2':
            if rev:
                s.appendleft(c)
            else:
                s.append(c)
if rev == True:
    s.reverse()
print(''.join(s))
K = int(input())


def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list



    
if K % 2 == 0 or K % 5 == 0:
    ans = -1
else:
    for x in make_divisor_list(K-1):
        if int("7"*x) % K == 0:
            ans = x

            break
print(ans)

### FIXED CODE ###

K = int(input())
remainder = 0
ans = -1
 
if K % 2 == 0 or K % 5 == 0:
    ans = -1
else:
    for n in range(1,10**6):
      remainder = (remainder*10 + 7) % K
      if remainder == 0:
          ans = n
          break
      if n == 10**6-1:
          ans = -1
print(ans)
N = int(input())
A = [int(x) for x in input().split()]

import math


gcd = A[0]
for i in range(N):
    gcd = gcd * A[i] // math.gcd(gcd, A[i])

ans = 0
for j in range(N):
    ans += gcd / A[j]

print(int(ans % (10**9 +7)))

### FIXED CODE ###

from fractions import gcd
from functools import reduce
mod=10**9+7
n=int(input())
a=[int(i) for i in input().split()]
l=reduce(lambda x,y:x//gcd(x,y)*y,a)
ans=sum(map(lambda x:l//x,a))
print(ans%mod)
n = int(raw_input())
 
INFTY = 99999999
 
color = [0 for i in range(n)]
m = [[INFTY for i in range(n)] for j in range(n)]
d = [INFTY for i in range(n)]
k = [-1 for i in range(n)]

for i in range(n):
    G = map(int, raw_input().split())
    for j in range(n):
        if G[j] != -1:
            m[i][j] = G[j]

d[0] = 0

while 1:
    cost = INFTY
    for i in range(n):
        if color[i] != 2 and d[i] < cost:
            cost = d[i]
            u = i

    if cost == INFTY:
        break

    color[u] = 2

    for v in range(n):
        if color[v] != 2 and m[u][v] != INFTY and m[u][v] < d[v]:
            d[v] = m[u][v]
            k[v] = u
            color[v] = 1

sum = 0
for i in range(n):
    if p[i] != -1:
        sum += m[i][k[i]]
print sum

### FIXED CODE ###

n = int(raw_input())
 
INFTY = float('inf')
 
color = [0 for i in range(n)]
M = [[INFTY for i in range(n)] for j in range(n)]
d = [INFTY for i in range(n)]
p = [-1 for i in range(n)]
 
def MST():
  d[0] = 0
 
  while True:
    cost = INFTY
    for i in range(n):
      if color[i] != 2 and d[i] < cost:
        cost = d[i]
        u = i
 
    if cost == INFTY:
      break
     
    color[u] = 2
 
    for v in range(n):
      if color[v] != 2 and M[u][v] != INFTY and M[u][v] < d[v]:
        d[v] = M[u][v]
        p[v] = u
        color[v] = 1
 
  sum = 0
  for i in range(n):
    if p[i] != -1:
      sum += M[i][p[i]]
  return sum
 
for i in range(n):
  G = map(int, raw_input().split())
  for j in range(n):
   if G[j] != -1:
     M[i][j] = G[j]
 
print MST()
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,a,b,c,d = inpl()
s = input()
def chk(i):
    if s[i] == s[i+1] == '#':
        print('No')
        quit()
    return True
def cc(i):
    if s[i] == s[i+1] == s[i+2] == '.':
        return True
    return False

if c < d:
    for i in range(b-1,d-1):
        chk(i)
    for i in range(a-1,c-1):
        chk(i)
else:
    for i in range(b-1,d):
        if cc(i):
            break
    else:
        print('No')
        quit()
    for i in range(a-1,c-1):
        chk(i)
print('Yes')

### FIXED CODE ###

from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,a,b,c,d = inpl()
s = input()
def chk(i):
    if s[i] == s[i+1] == '#':
        print('No')
        quit()
    return True
def cc(i):
    if s[i] == s[i+1] == s[i+2] == '.':
        return True
    return False

if c < d:
    for i in range(b-1,d-1):
        chk(i)
    for i in range(a-1,c-1):
        chk(i)
else:
    for i in range(b-2,d-1):
        if cc(i):
            break
    else:
        print('No')
        quit()
    for i in range(a-1,c-1):
        chk(i)
print('Yes')
M, N = map(int, input().split())

num1 = 1
list_M = []

for i in M:
  list_M.append(i)
  num1 += 1

num2 = 1
list_n = []
for j in N:
  list_N.append(j)
  num2 += 1

add_list = []
for k in M:
  for l in N:
    add_list.append(list_m[k] + list[l])

odd = 0

for m in add_list:
  if m % 2 == 0:
    odd += 1
    
print(odd)
    

### FIXED CODE ###

m,n =  map(int, input().split())
print(n*(n-1)//2+m*(m-1)//2)
X=input()
t=input()
if t>X:
  print 0 
else:
  print X-t

### FIXED CODE ###

X,t=map(int,raw_input().split())
if t>=X:
  print "0" 
else:
  print X-t
n,a,b,c,d=list(map(int,input().split()))
s=input()

if c<d:
    for i in range(b+1,d):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            exit(0)
    
    for i in range(a+1,c):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            exit(0)
    print('Yes')
else:
    for i in range(b,min(d+1,n)):
        if s[i]=='#':
            continue

        if s[i-1]=='.' and s[i+1]=='.':
            break
    else:
        print('No')
        exit(0)
    
    for i in range(a+1,c):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            exit(0)
    
    for i in range(b+1,d):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            exit(0)
    
    print('Yes')


### FIXED CODE ###

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

if c<d:
    for i in range(a-1,d-1):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            exit(0)
    print('Yes')
else:
    for i in range(b-1,d):
        if s[i-1]=='.' and s[i]=='.' and s[i+1]=='.':
            break
    else:
        print('No')
        exit(0)
    
    for i in range(a-1,c-1):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            exit(0)
    
    print('Yes')
a,b,c,d = map(int,input().split())
while a <= 0 or c <= 0:
    c =c - b
    a =a - d
    if c <= 0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

S,W =map(int,input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')
N = int(input())
arrray = list(map(int,input().split()))
fleg = True
count = 0

while flag:
    for i in range(N):
        if array[i] % 2 == 0:
            array[i] = array[i] / 2
        else:
            flag = False
            break
    else:
        count += 1

print(count)

    

### FIXED CODE ###

N = int(input())
x = list(map(int, input().split()))
flag = True
count = 0

while flag:
    for i in range(N):
        if x[i] % 2 == 0:
            x[i] = x[i] / 2
        else:
            flag = False
            break
    else:
        count += 1

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

cnt = 0
for i in range(N):
    for j in range(N-i):
        s = sum(A[i:i+j+1])
        if s >= K:
            cnt += 1

print(cnt)

### FIXED CODE ###

W, H, x, y = [int(i) for i in input().split()]
print(W*H / 2, int(x*2 == W and y*2 == H))