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: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
P = int(input())
K = 3 * A + P
print(K//2)

Submission status: Runtime Error

Solution code:
import math

a=input()
b=input()

bb=math.floor((a*3+b)/2)

print(bb)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math
import sys
args = sys.argv
A = int(args[1])
P = int(args[2])

if 0<=A and P<=100 :
    Pi = math.floor((3*A +P)/2)
    print(Pi)
else :
    print("ERROR")

Submission status: Runtime Error

Solution code:
import math
import sys

args = sys.argv
A = int(args[1])
P = int(args[2])

if 0<=A and P<=100 :
    Pi = math.floor((3*A +P)/2)
    print(Pi)
else :
    print("ERROR")

Submission status: Runtime Error

Solution code:
import math
import sys
args = sys.argv
A = int(args[1])
P = int(args[2])
if 0<=A and P<=100 :
    Pi = math.floor((3*A +P)/2)
    print(Pi)

Submission status: Runtime Error

Solution code:
#!/work/yota509/env_python3/bin/python3
# -*- coding: utf-8 -*-

#apple_pie
# りんごA個　かけらがP個。砕くことで1個が三個に。
# かけら２個を鍋で煮込んでアップルパイ1個
# 入力は整数
# 0<=A,P<=100
import argparse
import math
import sys
args = sys.argv
A = int(args[1])
P = int(args[2])

Pi = math.floor((3*A +P)/2)
print(Pi)

Submission status: Runtime Error

Solution code:
in=input().split(' ')
a=eval(in[0])*3
p=eval(in[1])
print((a+p)/2)

Submission status: Runtime Error

Solution code:
n=int(input())
q=[input().split() + [i] for i in range(n)]
for i in range(n):
    q[i][1]=int(q[i][1])
list_point = sorted(q, key=lambda x:x[1], reverse=1)
list_city = sorted(list_point, key=lambda x:x[0], reverse=0)
for s,t,r in list_city:
    print(r+1)

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
class Main{
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int P = scanner.nextInt();
        int ans = (A*3+P)/2;
        System.out.println(ans);
    }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
using System;
using System.Linq;
using System.Collections.Generic;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split().Select(z => int.Parse(z)).ToArray();
            int a = line[0], p = line[1];

            p += a * 3;

            Console.WriteLine($"{p/2}");
        }
    }
}

Submission status: Runtime Error

Solution code:
[N,K]=list(map(int,input().split()))
V=list(map(int,input().split()))
have=[]
for n,k in enumerate(reversed(range(0,K+1))):
  tmp=[V[:ki]+V[-(k-ki):] for ki in range(k)
      ]+[V[:k],]
  tmp=[sorted(item) for item in tmp if sum(item)>0]
  #print(n,tmp)
  if n!=0:
    for num_remove in range(n):
      tmp2=[item[n:] for item in tmp 
            if all([g<0 for g in item[:n]])
           ]
      
      tmp.extend(tmp2)
      #print("tmp",tmp)
      #print("tmp2",tmp2)
      
  have.extend(tmp)
  #print(n,have[-1])

if have==[]:
  print(0)
else:
  print(max(list(map(sum,have))))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N , K = map(int,input().split())
D = list(map(int,input().split()))

maxValue = 0

for i in range(min(N,K)+1):
    for j in range(min(N,K)-i+1):
        left = D[:i]
        right = D[N-j:]
        merge = (left + right + [0]).sort()

        index = 0

        for k in range(K-i-j):
            if (merge[0] < 0):
                index += 1
            else:
                break

        val = sum(merge[index:])
        if(maxValue < val):
            maxValue = val

print(maxValue)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/python
# coding: UTF-8
 
n,m = map(int,input().split())
 
s = []
for i in range(m):
    s += [tuple(map(int,input().split())),]
 
p = list(map(int,input().split()))
 
ret = 0
all = [(str(bin(i)))[2:].zfill(n) for i in range(2 ** n)]
all = [[int(i) for i in case] for case in all]
for case in all:
    flag = 0
    for num,i in enumerate(s):
 
        sw = [0 for z in range(n)]
        for k in i[1:]:
            sw[k-1] = 1
 
        if (sum(i*j for i,j in zip(sw,case)) % 2) != p[num]:
            flag = 1
           
    if flag == 0:
        ret += 1
 
print(ret)

Submission status: Runtime Error

Solution code:
import numpy as np
import itertools as ittr

