Harryxun/stf_run huggingface dataset:
import math
n,m = map(int, input().split())
mod = 1000000007
fact = [1]*(n+n+1)
rfact = [1]*(n+n+1)
for i in range(n+n):
    fact[i+1] = rr = ((i+1) * fact[i]) % mod
    rfact[i+1] = pow(rr, mod-2, mod)
def comb(N, K,mod):
    return fact[N] * rfact[K] * rfact[N-K] % mod
def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]
def prime_factorization_2(num):
    if num <= 1:
        print(1)
        exit()
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        dict_counter = {}
        for prime in prime_list:
            while num % prime == 0:
                if prime in dict_counter:
                    dict_counter[prime] += 1
                else:
                    dict_counter[prime] = 1
                num //= prime
        if num != 1:
            if num in dict_counter:
                dict_counter[num] += 1
            else:
                dict_counter[num] = 1

        return dict_counter
x = prime_factorization_2(m)
x = list(x.values())
ans = 1
for i in x:
  ans*= comb(i+n-1,i,mod)
  ans %=mod
print(ans)

### FIXED CODE ###

import math
n,m = map(int, input().split())
mod = 1000000007
fact = [1]*(n+10000+1)
rfact = [1]*(n+10000+1)
for i in range(n+10000):
    fact[i+1] = rr = ((i+1) * fact[i]) % mod
    rfact[i+1] = pow(rr, mod-2, mod)
def comb(N, K,mod):
    return fact[N] * rfact[K] * rfact[N-K] % mod
def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]
def prime_factorization_2(num):
    if num <= 1:
        print(1)
        exit()
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        dict_counter = {}
        for prime in prime_list:
            while num % prime == 0:
                if prime in dict_counter:
                    dict_counter[prime] += 1
                else:
                    dict_counter[prime] = 1
                num //= prime
        if num != 1:
            if num in dict_counter:
                dict_counter[num] += 1
            else:
                dict_counter[num] = 1

        return dict_counter
x = prime_factorization_2(m)
x = list(x.values())
ans = 1
for i in x:
  ans*= comb(i+n-1,i,mod)
  ans %=mod
print(ans)
from collections import deque
S = deque(list(input().strip()))
Q = int(input())
cnt = 0
for _ in range(Q):
    q = list(input().split())
    if int(q[0])==1:
        cnt += 1
    else:
        if cnt%2==0:
            if int(q[1])==1:
                S.appendleft(q[2])
            else:
                S.append(q[2])
        else:
            if int(q[1])==1:
                S.append(q[2])
            else:
                S.appendleft(q[2])
if cnt%2==0:
    print("".join(S))
else:
    
    print("".join(S.reverse()))

### FIXED CODE ###

from collections import deque
S = deque(list(input().strip()))
Q = int(input())
cnt = 0
for _ in range(Q):
    q = list(input().split())
    if int(q[0])==1:
        cnt += 1
    else:
        if cnt%2==0:
            if int(q[1])==1:
                S.appendleft(q[2])
            else:
                S.append(q[2])
        else:
            if int(q[1])==1:
                S.append(q[2])
            else:
                S.appendleft(q[2])
if cnt%2==0:
    print("".join(S))
else:
    S.reverse()
    print("".join(S))
from datetime import date
from datetime import timedelta
import datetime

def is_leap_year(y):
    return y % 4 == 0 and (y % 100 != 0 or y % 400 == 0)

def leap_year_count(target_y,benchmark_y):
    target = target_y // 4 - target_y // 100 + target_y // 400
    benchmark = benchmark_y // 4 - benchmark_y // 100 + benchmark_y // 400
    return target - benchmark

def ad2mayan(y, m, d):
    diff = 0
    if datetime.MAXYEAR < y:
        day_of_2012 = (date(2013, 1, 1) - date(2012, 12, 21)).days
        day_of_the_year = (date(1, m, d) - date(1, 1, 1)).days if is_leap_year(y) else (date(4, m, d) - date(4, 1, 1)).days
        
        days = (y - 2013) * 365 + leap_year_count(y, 2013)

        diff = day_of_2012 + days + day_of_the_year
    else:
        benchmark = date(2012, 12, 21)
        diff = (date(y, m, d) - benchmark).days
    
    ki, diff = diff % 20, diff // 20
    w, diff = diff % 18, diff // 18
    t, diff = diff % 20, diff // 20
    ka, diff = diff % 20, diff // 20
    b = diff % 13
    
    return b,ka,t,w,ki

