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:
    import math
    apple_one, apple_kakera = (int(i) for i in input().split())  
    apple_kakera += apple_one * 3
    print(math.floor(apple_kakera / 2) )

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

a = []

for i in range(n):
  	# input as str
	s, p = input().split()
    # p -> integer
	p = int(score)
    # create list
	a.append((s, p, i+1))

# sort
a.sort(key=lambda x:x[1], reverse=True)

# sort
a.sort(key=lambda x:x[0])

# output
for i in range(n):
	print(a[i][2])

Submission status: Runtime Error

Solution code:
li = list(int(input()))
print(int((li[0]*3+li[1])/2))

Submission status: Runtime Error

Solution code:
### ABC128
a=int(input())
p=int(input())
p += a*3;

print(p//2)

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
print("{}".format((3A+b)/2))

Submission status: Runtime Error

Solution code:
printf((3A + P)/2)

Submission status: Runtime Error

Solution code:
import math
a = input.slice("")[0]
p = input.slice("")[1]

print(math.floor((3a+p)/2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from pulp import

m = LpProblem(sense=LpMaximize)
A = LpVariable('A', lowBound=0, highBound=100)
P = LpVariable('P', lowBound=0, highBound=100)

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

m.solve
print(m)

Submission status: Runtime Error

Solution code:
import numpy as np
N=int(input())
a=[]
for i in range(N):
    s,p=input().split()
    p=int(p)
    a.append([s,p,i+1])
a.sort(key=lambda x:(x[0],x[1]))
i=0
while i<=N:
    last=a[i][0]
    i+=1
    if i<N and last==a[i][0]:
        s=i-1
        g=i
        while 1:
            if i>=N or last!=a[i][0]:
                g=i
                break
            i+=1
        for j in reversed(range(s,g)):
            print(a[j][2])
        if i==N-1:
            break
    else:
        print(a[i-1][2])

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())

list_a = []
list_b = []
list_dist = []

for i in range(N):
  list_a.append(list(map(int, input().split())))

for j in range(Q):
  list_b.append(int(input()))

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


for b in list_b:
  dist = 0
  time = b
  stop_flag = 0
  for a in list_a:
    time = time + a[2] - dist
    dist = a[2]
    if time > a[0]-0.5 and time < a[1]-0.5:
      stop_flag = 1
      break
  if stop_flag == 0:
    list_dist.append(-1)
  else:
    list_dist.append(dist)

for dist in list_dist:
  print(dist)

Submission status: Runtime Error

Solution code:
from numpy import*
n,m=map(int,input().split())
l=[]
for i in range(m):
    *a,=map(int,input().split())
    l.append(a[1:])
*p,=map(int,input().split())

ans=0
for t in range(2**n):
    tmp=array([t>>s&1 for s in range(n)])
    if p==[sum(tmp[array(i)-1])%2for i in l]:
        ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
n = input()
print(int((int(n[0]) * 3 + int(n[2])) / 2))

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
n_switch = []
switch = []
for i in range(M):
	s = list(map(int, input().split()))
	n_switch.append(s[0])
	switch.append(s[1:])
p = list(map(int, input().split()))
ans = 0
for i in range(2 ** N):
	x = 1
	b = bin(i)[2:].rjust(N, '0')
	for j in range(M):
		n_light = 0
		for k in range(n_switch[j]):
			if b[switch[j][k] - 1] == '1':
				n_light += 1
		if n_light % 2 != p[j]:
			x *= 0
			break
	if x == 1:
		ans += 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
_args = sys.argv
_A = _args[1]
_P = _args[2]

if _A > 0 :
    _P=_P+_A*3

_ANS =math.floor(_P/2)

print(_ANS)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Jun  5 09:53:48 2019

@author: Enya
"""

input_code = input()

A = int(input_code[0])*3 + int(input_code[2])
N = 0

if A>3:
    N = A//3

else:
    N = 0
    
print(N)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Jun  5 09:53:48 2019

@author: Enya
"""

input_code = input()

A = input_code[0]*3 + input_code[1]
N = 0

if A>3:
    N = A//3

else:
    N = 0
    
print(N)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Jun  5 09:53:48 2019

@author: Enya
"""

input_code = input()

A = input_code[0]*3 + input_code[1]
N = 0

if A>3:
    N = A//3
    
    print(N)

else:
    print(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
A=int(input())
P=int(input())
if A%2==0:
  A=A*3/2
  print(A+P)
else:
  A=(A*3+P)/2
  print(A)

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 = input().split()
int(a)
int(p)
print((a*3+p)//2)

Submission status: Runtime Error

Solution code:
N, M = [int(i) for i in input().split()]
switch_idx = [[int(i) for i in input().split()[1:]] for M in range(M)]
p = [int(i) for i in input().split()]

import numpy as np
n_pattern = 2**N
form = '0{0}b'.format(N)
ans = 0
from operator import itemgetter
for i in range(n_pattern):
    state = str(format(i, form))
    counter = 0
    for j,k in enumerate(switch_idx):
        if (itemgetter(*(np.array(k)-1))(state).count('1') % 2) == p[j]:
            counter += 1
        if len(switch_idx) == counter:
            ans += 1

print(ans)

Submission status: Runtime Error

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

pi = round((int(A) * 3 + int(P))  / 2)

print(pi)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

pi = round((A*3 + P)/2)

print(pi)

Submission status: Runtime Error

Solution code:

pi = round((A*3 + P)/2)




return pi

Submission status: Runtime Error

Solution code:

pi = (A*3 + P)/2

return pi

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys

for l in sys.stdin:
  a, p = l.rstrip('\n').split(' ')
pies = (int(a) * 3 + p) //2
print(pies)

Submission status: Runtime Error

Solution code:
import sys

for l in sys.stdin:
  a, p = l.rstrip('\n').split(' ')
pies = (3*a+p)//2
print(pies)

Submission status: Runtime Error

Solution code:
n= int(input())
s = [[input().split()]for i in range(n)]
s1 = sorted(s)
for i in range(n):
    print(s.index(s1[i]))

Submission status: Runtime Error

Solution code:
A,P=input()
a=int(A)
p=int(P)
m=a*3+p
t=m%2
if t=0:
  print(m/2)
else:
  print((m-1)/2)

Submission status: Runtime Error

Solution code:
A = int(input())
P = int(input())
B = 3*A + P

print(int(B // 2))

Submission status: Runtime Error

Solution code:
A = int(input())
P = int(input())
B = 3*A + P

print(int(B/2))

Submission status: Runtime Error

Solution code:
A = int(input())
P = int(input())
B = 3*A + P

print(int(B/3))

Submission status: Runtime Error

Solution code:
pie=int("3*A+P")
if pie//2:
 (3*A+P)/2
else :
 (3*A+P-1)/2

Submission status: Runtime Error

Solution code:
n, a, b, c, d = map(int,input().split())
s = input()

if c<d:
    s = list(s)
    h = s[b:d]
    for i in range(1,len(h)):
        if "##" in h:
            print("No")
            break
    else:
        hh = s[a:c]
        for i in range(1,len(hh)):
            if "##" in hh:
                print("No")
                break
        else:
            print("Yes")
else:
    if "..." in s[a:d]:
        h = s[a:c]
        for i in range(1,len(h)):
            if h[i]==h[i-1] and h[i]=="#":
                print("No")
                break
        else:
            hh = s[b:d]
            for i in range(1,len(hh)):
                if hh[i]==hh[i-1] and hh[i]=="#":
                    print("No")
                    break
            else:
                print("Yes")
    else:
        s = list(s)
        h = s[b:d]
        for i in range(1,len(h)):
            if h[i]==h[i-1] and h[i]=="#":
                print("No")
                break
        else:
            print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A=int(input())
P=int(input())
if A>0:
  a=A*3+P
else:
  a=P
print(a/2)

Submission status: Runtime Error

Solution code:

apple = A
part = P
all_part = A*3 + P

pie = all_part / 2

print(pie)

Submission status: Runtime Error

Solution code:
apple = int(input('りんごの個数') * 3)
piece = int(input('りんごの破片の数'))

apple_pie = (apple + piece) // 2
print(apple_pie)

Submission status: Runtime Error

Solution code:
#りんごの数
A = int(input())
#かけらの数
P = int(input())
#合計のかけらの数
sum_p = A*3 + P
print(sum_p // 2)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
print(180*(n-2))

Submission status: Runtime Error

Solution code:
import sys
a = sys.argv[1]
p = sys.argv[2]
a1 = a*3
print ((a1+p)/2)

Submission status: Runtime Error

Solution code:
import sys

a, p = map(int, sys.stdin.readlines()[0].strip)
print((p + a * 3) // 2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())
    restaurants = []
    for i in range(N):
        si, pi = input().split()
        restaurants.append([i+1, si, int(pi)])
    cities = sorted(set([restaurant[1] for restaurant in restaurants]))

    for city in cities:
        same_cities = []
        for restaurant in restaurants:
            if restaurant[1] == city:
                same_cities.append(restaurant)
        sorted_restaurants = sorted(same_cities, key=lambda restaurant: restaurant[2], reverse=True)
        [print(restaurant[0]) for restaurant in sorted_restaurants]


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())↲
d=0
c=a*3
if c>=1:
  d=(c+b)//2
elif c==0 and b>1:
  d=b//2
print(d)↲

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())↲
d=0
c=a*3
if c>1:
    d=(c+b)//2
elif c==0 and b>1:
    d=b//2
print(d)↲

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
for i in range(n):
    s, p = input().split()
    a.append((s, -int(p), i))
a.sort()

for _, _, i in a:
    print(i + 1)

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
for i in range(n):
    s, p = input().split()
    p = int(p)
    a.append((s, -int(p), i))
a.sort()

for _, _, i in a:
    print(i + 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())↲
c=(a*3+p)//2
print(int(c))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,P=map(int,input().split())↲
N=0↲
a=A*3↲
if a>1:
  N=(a+P)//2
elif a==0 and P>1:
  N=P//2
print(N)

Submission status: Runtime Error

Solution code:
A,P=map(int,input().split())↲
d=0
c=A*3
if c>1:
  d=(c+P)//2
elif c==0 and P>1:
  d=P//2
print(d)↲

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())↲
d=0
c=a*3
if c>1:
  d=(c+b)//2
elif c==0 and b>1:
  d=b//2
print(d)↲

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())↲
d=0
c=a*3
if c>1:
  d=(c+b)//2
print(d)↲

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())↲
d=0
c=a*3
if b>1:
  d=(c+b)//2
print(d)↲

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(d)↲

Submission status: Runtime Error

Solution code:
import math

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

apple = 3 * a + p

ans = (math.floor(apple / 2))

print(ans)

Submission status: Runtime Error

Solution code:
import("math")

print("test")

Submission status: Runtime Error

Solution code:
import pandas as pd
N=int(input())
df=pd.DataFrame(N)

print(df)

Submission status: Runtime Error

Solution code:
N=int(input())
print("test")

Submission status: Runtime Error

Solution code:
N=int(input())
print(N)

Submission status: Runtime Error

Solution code:
n=input()
string_list=[input() for i in range(n)]

print("test")

Submission status: Runtime Error

Solution code:
n=int(input())
string_list=[input() for i in range(n)]

pirnt("test")

Submission status: Runtime Error

Solution code:
#import pandas as pd

"N=int(input())
print("Test")

Submission status: Runtime Error

Solution code:

N=int(input())
print("test")

Submission status: Runtime Error

Solution code:
#import pandas as pd

N=int(input())
print(N)

Submission status: Runtime Error

Solution code:
import pandas as pd

print("test")

Submission status: Runtime Error

Solution code:
import pandas as pd

N=int(input())

datalist=["test"]
print(datalist)

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int main(void){
  int a;
  int p;
  
  scanf("%d",a); scanf("%d",a);
  print("%d", (a*3+p)/2);

  return 0;
}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

P = input()
P =int(P)

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

Submission status: Runtime Error

Solution code:
N = int(input())
rest = {}
cities = []
for i in range(N):
    k,s = input().split()
    if k not in rest:
        rest[k] = []
        cities.append(k)
    rest[k].append([int(s),i+1])
cities.sort()
for k in cities:
    rest[k].sort(reverse = True)
    for i in rest[k]:
        print(i[1])

Submission status: Runtime Error

Solution code:
N = int(input())
rest = {}
cities = []
for i in range(N):
    k,s = input().split()
    if k not in rest:
        rest[k] = []
        cities.append(k)
    rest[k].append([int(s),i+1])
print(sorted(rest))
cities.sort()
for k in cities:
    rest[k].sort(reverse = True)
    for i in rest[k]:
        print(i[1])

Submission status: Runtime Error

Solution code:
N = int(input())
rest = {}
cities = []
for i in range(N):
    k,s = input().split()
    if k not in rest:
        rest[k] = []
        cities.append(k)
    rest[k].append([int(s),i+1])
print(sorted(rest))
cities = cities.sort()
for k in cities:
    rest[k].sort(reverse = True)
    for i in rest[k]:
        print(i[1])

Submission status: Runtime Error

Solution code:
from operator import itemgetter

if __name__ == '__main__':
    n = int(input())
    input_list = [input() for i in range(n)]
    restaurant_list = []
    for index, _input in enumerate(input_list):
        _restaurant_data = {'id': index + 1, 'region': _input.split()[0], 'point': int(_input.split()[1])}
        restaurant_list.append(_restaurant_data)

    restaurant_list.sort(key=itemgetter('point'), reverse=True)
    restaurant_list.sort(key=itemgetter('region'))
    for restaurant in restaurant_list:
        print(restaurant['id'])

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:
a = input()
b = input()
print(int((a*3 + b)/2))

Submission status: Runtime Error

Solution code:
import sys
from operator import itemgetter
inputs = sys.stdin.readline
N, Q= map(int,inputs().split())
def main():
	E = [None]*2*N
	for n in range(N):
		a,b,c = map(int,inputs().split())
		E[2*n] = (a - c, 1, c)
		E[2*n + 1] = (b - c, -1, c)
	E.sort(key=itemgetter(0))
	tuple(tuple(E))
	mini = 1000000001
	kouho = {1000000001}
	my_add = kouho.add
	my_discard = kouho.discard
	q = 0
	d = int(inputs())
	flag = False
	cont = False
	for e in E:
		while(e[0] > d):
			if cont == True:
				if mini < 1000000001:
					print(mini)
				else:
					print(-1)
			else:
				mini = min(kouho)
				if mini < 1000000001:
					print(mini)
				else:
					print(-1)
			cont = True
			if q < Q-1:
				q = q + 1
				d = int(inputs())
			else:
				flag = True
				q = q + 1
				break
		if flag == True:
			break
		if e[1] == 1:
			my_add(e[2])
			if mini > e[2]:
				mini = e[2]
		elif e[1] == -1:
			my_discard(e[2])
			cont = False
	for t in [None]*(Q-q):
		print(-1)
		
def sub():
	V = [list(map(int,inputs().split())) for p in [0]*N]
	M = [int(inputs()) for p in [0]*Q]
	V.sort(key = lambda x:(x[2],x[0],x[1]))
	for v in V:
		v[0] -= v[2]
		v[1] -= v[2] + 1
	for m in M:
		for n in range(N):
			if V[n][0] <=m and m <= V[n][1]:
				print(V[n][2])
				break
		else:
			print(-1)


if N>200000:
	sub()
else:
	main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input("店舗数"))

list = []
for i in range(N):
    s, p = input().split()
    P = 100 - int(p)
    list.append((s,P,i+1))

list.sort()

for a in list:
    print(a[2])

Submission status: Runtime Error

Solution code:
#coding:utf-8
d=[int(i) for i in input().split()]
print(int(answer=(d[0]*3+d[1])/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=input()
N=int(N)
S=[100]*N
P=[100]*N
for num in range(N):
    S[num]=input().split()
    S[num].append(num+1)
    S[num][1]=int(S[num][1])

S.sort()
flag=0
flag2=0
while(flag==0):
    flag2=0
    for num in range(0,N-1):
        if(S[num][0]==S[num+1][0]):
            if(S[num][1]<S[num+1][1]):
                S[num],S[num+1]=S[num+1],S[num]
                flag2=1
    if(flag2==0):
        flag=1
    
            

for num in range(N):
    print(S[num][2])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
V = list(map(int,input().split()))
ans = 0
R = min(N,K)
for A in range(R+1):
    for B in range(R-A+1):
        s = V[:A]+V[N-B:]
        #print(s)
        s.sort()
        S = sum(s)
        for k in range(min(K-A-B,len(s))):
            if s[k] < 0:
                S -= s[k]
        ans = max(ans,S)
print(ans)

Submission status: Runtime Error

Solution code:
import sys
inputs = sys.stdin.readline
N, Q= map(int,inputs().split())
V = [None]*N
E = []
for n in range(N):
	V[n] = list(map(int,inputs().split()))
	V[n][0] -= V[n][2]
	V[n][1] -= V[n][2]
	E.append([V[n][0],1,V[n][2]])
	E.append([V[n][1],-1,V[n][2]])
D = [int(inputs()) for p in [0]*Q]
E.sort(key = lambda x:x[0])
mini = 1000000001
kouho = [1000000001]
q = 0
d = D[0]
for e in E:
	flag = 0
	if e[0] <= d:
		if  e[1] == 1:
			kouho.append(e[2])
		elif e[1] == -1:
			kouho.remove(e[2])
	if e[0] > d:
		for k in kouho:
			mini = min(k,mini)
		if mini < 1000000001:
			print(mini)
			mini = 1000000001
		else:
			print(-1)
			mini = 1000000001
		flag = 1
		if q < Q-1:
			q = q + 1
			d = D[q]
		else:
			break
	if e[0] <= d and flag == 1:
		if  e[1] == 1:
			kouho.append(e[2])
		elif e[1] == -1:
			kouho.remove(e[2])
for t in [None]*(Q-q):
	print(-1)

Submission status: Runtime Error

Solution code:
from operator import itemgetter

def input_list(num,args):
    for i in range(num):
        S,P = input().split()
        P=int(P)
        if 1<=len(S)<=10 and S.islower()==1 and S.isalpha()==1 \
           and 0<=P<=100 and isinstance(P,int)==1:
            args.append([S,P])
        else :
            print("ERROR")
            exit()

def sort_list(*args):
    tmp=sorted(args,key=itemgetter(1),reverse=1)
    dict_sorted=sorted(tmp,key=itemgetter(0))

    return dict_sorted


def check_list(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    if len(seq) != len(unique_list):
        print("ERORR")
        exit()
    # else :                                                                                         
    #     print("restaurant is ok.") 
   
  
def main():
    # restaurant=[['N1',88],['N2',85],['N3',92],['N7',21],['N4',34],['N8',45],['N2',24],['N2',35]]   
    # num=8                                                                                          

    num=int(input())
    if 1<=num<=100:
        # [[] for i in range(5)]                                                                     
        restaurant=[]
        input_list(num,restaurant)

        check_list(restaurant)

        # print(restaurant)                                                                          
        restaurant_sorted=sort_list(*restaurant)

        for i in range(num):
            for j in range(num):
                if restaurant_sorted[i][1]==restaurant[j][1]:
                    print(j+1)
    else :
        print("ERORR")
        exit()

if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())#りんご
p=int(input())#りんご欠片
c=a*3
b=(c+p)//2
print(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = round(ans)

print(ans)

Submission status: Runtime Error

Solution code:
ans = 0


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

ans = round(ans)

print(ans)

Submission status: Runtime Error

Solution code:
A = 0
P = 0
ans = 0

A = input("りんごの個数を入力してください。")
P = input("りんごの破片の個数を入力してください。")

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

ans = round(ans)

print(ans)

Submission status: Runtime Error

Solution code:
import sys
inputs = sys.stdin.readline
N, Q= map(int,inputs().split())
V = [list(map(int,inputs().split())) for p in [0]*N]

for q in [0]*Q:
	m = int(inputs())
	for n in range(N):
		if V[n][0] - V[n][2] <=m and m <= V[n][1] - V[n][2] -1:
			print(V[n][2])
			break
	else:
		print(-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from bisect import bisect, bisect_left
from collections import Counter
from functools import reduce
from itertools import accumulate
from operator import itemgetter, xor

import sys
input = sys.stdin.readline

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

class BIT:
    def __init__(self, N):
        # Nは入れたい要素の個数
        self.N = N
        self.tree = [0]*(self.N + 1)
        self.n = 1
        while self.n <= N:
            self.n *= 2
        self.n //= 2

    def sum(self, i):
        res = 0
        while i:
            res += self.tree[i]
            i -= (i & -(i))
        return res

    def add(self, i, x):
        if i == 0:
            return
        while i <= self.N:
            self.tree[i] += x
            i += (i & -(i))

    def lower_bound(self, val):
        if val <= 0:
            return 0
        res = 0
        k = self.n
        while k:
            if res + k <= self.N and self.tree[res + k] < val:
                val -= self.tree[res + k]
                res += k
            k //= 2
        return res + 1
            
class OfflineSortedSet:
	
    def __init__(self, all_vals):
        self.keys = sorted(set(all_vals))
        self.max_key = max(self.keys)
        self.key_to_index = {k:i for i, k in enumerate(self.keys, start=1)}
        self.keys_num = len(self.keys)

        self.bit = BIT(self.keys_num)
        self.hash_set = set()

        self.add_bit = self.bit.add
        self.sum_bit = self.bit.sum
        self.lower_bound_bit = self.bit.lower_bound
        self.add_hash_set = self.hash_set.add
        self.remove_hash_set = self.hash_set.remove

    def exists(self, val):
        return val in self.hash_set

    def add(self, val):
        if val in self.hash_set:
            return
        
        self.add_hash_set(val)
        self.add_bit(self.key_to_index[val], 1)

    def remove(self, val):
        if val not in self.hash_set:
            return

        self.remove_hash_set(val)
        self.add_bit(self.key_to_index[val], -1)

    def lower_bound(self, val):
        idx = bisect_left(self.keys, val)
        tar = self.sum_bit(idx)
        res = self.lower_bound_bit(tar + 1) - 1
        if res < 0 or res >= self.keys_num:
            res = self.keys_num
        return res

def main():
    N, Q = inpl()
    hoge = [inpl() for _ in range(N)]
    X = [0]*N

    v = [0]*(2*N)
    for i in range(N):
        s, t, X[i] = hoge[i]
        v[2*i] = (s - X[i], 1, X[i])
        v[2*i+1] = (t - X[i], -1, X[i])
    v = sorted(v)

    se = OfflineSortedSet(X)
    del X

    idx = 0
    D = [int(input()) for _ in range(Q)]
    ans = [0]*Q
    for i, d in enumerate(D):
        while idx < len(v):
            t, com, x = v[idx]
            if t > d:
                break
            if com == 1:
                se.add(x)
            else:
                se.remove(x)
            idx += 1
        ans[i] = -1 if len(se.hash_set) == 0 else se.keys[se.lower_bound(-10000000000)]
    print(*ans, sep="\n")
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

n,q=map(int,input().split())
event=[]
stopped=set([-1])

def doevent(l):
    global stopped
    if l[1]==1:
        if stopped=={-1}:
            stopped=set()
        stopped.add(l[2])
    elif l[1]==-1:
        if l[2] in stopped:
            stopped.remove(l[2])
        if len(stopped)==0:
            stopped={-1}
            
for i in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x,1,x))
    event.append((t-x,-1,x))
event.append((-float("inf"),"x","x"))
event.append((float("inf"),"x","x"))
event.sort(key=lambda x:x[0])
eventtime=[i[0]for i in event]
#print(eventtime)
query=[bisect_right(eventtime,int(input()))-1 for i in range(q)]+[float("inf")]
#print(query)
c=0
#print(event)
for i in range(2*n+1):
    doevent(event[i])
    while i==query[c]:
        print(min(stopped))
        c+=1

Submission status: Runtime Error

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

n,q=map(int,input().split())
event=[]
stopped={-1}

def doevent(l):
    global stopped
    if l[1]==1:
        if stopped=={-1}:
            stopped=set()
        stopped.add(l[2])
    elif l[1]==-1:
        stopped.remove(l[2])
        if len(stopped)==0:
            stopped={-1}
            
for i in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x,1,x))
    event.append((t-x,-1,x))
event.append((-float("inf"),"x","x"))
event.append((float("inf"),"x","x"))
event.sort(key=lambda x:x[0])
eventtime=[i[0]for i in event]
#print(eventtime)
query=[bisect_right(eventtime,int(input()))-1 for i in range(q)]
#print(query)
c=0
#print(event)
for i in range(2*n):
    doevent(event[i])
    while i==query[c]:
        print(min(stopped))
        c+=1
        if c==q:
            break
for i in range(query.count(2*n)):
    print(-1)

Submission status: Runtime Error

Solution code:
import numpy as np

n_consts, n_agents = map(int, input().split())
const_plans = []
dep_times = []
results = [-1 for _ in range(n_agents)]

for _ in range(n_consts):
    const_plans.append([int(e) for e in input().split()])

const_plans = np.array(const_plans)
order_by_x = np.argsort(const_plans.T)[-1]
const_plans = const_plans[order_by_x]

for _ in range(n_agents):
    dep_times.append(int(input()))

for n_agent, dep_time in enumerate(dep_times):
    for const_plan in const_plans:
        x = const_plan[2]
        x1 = max(0, const_plan[0] - dep_time)
        x2 = max(0, const_plan[1] - dep_time)
        if x1 <= x < x2:
            results[n_agent] = x

for result in results:
    print(result)

Submission status: Runtime Error

Solution code:
a, p=map(int, input().split())
b=(a/3)+p
if b%2==0:
    print(b/2¥n)
else:
    print((b-1)/2¥n)

Submission status: Runtime Error

Solution code:
a, p=map(int, input().split())
b=(a/3)+p
if b%2==0:
    print(b/2¥n)
if else:
    print((b-1)/2¥n)

Submission status: Runtime Error

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