def test_switch(e_balls, sw, p):
    for i, e_ball in enumerate(e_balls):
        si = sw[e_ball - 1]
        
        if p[i] != (np.sum(si == 1) % 2):
            return False
    
    return True

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

e_balls = []

for m in range(M):
    i = input().split()
    s = [int(si) for si in i[1:]]
    e_balls.append(np.asarray(s))

p = [int(pi) for pi in input().split()]

cnt = 0

for sw in ittr.product([0, 1], repeat = N):
    if test_switch(e_balls, np.array(sw), p):
        cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
n = int(input())
a=[]
for i in range(n):
  x,y = input().split()
  a.append([x,-int(y),i+1])
a.sort()
for i in range(n):
  print(a[i][2])

Submission status: Runtime Error

Solution code:
n = int(input())
a=[]
for i in range(n):
  x,y = input().split()
  a.append([x,-int(y),i+1])
a.sort()
for i in range(n):
  print(a[i][2])

Submission status: Runtime Error

Solution code:
import itertools


N, M = map(int, input().split())
connected_switches = [[int(x) - 1 for x in input().split()[1:]] for x in range(M)]
conditions = list(map(int, input().split()))

ok = 0
for patterns in itertools.product((0, 1), repeat=N):
    patterns = list(patterns)
    is_lighting = True
    for i, lights in enumerate(connected_switches):
        turned_sw = sum([patterns[x] for x in lights])
        if turned_sw % 2 != conditions[i]:
            is_lighting = False
            break
    if is_lighting:
        ok += 1

print(ok)

Submission status: Runtime Error

Solution code:
N=int(input())
info=[input().split() for i in range(N)] #mojiretu
#print(info)
from operator import itemgetter
dic1={}
for i in range(len(info)):
    dic1[i+1]=info[i]
#print(dic1)
info1=sorted(info,key=lambda x:int(x[1]),reverse=True)
info2=sorted(info1,key=itemgetter(0))
#print(info2)
for i in info2:
    for key,value in dic1.items():
        if value==i:
            print(key)

Submission status: Runtime Error

Solution code:
n=int(input())
v=list(map(int, input().split()))
ans=0
for k in range(1,n):
	p,s=k,0
	while p<n:
		r=n-p-1
		if r<=k:
			break
		s+=v[p]+v[n-1-p]
		if r%k!=0 or p<r:
			ans=max(ans,s)
		p+=k
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
SP=[]
SPs=[]
for i in range(n):
    SP=[i]
    for j in input().split():
        
        SP.append(j)
    SPs.append(SP)

SPs=np.array(SPs)
SPs2=SPs[SPs[:,2].astype(int).argsort()[::-1],:]
SPs3=SPs2[SPs2[:,1].argsort(),:][:,0]

for i in range(n):
    print(int(SPs3[i])+1)

Submission status: Runtime Error

Solution code:
import collections


def main():
    from sys import stdin, stdout

    read = iter(stdin.read().splitlines()).next
    #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)

    N, Q = [int(x) for x in input().split()]
    updates1 = []
    updates2 = []
    for i in range(N):
        S, T, X = [int(x) for x in input().split()]
        updates1.append((S - X, X))
        updates2.append((T - X, X))

    active = []
    to_delete = collections.defaultdict(int)
    import heapq
    heapq.heapify(updates1)
    heapq.heapify(updates2)
    for _ in range(Q):
        x = int(input())
        while updates1 and updates1[0][0] <= x:
            coord, val = heapq.heappop(updates1)
            heapq.heappush(active, val)

        while updates2 and updates2[0][0] <= x:
            coord, val = heapq.heappop(updates2)
            to_delete[val] += 1

        while active and to_delete[active[0]] > 0:
            to_delete[active[0]] -= 1
            heapq.heappop(active)
        write(active[0] if active else -1)

main()

Submission status: Runtime Error

Solution code:
N, Q = map(int,input().split())
List_S = [list(map(int,input().split())) for i in range(N)]
List_D = [int(input()) for i in range(Q)]

List_S.sort(key=lambda x:x[2])

for i in range(Q):
    flag = 0
    for j in range(N):
        if (List_S[j][0]-0.5 < (List_D[i] + List_S[j][2])) and ((List_D[i] + List_S[j][2]) < List_S[j][1]-0.5):
            print("{}".format(List_S[j][2]))
            flag = 1
            break
    if flag == 0:
        print("-1")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