def mayan2ad(b, ka, t, w, ki):
    ka += b * 20
    t += ka * 20
    w += t * 18
    ki += w * 20
    time = date(2012, 12, 21) + timedelta(ki)
    return time.year, time.month, time.day


import sys
f = sys.stdin

for line in f:
    if line == '#':
        continue
    t = list(map(int, line.split('.')))
    if len(t) == 3:
        print('.'.join(map(str, ad2mayan(*t))))
    else:
        print('.'.join(map(str, mayan2ad(*t))))

### FIXED CODE ###

import datetime
from datetime import timedelta
from datetime import date

def ad2mayan(y, m, d):
    days = 0
    while datetime.MAXYEAR < y:
        days += 365 * 400 + 97
        y -= 400

    days += (date(y, m, d) - date(2012, 12, 21)).days
    
    ki, days = days % 20, days // 20
    w, days = days % 18, days // 18
    t, days = days % 20, days // 20
    ka, days = days % 20, days // 20
    b = days % 13
    
    return b,ka,t,w,ki

def mayan2ad(b, ka, t, w, ki):
    ka += b * 20
    t += ka * 20
    w += t * 18
    ki += w * 20
    dt = datetime.date(2012, 12, 21) + timedelta(ki)
    return dt.year, dt.month, dt.day

import sys
f = sys.stdin


for line in f:
    if line[0] == '#':
        break
    t = list(map(int, line.split('.')))
    
    if len(t) == 3:
        print('.'.join(map(str, ad2mayan(*t))))
    elif len(t) == 5:
        print('.'.join(map(str, mayan2ad(*t))))
rom collections import deque
import copy

def main():
    h,w = map(int, input().split())
    a = [[j == "#" for j in input()] for _ in range(h)]
    que = deque([(i, j) for i in range(h) for j in range(w) if a[i][j]])

    count = 0
    while True:
        count += 1
        nque = deque()
        while que:
            y,x = que.popleft()
            if x >0 and not a[y][x-1]:
                a[y][x-1] = True
                nque.append([y,x-1])
            if x <w-1 and not a[y][x+1]:
                a[y][x+1] = True
                nque.append([y,x+1])
            if y >0 and not a[y-1][x]:
                a[y-1][x] = True
                nque.append([y-1,x])
            if y < h-1 and not a[y+1][x]:
                a[y+1][x] = True
                nque.append([y+1,x])
        if nque:
            que = copy.copy(nque)
        else:
            break
    print(count-1)
if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import deque
import copy

def main():
    h, w = map(int, input().split())
    a = [[j == "#" for j in input()] for _ in range(h)]


    # スタート地点をqueueに追加
    que = deque([(i, j) for i in range(h) for j in range(w) if a[i][j]])

    count = 0
    while True:
        count += 1
        nque = deque()
        while que:
            y, x = que.popleft()
            if x > 0 and not a[y][x-1]:
                a[y][x-1] = True
                nque.append((y,x-1))
            if x < w-1 and not a[y][x+1]:
                a[y][x+1] = True
                nque.append((y,x+1))
            if y > 0 and not a[y-1][x]:
                a[y-1][x] = True
                nque.append((y-1,x))
            if y < h-1 and not a[y+1][x]:
                a[y+1][x] = True
                nque.append((y+1,x))

        if nque:
            que = copy.copy(nque)
        else:
            break

    print(count - 1)

if __name__ == '__main__':
    main()
A,B,C,D = map(int, input().split())
 
x = list(range(A,B+1))
x = set(x)
y = list(range(C,D+1))
y = set(y)
 
if len(x)==0 or len(y)==0 or len(x&y)==0:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

n = int(input())

output = 'ACL'*n
print(output)
A, B = input().split()
A = int(A)
B100 = ""

