Problem:
Score : 100 points

Problem Statement

You are given two positive integers a and b.
Let x be the average of a and b.
Print x rounded up to the nearest integer.

Constraints

a and b are integers.

1 \leq a, b \leq 100

Input

Input is given from Standard Input in the following format:

a b

Output

Print x rounded up to the nearest integer.

Sample Input 1

1 3

Sample Output 1

2

The average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.

Sample Input 2

7 4

Sample Output 2

6

The average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.

Sample Input 3

5 5

Sample Output 3

5

Solution in PyPy3 (2.4.0) (judge verdict: Runtime Error)

import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

S = input()
X,Y=LI()

while S and S[0] == 'F':
    S = S[1:]
    X -= 1

isX = True
cur = 0
xs = []
ys = []
for i in range(len(S)):
    if S[i] == 'T':
        if cur:
            if isX:
                xs.append(cur)
            else:
                ys.append(cur)
        isX = not isX
        cur = 0
    elif S[i] == 'F':
        cur += 1

if cur:
    if isX:
        xs.append(cur)
    else:
        ys.append(cur)

X=abs(X)
Y=abs(Y)
sumxs = sum(xs)
sumys = sum(ys)
if X > sumxs or Y > sumys:
    print('No')
    exit()

memo1 = [[0]*(sumxs*2+10) for i in range(len(xs)+1)]
memo2 = [[0]*(sumys*2+10) for i in range(len(ys)+1)]

memo1[0][0] = 1
memo2[0][0] = 1
for i in range(1, len(xs)+1):
    for j in range(-sumxs, sumxs+1):
        memo1[i][j] = memo1[i-1][j+xs[i-1]]
        memo1[i][j] = memo1[i-1][j-xs[i-1]]

# print(len(ys))
# print(len(memo2))
for i in range(1, len(ys)+1):
    for j in range(-sumys, sumys+1):
        memo2[i][j] = memo2[i-1][j+ys[i-1]]
        memo2[i][j] = memo2[i-1][j-ys[i-1]]

print('Yes' if memo1[len(xs)][X] and memo2[len(ys)][Y] else 'No')