N, Q = [int(x) for x in input().split()]
STX = np.zeros((N, 3))
for i in range(N):
    STX[i, 0], STX[i, 1], STX[i, 2] = [int(x) for x in input().split()]
D = [int(input()) for _ in range(Q)]
STX = STX[np.argsort(STX[:, 2])]

for d in D:
    STX_copy = np.copy(STX)
    STX_copy[:, :2] = STX_copy[:, :2] - d
    try:
        print(int(STX_copy[np.where((STX_copy[:, 0] - 0.5 <= STX_copy[:, 2]) & (STX_copy[:, 1] - 0.5 >= STX_copy[:, 2]))][0, 2]))
    except:
        print(-1)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
 
 
def solve(N: int, Q: int, S: "List[int]", T: "List[int]", X: "List[int]", D: "List[int]"):
    def bsearch_l(val, D):
        l = -1
        r = Q - 1
        while r - l > 1:
            m = (l + r) // 2
            #print(val, l, r, m)
            if val > m:
                l = m
            else:
                r = m
        #print(val, l, r)
        return r
    def bsearch_r(val, D):
        l = 0
        r = Q
        while r - l > 1:
            m = (l + r) // 2
            #print(val, l, r, m)
            if val < D[m]:
                r = m
            else:
                l = m
        #print(val, l, r)
        return l
    a = []
    for i in range(N):
        a.append([X[i], max(0, -(X[i] - S[i]) - 1), max(0, -(X[i] - T[i]) - 1)])
    a.sort(key=lambda x: x[0])
    ret = [-1] * Q
    for tmp in a:
        l = bsearch_l(tmp[1], D)
        r = bsearch_r(tmp[2], D)
        #print(tmp)
        #print(l, r)
        for i in range(l, r + 1):
            if i >= 0 and i < Q and ret[i] < 0:
                ret[i] = tmp[0]
 
    for r in ret:
        print(r)
    return
 
 
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    S = [int()] * (N)  # type: "List[int]" 
    T = [int()] * (N)  # type: "List[int]" 
    X = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        S[i] = int(next(tokens))
        T[i] = int(next(tokens))
        X[i] = int(next(tokens))
    D = [ int(next(tokens)) for _ in range(Q) ]  # type: "List[int]"
    solve(N, Q, S, T, X, D)
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
print(a)

Submission status: Runtime Error

Solution code:
from collections import defaultdict

N = int(input())
S = [0] * N
P = [0] * N

city_point = {}

for i in range(N):
    inp = input().split()
    S[i] = inp[0]
    P[i] = inp[1]
    city_point[i] = {'city': S[i], 'point': int(P[i])}
    
sorted_list = sorted(city_point.items(), key=lambda x: (x[1]['city'], x[1]['point']))

for item in sorted_list:
    print(item[0] + 1)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
d = list(map(int, input().split()))
left = [0]
left_m = []
right = [0]
right_m = []
for i, l, r in zip(range(K), d, d[::-1]):
    left.append(left[i] + l)
    left_m.append(l if l < 0 else 0)
    right.append(right[i] + r)
    right_m.append(r if r < 0 else 0)
point = 0
for i in range(K):
    for j in range(K - i):
        p = K - i - j
        minus = list(sorted(left_m[:i] + right_m[:j]))
        point = max(point, left[i] + right[j] - sum(minus[:p]))
print(point)

Submission status: Runtime Error

Solution code:
N = int(input())
SList = []
PList = []
dic = {}
Slist = []
aa = []
for _ in range(N):
    S, P = input().split()
    dic[S] = int(P)
    Slist.append(S)
    aa.append((int(P), S))
dic = sorted(dic.items())

sortedS = list(sorted(set(Slist)))

for i in range(len(sortedS)):
    tempV = []
    tempI = []
    for j in range(N):
        if aa[j][1] == sortedS[i]:
            tempV.append(aa[j][0])
            tempI.append(j)
    indexList = np.argsort(tempV)
    for k in reversed(indexList):
        print(tempI[k] + 1)

Submission status: Runtime Error

Solution code:
import itertools

n, m = input().split()
N = int(n)
M = int(m)

K = []
for i in range(M):
    K.append(list(map(int, input().strip().split(' '))))

P = list(map(int, input().strip().split(' ')))

SW = {0, 1}
SWlist = list(itertools.product(SW, repeat=N))

result = 0
fflag = False