for s in range(len(B)):
    if B[s] != ".":
        B100 += B[s]

B100 = int(B100)

ans = A * B100 // 100

print(ans[0])


### FIXED CODE ###

A, B = input().split()
A = int(A)
B100 = ""

for s in range(len(B)):
    if B[s] != ".":
        B100 += B[s]

B100 = int(B100)

ans = A * B100 // 100

print(ans)
import sys

class Stack:
    def __init__(self, max):
        self.max = max  ##max???stack????????§??????
        self.stack = list(range(max)) 
        self.top = 0  ##???????????????????????????0

    def initialize(self):
        self.top = 0

    def isEmpty(self):
        return self.top == 0

    def isFull(self):
        return self.top >= self.max - 1

    def push(self, value):
        if self.isFull():
            raise IndexError('?????????????????????')
        else:
            self.top += 1
            self.stack[self.top] = value

    def pop(self):
        if self.isEmpty():
            raise IndexError('??¢??????????????????')
        else:
            self.top -= 1
            return self.stack[self.top + 1]


expr = input().split()
stack = Stack(100)

for i in expr:
    try:
        stack.push(int(i))
    except:
        b = stack.pop()
        a = stack.pop()
        if i == '*':
            stack.push(a * b)
        if i == '+':
            stack.push(a + b)
        if i == '-':
            stack.push(a - b)

print(stack.pop())
                

### FIXED CODE ###

x = input().split()
A = []
for i in x:
    try:
        A.append(int(i))
    except:
        b = A.pop()
        a = A.pop()
        if i == '+':
            A.append(a + b)
        if i == '-':
            A.append(a - b)
        if i == '*':
            A.append(a * b)
print(A.pop())
l=[i for i in input()]

ans='No'

con=len(unique(l))
if (con==2) and (l.count(l[0])==2):
  ans='Yes'

print(ans)

### FIXED CODE ###

l=[i for i in input()]

ans='No'

con=len(set(l))
if (con==2) and (l.count(l[0])==2):
  ans='Yes'

print(ans)
A,B,C=input().split()
if(A==B):
    if(A!=C):
        print("Yes")
    else:
        print("No")
else:
    if(B==C):
        print("Yes")
    else if(A==C):
        print("Yes")
        else:
            print("No")


### FIXED CODE ###

A,B,C=input().split()
if(A==B):
    if(A!=C):
        print("Yes")
    else:
        print("No")
else:
    if(B==C):
        print("Yes")
    else:
        if(A==C):
            print("Yes")
        else:
            print("No")
import sys
sys.setrecursionlimit(10000000)
s=input()
n=len(s)
def mod10(x):
    p=x//10000000
    q=x-10000000*p
    if p==0:
        return (10**q)%2019
    return ((10**q)*mod10(p))%2019

def T(i):
    if i==n-1:
        return int(s[n-1])
    return T(i+1)+10**(n-1-i)*int(s[i])
dict={}
def modi(i,dict):
    if i in dict.keys():
        return dict[i]
    else:
        if i==n-1:
            dict[i]=int(s[i])
            return int(s[i])
        else:
           # c=modi(i+1,dict)+(10**(n-1-i)*int(s[i]))
            c=modi(i+1,dict)+(mod10(n-1-i)*int(s[i]))
            c=c%2019
            dict[i]=c
            return c

modnum={}
for i in range(n):
    #print(T(i))
    if int(s[i])==0:
        continue
    x=modi(i,dict)
 #   print(T(i),x)
    if x not in modnum.keys():
        modnum[x]=1
    else:
        modnum[x]+=1
