Problem:


Score : 100 points

Problem Statement

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

1 3

Sample Output 1

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.

Sample Input 2

0 1

Sample Output 2

0

We cannot make an apple pie in this case, unfortunately.

Sample Input 3

32 21

Sample Output 3

58



Sample input:
1 3


Sample output:
3

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, p = map(int,input().split())

print((3 * a + p) // 2)

Submission status: Accepted

Solution code:
a, p= map(int,open(0).read().split())

print( (a*3+p)//2)

Submission status: Accepted

Solution code:
l = raw_input().split()
A = int(l[0])
P = int(l[1])

ans = int((A * 3 + P)/2)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, P = map(int, input().split())

P += A * 3
print(int(P / 2))

Submission status: Accepted

Solution code:
a, p = map(int, input().split())

p += 3*a

ans = (int)(p / 2)

print(ans)

Submission status: Accepted

Solution code:
def main():
    A, P = map(int, input().split())
    print((A * 3 + P) // 2)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, P = map(int, input().split())
a = 3*A
b = a + P
ans = b//2
print(ans)

Submission status: Accepted

Solution code:
a,p=list(map(int, input().split()))
ans=a*3
ans+=p
print(int(ans/2))

Submission status: Accepted

Solution code:
A,P = (int(i) for i in input().split())

kakera = P + A*3
applepie = kakera // 2

print(applepie)

Submission status: Accepted

Solution code:
a, b = (int(_) for _ in input().split())  
print(int((a*3+b)//2))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  A, P = readInts()
  ans = (A * 3 + P) // 2
  print(ans)

if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
A, P = map(int, input().split())
hahen = 3 * A + P
print(hahen//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N, M = map(int, input().rstrip().split(' '))

print((N * 3 + M) // 2)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

a, p = na()
print((a*3+p)//2)

Submission status: Accepted

Solution code:
import bisect
from operator import itemgetter
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,P = IL()

print((A*3+P)//2)

Submission status: Accepted

Solution code:
import sys
from fractions import gcd
import bisect

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]



a, p = na()

keppen = 3 * a + p

print(keppen // 2)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,p = map(int, input().split(' '))
result = (a * 3 + p) // 2
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,p=map(int,raw_input().split())
print (3*a + p)/2

Submission status: Accepted

Solution code:
a, p = map(int, raw_input().strip().split())
x = (3 * a + p) // 2
print x

Submission status: Accepted

Solution code:
n,m=list(map(int,input().split()))
m=n*3+m
a=m//2
print(int(a))

Submission status: Accepted

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsm = lambda: map(str, sys.stdin.readline().split())

a, p = nm()
print((3 * a + p) // 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, P = map(int,input().split())

print((A*3 + P)//2)

Submission status: Accepted

Solution code:
A,P=map(int, input().split())
#A,P=1,3
print((A*3+P)//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,P=list(map(int,input().strip().split(' ')))

print((3*A+P)//2)

Submission status: Accepted

Solution code:
A, P = [int(i) for i in input().split()]
S = 3 * A + P
print(S // 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

a, p = map(int, input().split())

print(int((a * 3 + p)/2))

Submission status: Accepted

Solution code:
A,P = map(int,input().split(' '))

print((A*3+P)//2)

Submission status: Accepted

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
x=3*a+b
print(x//2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun May 26 20:58:25 2019

@author: USER
"""

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

print((A*3+P)//2)

Submission status: Accepted

Solution code:
a, p = map(int, input().split())

hahen = a*3
pi = (hahen + p)// 2
print(pi)

Submission status: Accepted

Solution code:
import bisect
import heapq
A,P = map(int,input().split())

print((A*3+P)//2)

Submission status: Accepted

Solution code:
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

a,b = map(int,input().split())

print((a*3+b)//2)

Submission status: Accepted

Solution code:
import math
import fractions
import copy
#以下てんぷら
def j(q):
    if q==1: print("YES")
    elif q == 0:print("NO")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


#n = ip()                                     #入力整数1つ
m,n= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
print((m*3+n)//2)

Submission status: Accepted

Solution code:
A, P = [int(n) for n in input().split()]
print((A*3 + P) // 2)

Submission status: Accepted

Solution code:
from sys import exit

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

P += A * 3

print(P // 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
A, P = map(int, input().split())
print((A*3+P)//2)

Submission status: Accepted

Solution code:
a, p = [int(i) for i in input().split()]

k = a * 3 + p

print(k//2)

Submission status: Accepted

Solution code:

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,P = map(int,input().split())

print(( A*3 + P ) // 2)

Submission status: Accepted

Solution code:
# coding: utf-8

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

print((A * 3 + P) // 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

c = a *3 + b

print(int(c/2))

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,p = LI()
    print((a*3+p)//2)
    return

#B
def B():
    n = I()

    return

#C
def C():
    n = I()

    return

#D
def D():
    n = I()

    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    A()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())

print((3*a+b)//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def li():
    return list(map(int, input().split()))


if __name__ == '__main__':
    [a, p] = li()
    print((a * 3 + p) // 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, p = map(int, input().split())

ans = ((a * 3 + p) // 2)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
# coding; utf-8
def main():
    A, P = map(int, input().split())
    P += A*3
    ans = int(P/2)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import stdin

def main():
     n,m = [int(x) for x in stdin.readline().split()]
     print((3*n+m)//2)

if __name__ == '__main__':
     main()

Submission status: Accepted

Solution code:
def getN():
    return int(input())

def getMN():
    return list(map(int, input().split()))

def getlist():
    return list(map(int, input().split()))

a,p = getMN()

p += a * 3

ans = p // 2

print(ans)

Submission status: Accepted

Solution code:
class Solution:
    def main(self):
        A, P = map(int, input().split())
        total = 3*A + P
        print(total//2)

if __name__ == '__main__':
    Solution().main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,P = (int(x) for x in input().split())

P += A*3
print(P//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

A,P=list(map(int,input().split()))

P+=A*3

print(P//2)

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math

import array
import bisect
import collections
from collections import Counter, defaultdict
import fractions
import heapq
import re

sys.setrecursionlimit(1000000)


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]

def argsort(l, reverse=False):
    return sorted(range(len(l)), key=lambda i: l[i], reverse=reverse)

def argmin(l):
    return l.index(min(l))

def YESNO(ans, yes="YES", no="NO"):
    print([no, yes][ans])

II = lambda: int(input())
MI = lambda: map(int, input().split())
MIL = lambda: list(MI())
MIS = lambda: input().split()


def main():
    a, p = MI()
    return (a * 3 + p) // 2


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
A, P = map(int, input().split())

tmp = P + A * 3

print(int(tmp / 2))

Submission status: Accepted

Solution code:
A, P = tuple([int(x) for x in input().split(' ')])

t = A * 3 + P

print(int(t // 2))

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions
from collections import deque

INF = 10 ** 10

A, P = [int(x) for x in stdin.readline().rstrip().split()]

ans = (A * 3 + P) // 2

print(ans)

Submission status: Accepted

Solution code:
a, p = map(int, input().split())

ans = (a*3+p) // 2

print(ans)

Submission status: Accepted

Solution code:
a,p = map(int,input().split())

p+=a*3
print(p//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, p = (int(z) for z in input().split())
print((a * 3 + p) // 2)

Submission status: Accepted

Solution code:
a, p = map(int, input().split())
pieces = 3 * a + p
pies = pieces // 2
print(pies)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n = int(input())
# 
# s = input()


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

Submission status: Accepted

Solution code:
n, m = input().split()
A = int(n)
P = int(m)

N = A * 3 + P
result = N // 2
print(result)

Submission status: Accepted

Solution code:
A, P=map(int, input().split())

print((A*3+P)//2)

Submission status: Accepted

Solution code:
A, P = [int(s) for s in input().split()]

P += 3 * A

print(P // 2)

Submission status: Accepted

Solution code:
A, P = [int(c) for c in input().split()]

print((A*3+P)//2)

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
A, P = inpl()
print((A*3 + P)//2)

Submission status: Accepted

Solution code:
A, P = map(int, input().split())

print((A * 3 + P)//2)

Submission status: Accepted

Solution code:
A, P = [int(i) for i in input().split()]
sum = A*3 + P
print(sum//2)

Submission status: Accepted

Solution code:
A, P = map(int, input().split(" "))

piece = 3 * A + P
print(piece // 2)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  a,p=LI()
  p+=a*3
  print(p//2)

main()
# print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, p = map(int, input().split())

print((a*3+p)//2)

Submission status: Accepted

Solution code:
a, p = map(int, input().split())

p = p + a * 3
print(p // 2)

Submission status: Accepted

Solution code:
A, P = map(int, input().split())
tmp = A*3 + P
print(int(tmp / 2))

Submission status: Accepted

Solution code:
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

sys.setrecursionlimit(10000)
INF = float('inf')



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

Submission status: Accepted

Solution code:
A, P = map(int, input().split())

Q = P + 3 * A
print(Q // 2)

Submission status: Accepted

Solution code:
A, P = map(int, input().split())

print((3*A+P)//2)

Submission status: Accepted

Solution code:
A,P=[int(x) for x in input().split()]
print(int((A*3+P)/2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,p=map(int,input().split(' '))
k = a*3+p
print(k//2)

Submission status: Accepted

Solution code:
A,P = map(int,input().split())
kakera = 3*A + P
print(str(kakera//2))

Submission status: Accepted

Solution code:
import sys, math, collections, heapq, itertools
F = sys.stdin
def single_input(): return F.readline().strip("\n")
def line_input(): return F.readline().strip("\n").split()
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while a % b > 0: a, b = b, a % b
    return b
  
def solve():
    A, P = map(int, line_input())
    total = P + A * 3
    print(total//2)
    return 0
  
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3

#import numpy as np
#import scipy, scipy.special

# Python 3 modules: https://docs.python.org/3/library/

import math, itertools, operator
from math import *
from math import factorial as fact
from operator import itemgetter, attrgetter
from itertools import permutations, combinations
from functools import reduce
# Use scipy for stats: https://docs.scipy.org/doc/scipy/reference/stats.html
# Before Python 3.5
from fractions import gcd

inf = float('inf')

def lcm(a, b):
    return a * b // gcd(a,b)

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))

################################################################################

A, P = input_ints()

P += 3 * A
print(P // 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    A, P = map(int, input().split())

    return (3*A + P) // 2


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, P = map(int, input().split())

ans = (3 * A + P) // 2
print(ans)

Submission status: Accepted

Solution code:
A,P = map(int,input().split())

ans =P + A*3
ans = ans//2
print(ans)

Submission status: Accepted

Solution code:
a,p = (int(num) for num in input().split())
b = a*3 + p
print(b//2)

Submission status: Accepted

Solution code:
a, p = map(int, input().split())

a_p = a*3

print((a_p + p) // 2)

Submission status: Accepted

Solution code:
#ABC128



A,P = list(map(int, input().split()))

print((A*3 + P) // 2)

Submission status: Accepted

Solution code:
A, P = map(int, input().split())

apple = A * 3 + P
print(apple // 2)

Submission status: Accepted

Solution code:
A,P = map(int,input().split(" "))
print((3 * A + P)//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,p = (int(i) for i in input().split())

print( (a*3+p)//2 )

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
A, P = list(map(int, input().split()))
P += A * 3

print(P//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    buf = input()
    buflist = buf.split()
    A = int(buflist[0])
    P = int(buflist[1])
    P += A * 3
    print(P // 2)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
a, p = map(int, input().split())
print((a * 3 + p) // 2)

Submission status: Accepted

Solution code:
def main():
    from sys import stdin, stdout

    def read():
        return stdin.readline().rstrip('\n')

    def read_array(sep=None, maxsplit=-1):
        return read().split(sep, maxsplit)

    def read_int():
        return int(read())

    def read_int_array(sep=None, maxsplit=-1):
        return [int(a) for a in read_array(sep, maxsplit)]

    def write(*args, **kwargs):
        sep = kwargs.get('sep', ' ')
        end = kwargs.get('end', '\n')
        stdout.write(sep.join(str(a) for a in args) + end)

    def write_array(array, **kwargs):
        sep = kwargs.get('sep', ' ')
        end = kwargs.get('end', '\n')
        stdout.write(sep.join(str(a) for a in array) + end)

    a, p = read_int_array()
    write((a * 3 + p) // 2)

main()

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
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 list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)


def main():
    n,p = LI()
    p += n * 3

    return p // 2


print(main())

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
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

A, P = MAP()

print((3*A+P)//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
inf = float('inf')
mod = 10**9+7


def INT_(n): return int(n)-1


def MI(): return map(int, input().split())


def MF(): return map(float, input().split())


def MI_(): return map(INT_, input().split())


def LI(): return list(MI())


def LI_(): return [int(x) - 1 for x in input().split()]


def LF(): return list(MF())


def LIN(n: int): return [input() for _ in range(n)]


def LLIN(n: int): return [LI() for _ in range(n)]


def LLIN_(n: int): return [LI_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


def I(): return int(input())


def F(): return float(input())


def ST(): return input().replace('\n', '')


def main():
    A, P = MI()
    print((A*3+P)//2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#

import itertools
from collections import Counter
from collections import defaultdict
import bisect

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#N = int(input())
A, P = map(int, input().split())

print((A*3+P)//2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

Submission status: Runtime Error

Solution code:
N = int(input())

my_list = []

for i in range(N):
    sp = input().split()
    sp[1] = int(sp[1])
    sp.insert(0, i+1)
    
    my_list.append(sp)
    
my_list.sort(key = lambda x: x[2], reverse=True)
my_list.sort(key = lambda x: x[1])

for i in my_list:
    print(i[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from bisect import bisect_left
from operator import itemgetter
import sys
input = sys.stdin.buffer.readline

def main():
	N, Q = map(int, input().split())
	A = [tuple(map(int, input().split())) for i in range(N)]
	A.sort(key = itemgetter(2))
	D = [int(input()) for i in range(Q)]
	ans = [-1] * Q
	
	donecnt = 0
	donei = set()
	for a in A:
		S, T, X = a
		for j in range(bisect_left(D, S - X), bisect_left(D, T - X)):
			if not j in donei:
				ans[j] = X
				donei.add(j)
				donecnt += 1
				if donecnt == Q:
					break
		if donecnt == Q:
			break
	for k in range(Q):
		print(ans[k])
		
if __name__ == "__main__":
	main()

Submission status: Runtime Error

Solution code:
from bisect import bisect_left
import sys
input = sys.stdin.readline

def main():
	N, Q = map(int, input().split())
	A = [tuple(map(int, input().split())) for i in range(N)]
	A.sort(key = lambda x: x[2])
	D = [int(input()) for i in range(Q)]
	ans = [-1] * Q
	
	donecnt = 0
	done = [False] * Q
	for a in A:
		S, T, X = a
		for j in range(bisect_left(D, S - X), bisect_left(D, T - X)):
			if not done[j]:
				ans[j] = X
				done[j] = True
				donecnt += 1
				if donecnt == Q:
					break
		if donecnt == Q:
			break
	for k in range(Q):
		print(ans[k])
		
if __name__ == "__main__":
	main()

Submission status: Runtime Error

Solution code:
a,p = map(int,input().split())
print((a*b+p)//2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
from heapq import *
input = sys.stdin.readline

def main():
    n, q = map(int, input().split())
    
    key = []
    for i in range(n):
        s, t, x = map(int, input().split())
        l, r = max(0, s-x), max(0, t-x)
        key.append((l, 1, x))
        key.append((r, -1, x))

    key.sort()
    judge = []
    now = set()
    already = dict()
    
    index = 0
    ans = -1
    for i in range(q):
        d = int(input())
        for i in range(index, 2*n):
            s, j, x = key[i]
            if s > d:
                index = i
                break
            if j == 1:
                heappush(judge, x)
                now.add(x)
            else:
                now.remove(x)
                if x in already:
                    already[x] += 1
                else:
                    already[x] = 1
                    
                    
        while judge:
            if judge[0] in already and already[judge[0]] > 0:
                already[judge[0]] -= 1
                heappop(judge)
            else:
                break
        if judge:
            ans = judge[0]
        else:
            ans = -1      
            
        print(ans)

    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = int(input())

res = []
for i in range(n):
  city, value = input().split()
  value = int(value)
  res.append([city, value, i])
res_s = sorted(res, key = lambda x: (x[0], -x[1]))
for i in range(n):
  print(res_s[i][2])

Submission status: Runtime Error

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
s = {}
for i in range(n):
	S,P = map(str,input().split())
	s[i+1] = [S, -int(P)]

note = sorted(s.items(), key=lambda x: (x[1][0],x[1][1])
print(note)

Submission status: Runtime Error

Solution code:
A,P=map(int,input().split())
print((3A+P)//2)

Submission status: Runtime Error

Solution code:
a,p=map(int,inputy().split())
print((3*a+p)//2)

Submission status: Runtime Error

Solution code:
a,p=map(int,inputy().split())
a=3*p
print((a+p)//2)

Submission status: Runtime Error

Solution code:
A = int(input())
P = int(input())

apple_pie1 = (3 * A + P) / 2
apple_pie2 = (3 * A + P - 1) / 2


if apple_pie1 % 2 == 0:
  print(apple_pie1)
  
else:
  print(apple_pie2)

Submission status: Runtime Error

Solution code:
A = int(input())
P = int(input())

apple_pie = 3 * A + P

print(apple_pie // 2)

Submission status: Runtime Error

Solution code:
#入力:N,M(int:整数)
def input2():
	return map(int,input().split())
  
a,p=input2()
ans=((A*3)+p)//2
print(ans)

Submission status: Runtime Error

Solution code:
a､b= map(int,input().split())
apple_pie = (a*3 + b) //2
print(apple_pie)

Submission status: Runtime Error

Solution code:
a,p = map(int, input().spilit())
print((3*a+p)/2-(3*a+p%2))

Submission status: Runtime Error

Solution code:
a,p = map(int,input().split())
a == a*3*p
a + p == int,ap
print(ap)

Submission status: Runtime Error

Solution code:
a,p = map(int,input().split())
ap = (int,input())
a == 3*p
a + p == ap
print(ap)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
lis = [(input() + " " + str(i+1)).split() for i in range(N)]
 
lis = [k for k in lis]
 
lis.sort(key=lambda k: int(k[1]), reverse=True)
lis.sort(key=lambda k: k[0])
 
 
for j in lis:
    print(j[2])

Submission status: Runtime Error

Solution code:
N = int(input())
list1 = [(input() + " " + str(i+1)).split() for i in range(N)]
 
list1 = [k for k in list1]
 
list1.sort(key=lambda k: int(k[1]), reverse=True)
list1.sort(key=lambda k: k[0])
 
 
for i in list1:
    print(i[2])