for i in range(len(SWlist)):
    for j in range(len(K)):
        count = 0
        for k in range(K[j][0]):
            if SWlist[i][k] == 1:
                count += 1
        if count % 2 != P[j]:
            fflag = True
            break
    if not fflag:
        result += 1
    else:
        fflag = False
print(result)

Submission status: Runtime Error

Solution code:
n,q = map(int, input().split())
STXlist = [list(map(int,input().split())) for _ in range(n)]
D = [(-1)*int(input()) for _ in range(q)]

time = 0
stop = 1
ans = [1j] * q
T = (sorted(STXlist, key=lambda x: x[1],reverse=True))  
Tmax = T[0][2]

while True:
    time += 1
    D = list(map(lambda x:x+1 , D))

    for STX in STXlist:
        if time >= STX[0] and time < STX[1]:
            if STX[2] in D:
                stop += 1
                ans[D.index(STX[2])] = D[D.index(STX[2])]
                D[D.index(STX[2])] = (1 + 1j)

    if stop == q:
        for i in ans:
            print(i)
        break
    
    if time > Tmax + 10:
        indexes = [i for i, x in enumerate(ans) if x == 1j]
        for i in indexes:
            ans[ans.index(1j)] = -1
        for i in ans:
            print(i)
        break

Submission status: Runtime Error

Solution code:
N = [int(i) for i in input().split()][0]

ls = []
for i in range(N):
  a,b = [i for i in input().split()]
  tmp = [str(a),int(b)]
  ls.append(tmp)

new_ls = sorted(ls, key=lambda x:x[1], reverse=True)
new_ls = sorted(new_ls, key=lambda x:x[0])

for next,l in enumerate(new_ls):
  for i,tmp in enumerate(ls):
    if l[0]==tmp[0] and l[1]==tmp[1]:
      print(i+1)
      continue

Submission status: Runtime Error

Solution code:
import numpy as np

N, M = map(int, input().split())
p = []
matrix = np.zeros((M, N))

for m in range(M):
    row = [int(v)-1 for v in input().split()]
    row = row[1:]
    for n in range(N):
        if n in row: matrix[m, n] = 1

p = [int(v) for v in input().split()]
p = np.array([p]).T
matrix = np.hstack([matrix, p])
rank = np.linalg.matrix_rank(matrix)

if N < rank:
    print(0)
elif not any(p):
    print(1)
else:
    print(2**(N-rank))

Submission status: Runtime Error

Solution code:
import numpy as np

N = [int(i) for i in input().split()][0]

ls = []
for i in range(N):
  a,b = [i for i in input().split()]
  tmp = [str(a),int(b)]
  ls.append(tmp)

new_ls = sorted(ls, key=lambda x:x[1], reverse=True)
new_ls = sorted(new_ls, key=lambda x:x[0])

for next,l in enumerate(new_ls):
  for i,tmp in enumerate(ls):
    if l[0]==tmp[0] and l[1]==tmp[1]:
      print(i+1)
      continue

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mx = 0
for i in range(min(n, k + 1)):
	for j in range(min(k - i + 1, n - i + 1)):
		summa = 0
		b = []
		for t in range(i):
			b.append(a[t])
		for t in range(n - j, n):
			b.append(a[t])
		z = k - i - j
		b.sort()
		for x in b:
			if x < 0 and z > 0:
				z -= 1
			else:
				summa += x
		mx = max(mx, summa)
print(mx)

Submission status: Runtime Error

Solution code:

N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i+1))
for i in range(N):
    A[i][1] = int(A[i][1]) 


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2]))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mx = 0
for i in range(min(n + 1, k + 1)):
	for j in range(min(k - i + 1, n - i + 1)):
		summa = 0
		b = []
		for t in range(i):
			b.append(a[t])
		for t in range(n - j, n):
			b.append(a[t])
		z = k - i - j
		b.sort()
		for x in b:
			if x < 0 and z > 0:
				z -= 1
			else:
				summa += x
		mx = max(mx, summa)
print(mx)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools

def is_lit(i, bit):
    l = [bit[j-1] for j in sockets[i]]
    return p[i] == l.count(True) % 2

count = 0
N, M = map(int, input().split())
bit_list = list(itertools.product([True, False], repeat = N))

sockets = []
for i in range(M):
    args = input().split(' ')
    k = int(args[0])
    sockets.append([int(args[i+1]) for i in range(k)])

p = [int(x) for x in input().split(' ')]

for bit in bit_list:
    o = [is_lit(i, bit) for i in range(M)]
    if o.count(True) == len(o):
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
import itertools