sum=0
for md in modnum.keys():
    a=modnum[md]
    if md==0:
        sum+=a
        sum+=-(a*(a-1)//2)
   # print(a*(a-1)//2)
    sum+=a*(a-1)//2
#print(modnum)
print(sum)


### FIXED CODE ###

s,w=map(int,input().split())
if w<s:
    print("safe")
else:
    print("unsafe")
def main():
  import sys
  from heapq import heappush, heappop, heapify
  _int = int
  n = _int(input())
  a = [_int(e) for e in input().split()]
  b = [_int(e) for e in input().split()]
  result = 0
  finished = 0
  hq = [(-b[i], i) for i in range(n)]
  heapify(hq)
  while True:
    _, i = heappop(hq)
    if a[i] == b[i]:
      finished += 1
      continue
    if i == 0:
      j = b[n - 1] + b[1]
    elif i == n - 1:
      j = b[n - 2] + b[0]
    else:
      j = b[i - 1] + b[i + 1]
    k = max((hq[0] - b[i]) // j, 1)
    b[i] -= j * k
    if a[i] > b[i]:
      print(-1)
      sys.exit()
    result += k
    if a[i] == b[i]:
      finished += 1
      if finished == n:
        print(result)
        sys.exit()
    else:
      heappush(hq, (-b[i], i))
main()

### FIXED CODE ###

def main():
  import sys
  _int = int
  n = _int(input())
  a = [_int(e) for e in input().split()]
  b = [_int(e) for e in input().split()]
  result = 0
  q = [i for i in range(n) if b[i] != a[i]]
  while len(q) != 0:
    nq = []
    c = 0
    for i in q:
      if i == 0 or i == n - 1:
        j = b[(n + i - 1) % n] + b[(n + i + 1) % n]
      else:
        j = b[i - 1] + b[i + 1]
      if j > b[i] - a[i]:
        nq.append(i)
        continue
      c += 1
      k = (b[i] - a[i]) // j
      result += k
      b[i] -= j * k
      if a[i] != b[i]:
        nq.append(i)
    if c == 0 and len(nq) != 0:
      print(-1)
      sys.exit()
    q = nq
  print(result)
main()
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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

H = INT()

print(2**(ceil(log2(H)))-1)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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

H, A = MAP()

print(ceil(H/A))
print(input()[0]+input([1]+input()[2]))

### FIXED CODE ###

print(input()[0]+input()[1]+input()[2])
h,w = map(int, input().split())
m = []
for y in range(h):
  s = input()
  l = []
  for i in s:
    if i == '#':
      l.append(1)
    else:
      l.append(0)

print(m)
for y in range(h):
  s = ''
  for x in range(w):
    bomb = 0
    for i,j in ((-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)):
      if y+j < 0 or x+i < 0 or x+i >= w or y+j >= h:
        continue
      if m[y+j][x+i] == 1:
        bomb += 1
    if m[y][x] == 1:
      bomb = '#'
    s += str(bomb)
  print(s)
    

### FIXED CODE ###

h,w = map(int, input().split())
m = []
for y in range(h):
  s = input()
  l = []
  for i in s:
    if i == '#':
      l.append(1)
    else:
      l.append(0)
  m.append(l)

for y in range(h):
  s = ''
  for x in range(w):
    bomb = 0
    for i,j in ((-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)):
      if y+j < 0 or x+i < 0 or x+i >= w or y+j >= h:
        continue
      if m[y+j][x+i] == 1:
        bomb += 1
    if m[y][x] == 1:
      bomb = '#'
    s += str(bomb)
  print(s)
l,r=map(int,input().split())
m,ans=2019,2018
r=min(r,l+2019*2)
for i in range(l,r+1):
  for j in range(i+1,r+1):
    i%=m
    j%=m
    ans=min(ans,(i*j)%m)
print(ans)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
ans[0]=sum([2*a[i] for i in range(1,n,2)])
ans[0]=sum(a)-ans[0]

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

print(*ans)
class unionfind():

    def __init__(self,n):
        self.par=[i for i in range(n)]
        
    def root(self,x):
        #自分自身の番号==parの番号なら根
        par=self.par
        if par[x]==x:
            return x
        else:
            self.root = self.root(par[x])
            return self.root
        
    def unite(self,x,y):
        #xにyをくっつける
        rx=self.root(x)
        ry=self.root(y)
        
        if rx==ry:
            return
        else:
            self.par[ry]=rx
            
    def same(self, x,y):
        return self.root(x) == self.root(y)
    
    def par_print(self):
        print(self.par)
    
n,m = map(int,input().split())

friend = unionfind(n)

for i in range(m):
    a,b = map(int,input().split())
    friend.unite(a-1,b-1)
    
# print(friend.par_print())

ans = max([friend.par.count(i) for i in range(n)])

print(ans)

### FIXED CODE ###


class unionfind():

    def __init__(self,n):
        #親番号<0なら根
        #根の場合、数値の絶対値が要素数
        self.par=[-1 for i in range(n)]
        
    def root(self,x):
        
        par=self.par
        if par[x]<0:
            return x
        else:
            self.x = self.root(par[x])
            return self.x
        
    def unite(self,x,y):
        #高いほうに低いほうをくっつける
        rx=self.root(x)
        ry=self.root(y)
        
        if rx==ry:
            return
        else:
            if self.par[rx]>self.par[ry]:
                rx,ry = ry,rx
                
            self.par[rx]+=self.par[ry]
            self.par[ry] = rx

            
    def same(self, x,y):
        return self.root(x) == self.root(y)
    
    def par_print(self):
        print(self.par)
        
    def count(self, x):
        return -self.root(x)
    
n,m = map(int,input().split())

friend = unionfind(n)

for i in range(m):
    a,b = map(int,input().split())
    friend.unite(a-1,b-1)
    # print(friend.par_print())
    
# print(friend.par_print())

ans = -min(friend.par)

print(ans)
N = input()
_list = input().split(" ")
_list = [int(a) for a in _list]
aspect = [a for a in _list if a % 2==0]
ans = []
for a in even:
    if a % 3 == 0 or a % 5 == 0:
        ans.append(True)
if len(aspect) ==len(ans):
    print("APPROVED")
else:
    print("DENIED")

### FIXED CODE ###

N = input()
_list = input().split(" ")
_list = [int(a) for a in _list]
aspect = [a for a in _list if a % 2==0]
ans = []
for a in aspect:
    if a % 3 == 0 or a % 5 == 0:
        ans.append(True)
if len(aspect) ==len(ans):
    print("APPROVED")
else:
    print("DENIED")
N,K=map(int,input().split())

if N > K:
  
  wide = N - K
  
elif N = K:
  
  wide = 0
  
else:
  wide = 1
  
print(wide)

### FIXED CODE ###

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

if N > K and K !=1:
	wide = N - K
elif N == K or K==1:
  	wide = 0
else:
    wide = 0
    
print(wide)
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
    
ns = defaultdict(set)
for _ in range(n-1):
    u,v = [int(c) for c in input().split()]
    ns[u-1].add(v-1)
    ns[v-1].add(u-1)

from bisect import bisect_left
 
l = [a[0]]
# for a in A[1:]:
#     if a > L[-1]:
#         # Lの末尾よりaが大きければ増加部分列を延長できる
#         L.append(a)
#     else:
#         # そうでなければ、「aより小さい最大要素の次」をaにする
#         # 該当位置は、二分探索で特定できる
#         L[bisect_left(L, a)] = a
# return len(L)

ans = [None] * n

def sub(u, prev, lst, old, ind, ans):
    aa = a[u]
    if len(lst)==0 or aa > lst[-1]:
        lst.append(aa)
        old = -1
        ind = None
    else:
        ind = bisect_left(lst, aa)
        old = lst[ind]
        lst[ind] = aa
    ans[u] = len(lst)
#     print(lst)
    for v in ns[u]:
        if prev==v:
            continue
        sub(v, u, lst, old, ind, ans)
    if old==-1:
        lst.pop()
    elif old is not None:
        lst[ind] = old


sub(0, -1, [], None, None, ans)
print("\n".join(map(str, ans)))


### FIXED CODE ###


from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))

