AtCoder Beginner Contest 128 - Apple Pie

We have A apples and P pieces of apple.
We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.
Find the maximum number of apple pies we can make with what we have now.

-----Constraints-----
 - All values in input are integers.
 - 0 \leq A, P \leq 100

-----Input-----
Input is given from Standard Input in the following format:
A P

-----Output-----
Print the maximum number of apple pies we can make with what we have.

-----Sample Input-----
1 3

-----Sample Output-----
3

We can first make one apple pie by simmering two of the three pieces of apple. Then, we can make two more by simmering the remaining piece and three more pieces obtained by cutting the whole apple.

Difficulty: EASY

Starter code:

Solutions:
(k, n) = map(int, input().split())
n += k * 3
print(n // 2)


(A, P) = map(int, input().split())
n = (A * 3 + P) // 2
print(n)


(a, p) = map(int, input().split())
print((3 * a + p) // 2)


(A, P) = list(map(int, input().split()))
P = P + 3 * A
print(P // 2)


(n, p) = map(int, input().split())
ans = 3 * n + p
print(ans // 2)


(Ful, Pic) = map(int, input().split())
print((Ful * 3 + Pic) // 2)


(A, B) = map(int, input().split())
print((3 * A + B) // 2)


(A, P) = map(int, input().split())
ans = (3 * A + P) // 2
print(ans)


(A, N) = map(int, input().split())
print((A * 3 + N) // 2)


(a, b) = map(int, input().split())
print((b + a * 3) // 2)


(a, k) = map(int, input().split())
print((a * 3 + k) // 2)


(s, t) = map(int, input().split())
f = (s * 3 + t) // 2
print(f)


(a, p) = map(int, input().split())
b = a * 3 + p
c = int(b / 2)
print(c)


(x, y) = map(int, input().split())
res = (x * 3 + y) // 2
print(res)


(A, P) = input().split()
print((3 * int(A) + int(P)) // 2)


a = input().rstrip().split(' ')
b = int(a[0])
c = int(a[1])
c = b * 3 + c
print(int(c / 2))


(a, p) = (int(i) for i in input().split())
print((3 * a + p) // 2)


(A, P) = map(int, input().split())
s = A * 3 + P
print(s // 2)


print(eval(input().replace(' ', '*3+')) // 2)


(N, P) = map(int, input().split())
print((N * 3 + P) // 2)


(A, P) = tuple(map(int, input().split()))
print((A * 3 + P) // 2)


url = 'https://atcoder.jp//contests/abc128/tasks/abc128_a'

def main():
	(a, p) = list(map(int, input().split()))
	p += a * 3
	print(p // 2)

def __starting_point():
	main()
__starting_point()


(a, p) = map(int, input().split())
P = p + 3 * a
ans = P // 2
print(ans)


(hole_apple, piece_apple) = map(int, input().split())
total_piece_apple = hole_apple * 3 + piece_apple
print(total_piece_apple // 2)


(A, P) = map(int, input().split())
p = A * 3 + P
print(p // 2)


(x, p) = map(int, input().split())
print(int((x * 3 + p) / 2))


(A, P) = (int(i) for i in input().split())
print((P + 3 * A) // 2)


(N, K) = map(int, input().split())
print((3 * N + K) // 2)


(a, p) = list(map(int, input().split()))
total_pie = (a * 3 + p) // 2
print(total_pie)


(A, P) = map(int, input().split())
ap = A * 3 + P
print(ap // 2)


(a, n) = map(int, input().split())
print((3 * a + n) // 2)


(a, b) = map(int, input().split())
s = 3 * a + b
r = s // 2
print(r)


def solver():
	(A, P) = [int(n) for n in input().split()]
	return (A * 3 + P) // 2

def __starting_point():
	print(solver())
__starting_point()


(n, m) = map(int, input().split())
print((3 * n + m) // 2)


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(a, p) = Input()
	x = a * 3 + p
	ans = x // 2
	print(ans)
main()


(A, P) = map(int, input().split())
X = A * 3 + P
print(int(X // 2))


(A, P) = map(int, input().split())
PP = 3 * A + P
print(PP // 2)


(A, P) = map(int, input().split())
c = (A * 3 + P) // 2
print(c)


(N, M) = map(int, input().split())
print(int((N * 3 + M) / 2))


(x, y) = map(int, input().split())
a = (3 * x + y) // 2
print(a)


(b, c) = map(int, input().split())
print((b * 3 + c) // 2)


(a, p) = map(int, input().split())
k = a * 3 + p
ans = k // 2
print(ans)


(A, P) = map(int, input().split())
a = A * 3 + P
print(a // 2)


(n, x) = map(int, input().split())
print((n * 3 + x) // 2)


(A, P) = map(int, input().split())
Ap = 3 * A + P
print(Ap // 2)


(A, P) = map(int, input().split())
P = P + A * 3
apple_pie = 0
while P > 1:
	apple_pie = apple_pie + 1
	P = P - 2
print(apple_pie)


def inputlist():
	return [int(j) for j in input().split()]
(A, P) = inputlist()
print((3 * A + P) // 2)


(A, P) = map(int, input().split())
slice = A * 3 + P
print(slice // 2)


(A, P) = map(int, input().split())
num = 3 * A + P
print(num // 2)


(A, P) = map(int, input().split())
tot = 3 * A + P
print(tot // 2)


import math
(a, p) = list(map(int, input().split()))
print(math.floor((3 * a + p) / 2))


(A, P) = list(map(int, input().split(' ')))
if A == 0:
	print(0)
	return
A = A * 3
total = A + P
print(int(total // 2))


(A, P) = input().split()
ringo = int(A) * 3
rin = ringo + int(P)
ri = rin // 2
print(ri)


(a, p) = map(int, input().split())
k = 3 * a + p
ap = k // 2
print(ap)


(a, pi) = map(int, input().split())
print((a * 3 + pi) // 2)


(A, P) = map(int, input().split())
print(A * 3 + P >> 1)


(a, b) = map(int, input().split())
c = (3 * a + b) / 2
import math
print(math.floor(c))


a = list(map(int, input().split()))
print((a[0] * 3 + a[1]) // 2)


(A, P) = map(int, input().split())
apple_fragment = A * 3 + P
apple_pie = apple_fragment // 2
print(apple_pie)


(a, p) = map(int, input().split())
m = a * 3 + p
if m % 2 == 0:
	print(m // 2)
else:
	print((m - 1) // 2)


(w, p) = map(int, input().split())
print((w * 3 + p) // 2)


(a, p) = [int(x) for x in input().split()]
print((a * 3 + p) // 2)


(A, P) = map(int, input().split())
P1 = P + 3 * A
print(P1 // 2)


(a, p) = map(int, input().split())
print(a * 3 + p >> 1)


(p, q) = map(int, input().split())
print((p * 3 + q) // 2)


(a, q) = map(int, input().split())
print((a * 3 + q) // 2)


s = input().split()
t = int(s[0]) * 3 + int(s[1])
print(t // 2)


(A, P) = map(int, input().split())
S = (3 * A + P) // 2
print(S)