N, M = map(int, input().split())
connected_switches = [[int(x) - 1 for x in input().split()[1:]] for x in range(M)]
conditions = list(map(int, input().split()))

is_ok = 0
for patterns in itertools.product((0, 1), repeat=M):
    patterns = list(patterns)
    on_light = 0
    for i, light in enumerate(connected_switches):
        turned_sw = 0
        for switch_id in light:
            turned_sw += patterns[switch_id]
        if turned_sw % 2 == conditions[i] if i in conditions else -1:
            on_light += 1
    if on_light == M:
        is_ok += 1

print(is_ok)

Submission status: Runtime Error

Solution code:
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
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 II(): return int(sys.stdin.readline())
def SI(): return int(input())
from collections import defaultdict
import bisect

n, q = LI()
ds = []
stx = []
ans = [-1 for i in range(q)]
for i in range(n):
    s, t, x = LI()
    stx.append((s, t, x))
for i in range(q):
    d = SI()
    ds.append(d)
# stx = sorted(stx, key=lambda x: x[2])
for s, t, x in stx:
    sx = s - x
    tx = t - x
    i1 = bisect.bisect_left(ds, sx)
    i2 = bisect.bisect_left(ds, tx)
    for i in range(i1, i2):
        if ans[i] == -1 or ans[i] > x:
            ans[i] = x
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(N)]
a.sort(key=lambda x: x[2])
for i in range(N):
    a[i] = [a[i][0] - a[i][2], a[i][1] - a[i][2], a[i][2]]
d = [int(input()) for _ in range(Q)]
idx = 0
for p in d:
    flg = 1
    while not (a[idx][0] <= p < a[idx][1]):
        if idx + 1 >= N or a[idx][1] <= p < a[idx + 1][0]:
            flg = 0
            break
        idx += 1
    print(a[idx][2] if flg else -1)

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N, M = [int(x) for x in input().split()]

S =[]
for j in range (M):
    a = [x for x in input().split()]
    k = a[0]
    s = [int(x) for x in a[1:]]
    S.append(s)
P = [int(x) for x in input().split()]
ans = 0
for i in range (2**N):
    n = format(i,'b').zfill(N)
    
    count = 0
    for j in range (M):
        count2 = 0
        for k in range (len(S[j])):
            count2 += int(n[S[j][k]-1])
        if count2 %2 == P[j]:
            count += 1
    if count == M:
        ans += 1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def pi(a,p):
  c=0
  pi=0
  while c>2:
    c=a*3+p
    pi=c//2
    
   return pi

Submission status: Runtime Error

Solution code:
N = int(input())
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))

B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2])+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ball=int(input("A=:"))
hahen=int(input("P=:"))
if 0<=A<=100 0<=F<=100:
  hahenall=ball*3+hahen
  applepie=hahenall//2
  print(applepie)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2])+1)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2]+1)

Submission status: Runtime Error

Solution code:
ball=int(input("A=:"))
hahen=int(input("P=:"))
hahenall=ball*3+hahen
applepie=hahenall//2
print(applepie)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2])+1

Submission status: Runtime Error

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

a *= 3