import sys
sys.setrecursionlimit(max(1000, 2*n))


ns = defaultdict(set)
for _ in range(n-1):
    u,v = [int(c) for c in input().split()]
    ns[u-1].add(v-1)
    ns[v-1].add(u-1)

from bisect import bisect_left
 
l = [a[0]]
# for a in A[1:]:
#     if a > L[-1]:
#         # Lの末尾よりaが大きければ増加部分列を延長できる
#         L.append(a)
#     else:
#         # そうでなければ、「aより小さい最大要素の次」をaにする
#         # 該当位置は、二分探索で特定できる
#         L[bisect_left(L, a)] = a
# return len(L)

ans = [None] * n

def sub(u, prev, lst, old, ind, ans):
    aa = a[u]
    if len(lst)==0 or aa > lst[-1]:
        lst.append(aa)
        old = -1
        ind = None
    else:
        ind = bisect_left(lst, aa)
        old = lst[ind]
        lst[ind] = aa
    ans[u] = len(lst)
#     print(lst)
    for v in ns[u]:
        if prev==v:
            continue
        sub(v, u, lst, old, ind, ans)
    if old==-1:
        lst.pop()
    elif old is not None:
        lst[ind] = old

lst = []
sub(0, -1, lst, None, None, ans)
print("\n".join(map(str, ans)))
import numpy as np
bars = list(map(int, input().split(" ")))

length = len(bars)

def check_triangle(a, b, c):
    if a == b or b == c or c == a:
        return 0
    if ((a + b) > c) and ((b + c) > a) and ((c + a) > b):
        return 1
    else:
        return 0


count = 0
for i, li in enumerate(bars):
    for k in range(i+1, length):
        res = np.sum([check_triangle(bars[i], bars[k], bars[j]) for j in range(k+1, length)])
        count += int(res)
print(count)

### FIXED CODE ###

import numpy as np
N = input()
bars = list(map(int, input().split(" ")))

length = len(bars)

def check_triangle(a, b, c):
    if a == b or b == c or c == a:
        return 0
    if ((a + b) > c) and ((b + c) > a) and ((c + a) > b):
        return 1
    else:
        return 0


count = 0
for i, li in enumerate(bars):
    for k in range(i+1, length):
        res = np.sum([check_triangle(bars[i], bars[k], bars[j]) for j in range(k+1, length)])
        count += int(res)
print(count)
h,w=map(int,input().split())
cnt=0
 
if w%2==0:
  print((w//2)*h)
elif w%2!=0 and w!=1:
  if h%2==0:
    print(w*(h//2))
  else:
    print(w*((h-1)//2)+(w+1)//2)
elif w==1:
  print(1)

### FIXED CODE ###

li=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())

print(li[k-1])
a = input()
print(700+a.count(o)*100)

### FIXED CODE ###

a = input()
print(700+a.count('o')*100)
S, T = stdin.readline().rstrip().split()
S = S[::-1]
if S == T:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input().lower()
T = input().lower()
for i in range(len(S)):
  S = S[len(S)-1:len(S)] + S[0:len(S)-1]
  if S == T:
    break
if S == T:
  print("Yes")
else:
  print("No")
a,b,c,d,e,k=map(int,input().split())
if e-a>k:print(":(")
else:print("Yey!")

### FIXED CODE ###

a,b,c,d,e=int(input()),int(input()),int(input()),int(input()),int(input())
k=int(input())
print("Yay!"if e-a<=k else":(")
A,B=map(int,input().split())
for x in range(10*B,10*B+10):
    if A*100/8<=x<=A*100/8+100/8:
        print(x)
        exit()
print("-1")

### FIXED CODE ###

S=input()
if S=="AAA" or S=="BBB":
    print("No")
else:
    print("Yes")
n = int(inputs[0])
Y = []
for s in inputs[1:]:
    x, l = map(int, s.split())
    Y.append((x-l+1, x+l-1))
Y.sort(key=lambda x: x[0])

cnt = 0
_, r0 = Y[0]
for i in range(1, n):
    l, r = Y[i]
    if r0 < l:
        cnt += 1
        r0 = r
print(cnt)

### FIXED CODE ###

import sys
inputs = sys.stdin.readlines()

n = int(inputs[0])
Y = []
for s in inputs[1:]:
    x, l = map(int, s.split())
    Y.append((x-l, x+l))
Y.sort(key=lambda x: x[1])

cnt = 1
_, r0 = Y[0]
for i in range(1, n):
    l, r = Y[i]
    if r0 <= l:
        cnt += 1
        r0 = r
    
print(cnt)