print((a+b)//2)

Submission status: Runtime Error

Solution code:
import pandas as pd

N=int(input())

datalist=[]
for i in range(N):
    a=input().split()
    datalist.append([i+1]+a)

df=pd.DataFrame(datalist)
df.columns=["num","name","point"]
df.sort_values(by="point",inplace=True,ascending=False)
df.sort_values(by="name",inplace=True)
df.reset_index(inplace=True)
for i in range(N):
    print df.num[i]

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


values = [i for i in range(N)]

dic = dict(zip(A, values))

B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(C[i][2])

Submission status: Runtime Error

Solution code:

N = int(input())
S=[0]*N
P=[0]*N 
for i in range(N):
    S[i], P[i] = input().split()
    P[i] = int(P[i])

S_mid = sorted(S, key=lambda idx: P[idx] )
fin = sorted(range(N), key=lambda idx: S_mid[idx])
for i in fin:
    print (i)

Submission status: Runtime Error

Solution code:
ball=int(input("A=:"))
hahen=int(input("P=:"))
hahenall=ball*3+hahen
applepie=hahenall/2
print(applepie)

Submission status: Runtime Error

Solution code:
ball=input(int(A))
hahen=input(int(F))
hahenall=ball*3+hahen
applepie=hahenall/2
print(applepie)

Submission status: Runtime Error

Solution code:

N = int(input())

SP = []
for i in range(N):
    hoge = list(input().split())
    SP.append([hoge[0], int(hoge[1]), i+1])
SP = sorted(SP, key=lambda x:-x[1])
SP = sorted(SP, key=lambda x:x[0])

for i in SP:
    print(i[2])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input()
P = input()
ans = int((int(A) * 3  + int(P))/2)


print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
apple = input()
kakera = input()
ans = int((int(apple) * 3  + int(kakera))/2)


print(ans)

Submission status: Runtime Error

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

apple_cut = A * 3

apple_pie = (apple_cut + P) /2
                 
print(int(apple_pie))

Submission status: Runtime Error

Solution code:
import collections
def sortFirst(val):
    return val[0]
N=raw_input("")
N=int(N)
l={}
for i in range(1,N+1):
    S,P = raw_input("").split(' ')
    if S in l.keys():
        l[S].append([int(P),i])

    else:
        l[S]=[[int(P),i]]


for key in l.keys():
    l[key].sort(key=sortFirst,reverse=True)
for key in sorted(l):
    for val in l[key]:
        print "%d"%(val[1])

Submission status: Runtime Error

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

apple_cut = A * 3

apple_pie = (apple_cut + P) /2
                 
print(int(apple_pie))

Submission status: Runtime Error

Solution code:
import sys
ap = int(sys.argv[1])
bknd = ap * 3
albk = int(sys.argv[2])
albknd = albk + bknd

pis = albknd / 2

return pis

Submission status: Runtime Error

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

apple_cut = A * 3

apple_pie = (apple_cut + P) /2
                 
print(apple_pie)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
ap = int(sys.argv[1])
bknd = ap * 3
albk = int(sys.argv[2])
albknd = albk + bknd

pis = albknd / 2

print(pis)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, P = raw_input().split()
P += A*3
pi = int(P/3)
print (pi)

Submission status: Runtime Error

Solution code:
N = int(input())
A = []
for i in range(N):
    A[i] = list(map(int,input().split()))

print(A)

Submission status: Runtime Error

Solution code:
apple,apple_piece = map(int(input(),split())

apple_cut = apple * 3

apple_pie = (apple_cut + apple_piece) /2
                 
print(apple_pie)

Submission status: Runtime Error

Solution code:
A, P = input()
P += A*3
pi = int(P/3)
print (pi)

Submission status: Runtime Error

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

N = (A*3+P%2)//2+P//2

print(N)

Submission status: Runtime Error

Solution code:
w = input()
s = w.split()

apple = int(s[0])
piece = int(s[1])


answer = ( 3 * apple + piece - (( 3 * apple + piece ) % 2 ) /2

print(answer)

Submission status: Runtime Error

Solution code:
# 行数
N = int(input().strip())

# 2次元配列
grid = []
for i in range(N):
    array = list(input().strip().split())
    grid.append(array)
    grid[i][1]=int(grid[i][1])
print(grid)
agrid=sorted(grid)
for i in range(N-1):
  if agrid[i][0]==agrid[i+1][0] and agrid[i][1]<agrid[i+1][1]:
    b=agrid[i+1]
    c=agrid[i]
    agrid[i]=b
    agrid[i+1]=c
for i in range(N):
  print(agrid[i][1])

Submission status: Runtime Error

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

N = (A*3+P%2)//2+P//2

print(N)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
bknd = sys.argv[0] * 3
albknd = sys.argv[1] + bknd

pis = albknd / 2

print(pis)

Submission status: Runtime Error

Solution code:
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()

Submission status: Runtime Error

Solution code:
a, p = [*map(int, input().split())]
print('{}'.format((a * 3 + p) // 2))

Submission status: Runtime Error

Solution code:
import sys
from functools import reduce
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

N = (A*3+P%2)//2+P//2

print(N)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def pie(A, P):
    P_cra = A*3
 
    P_all = P_cra + P
 
    pie = P_all//2
 
    print(pie)

A = input()
P = input()
pie(int(A), int(P))

Submission status: Runtime Error

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

print(math.floor((3A+P)/2))

Submission status: Runtime Error

Solution code:
a,b=input(),input()
aa=int(a)
bb=int(b)

c=int((3*aa+bb)/2)
print(c)

Submission status: Runtime Error

Solution code:
a = input().split(' ')
a[0] = a[0]*3
b = (a[0]+a[1])/2
print(b)