Problem:


Score : 600 points

Problem Statement

A tetromino is a figure formed by joining four squares edge to edge.
We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively:

Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S and a_Z, respectively.
Snuke will join K of his tetrominos to form a rectangle that is two squares tall and 2K squares wide.
Here, the following rules must be followed:

When placing each tetromino, rotation is allowed, but reflection is not.

Each square in the rectangle must be covered by exactly one tetromino.

No part of each tetromino may be outside the rectangle.

Snuke wants to form as large a rectangle as possible.
Find the maximum possible value of K.

Constraints

0≤a_I,a_O,a_T,a_J,a_L,a_S,a_Z≤10^9

a_I+a_O+a_T+a_J+a_L+a_S+a_Z≥1

Input

The input is given from Standard Input in the following format:

a_I a_O a_T a_J a_L a_S a_Z

Output

Print the maximum possible value of K. If no rectangle can be formed, print 0.

Sample Input 1

2 1 1 0 0 0 0

Sample Output 1

3

One possible way to form the largest rectangle is shown in the following figure:

Sample Input 2

0 0 10 0 0 0 0

Sample Output 2

0

No rectangle can be formed.



Sample input:
2 1 1 0 0 0 0


Sample output:
3

Submission status: Wrong Answer

Solution code:
from fractions import gcd
# from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


def main():
    i, o, t, j, l, s, z = map(int, input().split())
    ans = o
    ans + (i // 2) * 2 + (j // 2) * 2 + (l // 2) * 2
    ans += 3*min(i % 2, min(j % 2, l % 2))

      

    ans2 = o
    mi = min(i, min(l, j))
    ans2 += mi * 3
    ans2 += (i // 2) * 2 + (j // 2) * 2 + (l // 2) * 2
    ans2 += ((i - mi) // 2) * 2 + ((j - mi) // 2) * 2 + ((l - mi) // 2) * 2

    ans = max(ans, ans2)

    # ans3 = o
    # ans3 += (i // 2) * 2
    
    
    # left = 0
    # right = min(i, min(l, j))
    # for i in range(100):
    #     mi = (left + right) // 2
    #     tans = 3*m
    #     tans += ((i - mi) // 2) * 2 + ((j - mi) // 2) * 2 + ((l - mi) // 2) * 2

    #     if ans > tans 

    print(ans)



    


    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from fractions import gcd
# from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


def main():
    i, o, t, j, l, s, z = map(int, input().split())
    ans = o
    ans + (i // 2) * 2 + (j // 2) * 2 + (l // 2) * 2
    ans += min(i % 2, min(j % 2, l % 2))

      

    ans2 = o
    mi = min(i, min(l, j))
    if mi > 0:
        mi = 1
    else:
        print(ans)
        exit()
    ans2 += mi * 3
    ans2 += (i // 2) * 2 + (j // 2) * 2 + (l // 2) * 2
    ans2 += ((i - mi) // 2) * 2 + ((j - mi) // 2) * 2 + ((l - mi) // 2) * 2

    ans = max(ans, ans2)

    # ans3 = o
    # ans3 += (i // 2) * 2
    
    
    # left = 0
    # right = min(i, min(l, j))
    # for i in range(100):
    #     mi = (left + right) // 2
    #     tans = 3*m
    #     tans += ((i - mi) // 2) * 2 + ((j - mi) // 2) * 2 + ((l - mi) // 2) * 2

    #     if ans > tans 

    print(ans)



    


    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from fractions import gcd
# from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


def main():
    i, o, t, j, l, s, z = map(int, input().split())
    ans = o
    ans = ans + (i // 2) * 2 + (j // 2) * 2 + (l // 2) * 2
    ans += min(i % 2, min(j % 2, l % 2))
    
    ans2 = o
    k = min(i, min(l, j))
    i -= k
    l -= k
    j -= k
    ans2 += k * 3
    ans2 += (i // 2) * 2 + (j // 2) * 2 + (l // 2) * 2
    ans = max(ans ,ans2)
    

    print(ans)



    


    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from fractions import gcd
# from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


def main():
    i, o, t, j, l, s, z = map(int, input().split())
    ans = o
    ans = ans + (i // 2) * 2 + (j // 2) * 2 + (l // 2) * 2
    ans+= min(i%2 , min(j%2,l%2))

    print(ans)



    


    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

I, O, _, J, L, *_ = list(map(int, sys.stdin.buffer.readline().split()))
ans = 0

ans += O
# I, J, L は 3 つで 1 セット作れる
# 同じの 2 個でも 1 セット作れる
# 貪欲に 3 つのやつつくって、無駄があれば 2 つのほうに移す
if min(I, J, L) > 0:
    s = min(I, J, L)
    if I % 2 + J % 2 + L % 2 == 2:
        # あまりが 2 個出るなら同じので作ってもらったほうがいい
        s -= 1
    I -= s
    J -= s
    L -= s
    ans += s * 3
ans += (I // 2 + J // 2 + L // 2) * 2
print(ans)

Submission status: Wrong Answer

Solution code:
#縦2マス
#自明な詰め方しかなさそう×
#Iが処理できるわ
ai,ao,at,aj,al,aas,az= map(int, input().split())

ans1 = (ai//2)*2+ao+(aj//2)*2+(al//2)*2
ans2 = 0
if ai>0 and aj>0 and al>0:
    ans2 = (ai-1//2)*2+ao+(aj-1//2)*2+(al-1//2)*2+3
print(max(ans1,ans2))

Submission status: Wrong Answer

Solution code:
#縦2マス
#自明な詰め方しかなさそう
ai,ao,at,aj,al,aas,az= map(int, input().split())

ans = (ai//2)*2+ao+(aj//2)*2+(al//2)*2

print(ans)

Submission status: Wrong Answer

Solution code:
aI, aO, aT, aJ, aL, aS, aZ = map(int, input().split())

def calc(I, J, L) :        
    I -= I % 2
    J -= J % 2
    L -= L % 2
    return I + J + L
    
ret = aO + calc(aI, aJ, aL)
if aI >= 1 and aJ >= 1 and aL >= 1 :
    ret = max(ret, calc(aI-1, aJ-1, aL-1) + 3)

print(ret)

Submission status: Wrong Answer

Solution code:
ai,ao,_,aj,al,_,_ = map(int,input().split())
K = 0
K += ao + (ai//2)*2 + (aj//2)*2 + (al//2)*2
if ai%2 + aj%2 + al%2 == 2 and ai > 0 and al > 0 and aj > 0:
    K += 1
print(K)

Submission status: Wrong Answer

Solution code:
ai, ao, at, aj, al, a_s, a_z = map(int, input().split())

ans = 0
# **
# **
ans += ao

b = min(ai, aj, al)
ans += b * 3
ai -= b
aj -= b
al -= b

ans += (aj // 2) * 2
ans += (al // 2) * 2
ans += (ai // 2) * 2

print(ans)

Submission status: Wrong Answer

Solution code:
ai, ao, at, aj, al, a_s, a_z = map(int, input().split())

ans = 0
# **
# **
ans += ao

ans += (aj // 2) * 2
aj %= 2
ans += (al // 2) * 2
al %= 2

ans += (ai // 2) * 2
ai %= 2

ans += min(ai, aj, al) * 3

print(ans)

Submission status: Wrong Answer

Solution code:
ai, ao, at, aj, al, a_s, a_z = map(int, input().split())

ans = 0
# **
# **
ans += ao

# a----@
# aaa@@@
ans += min(ai, aj, al) * 3

# a@@@
# aaa@
ans += max(0, min(aj, al) - min(ai, aj, al)) * 2

# ----
# ====
ans += max(0, (ai - min(ai, aj, al)) // 2) * 2

print(ans)

Submission status: Wrong Answer

Solution code:
I,O,T,J,L,S,Z=map(int,input().split())
AI=(I//2)*4
AO=O*2
AJ=(J//2)*4
AL=(L//2)*4
print((AI+AO+AJ+AL)//2)

Submission status: Wrong Answer

Solution code:
I, O, T, R, L, S, Z = map(int, input().split())

ans = 0
if I * R * L == 0:
    ans = O + (I // 2 + L // 2 + R // 2) * 2
else:
    M = I % 2 + L % 2 + R % 2
    if M <= 1:
        ans = O + (I // 2 + L // 2 + R // 2) * 2
    else:
        ans = 6
        I -= 1
        L -= 1
        R -= 1
        ans += O + (I // 2 + L // 2 + R // 2) * 2

print(ans)

Submission status: Wrong Answer

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

def main():
    a = list(map(int,input().split()))
    if a[0]*a[3]*a[4] == 0:
        ans = 2*(a[0]//2+a[3]//2+a[4]//2)
    else:
        ans = max(2*(a[0]//2+a[2]//2+a[3]//2),\
            3+2*((a[0]-1)//2+(a[2]-1)//2+(a[3]-1)//2))

    print(a[1]+ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

def main():
    a = list(map(int,input().split()))
    a[3] = a[3]//2
    a[4] = a[4]//2
    if a[0]%2 == 0:
        row = 2*(a[0]+a[1])+4*(a[3]+a[4])
    else:
        if a[3] == 0 and a[4] == 0:
            row = 4*(a[0]//2)+2*a[1]
        else:
            row = 4*(a[0]//2)+2*a[1]+4*(a[3]+a[4]-1)+6

    print(row//2)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

ans = a2

ans_1 = 3 + (a1-1) // 2 * 2 + (a4-1) // 2 * 2 + (a5-1) // 2 * 2
ans_2 = a1 // 2 * 2 + a4 // 2 * 2 + a5 // 2 * 2

print(max(ans_1, ans_2)+ans)

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

ans = a2

ans_1 = 3 + (a1-1) // 2 * 2 + (a4-1) // 2 * 2 + (a5-1) // 2 * 2
ans_2 = a1 // 2 * 2 + a4 // 2 * 2 + a5 // 2 * 2

print(max(ans_1, ans_2))

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

ans = a2
ans += a4 // 2 * 2
ans += a5 // 2 * 2
a4 = a4 % 2
a5 = a5 % 2


if a4 == 1 and a5 == 1 and a1 > 0:
    ans += 3
    a1 -= 1
ans += a1 // 2 * 2

print(ans+1)

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

ans = a2
ans += a4 // 2 * 2
ans += a5 // 2 * 2
a4 = a4 % 2
a5 = a5 % 2


if a4 == 1 and a5 == 1 and a1 > 0:
    ans += 3
    a1 -= 1
ans += a1 // 2 * 2

print(ans)

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

ans = a2
ans += a4 // 2
ans += a5 // 2
a4 = a4 % 2
a5 = a5 % 2


if a4 == 1 and a5 == 1 and a1 > 0:
    ans += 3
    a1 -= 1
ans += a1 // 2 * 2

print(ans)

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

ans = a2
ans += a4 // 2
ans += a5 // 2
a4 = a4 % 2
a5 = a5 % 2


if a4 == 1 and a5 == 1 and a1 > 0:
    ans += 3
    a1 -= 1
ans += a1 // 2

print(ans)

# jjjlll
# jiiiil

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

ans = a2
ans += a4 // 2
a4 = a4 % 2
a5 = a5 % 2
ans += a5 // 2

if a4 == 1 and a5 == 1 and a1 > 0:
    ans += 3
    a1 -= 1
ans += a1 // 2

print(ans)

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

# jjjlll
# jiiiil

d = min(a4,a5,a1)

a1, a4, a5 = a1-d, a4-d ,a5-d

b = a2

l = a1 // 2 * 2

print(3*d+b+l)

Submission status: Wrong Answer

Solution code:
a1, a2, a3, a4, a5, a6, a7 = [ int(v) for v in input().split() ]

# jjjlll
# jiiiil

d = min(a4,a5,a1)

a1, a4, a5 = a1-d, a4-d ,a5-d

b = a2

l = a1 // 2 * 2

print(d+b+l)

Submission status: Wrong Answer

Solution code:
a1, a2, _, a3, a4, _, _ = map(int, input().split())

ans = 0

# a2をすべて使用して2*2をたくさん作る
ans += a2 * 2
a2 = 0
# a1を使用して2*4をたくさん作る
ans += (a1 // 2) * 4
a1 = a1 % 2
# a3を使用して2*4をたくさん作る
ans += (a3 // 2) * 4
a3 = a3 % 2
# a4を使用して2*4をたくさん作る
ans += (a4 // 2) * 4
a4 = a4 % 2
# もしa1, a3, a4が1つずつ余っているなら2*6を1つ作れる
if a1 == 1 and a3 == 1 and a4 == 1:
    ans += 6

print(ans // 2)

Submission status: Wrong Answer

Solution code:
data = list(map(int,input().split()))
ans = data[1]
a1 = (data[0]//2)*2 + (data[3]//2)*2 + (data[4]//2)*2
a2 = 3 + ((data[0]-1)//2)*2 + ((data[3]-1)//2)*2 + ((data[4]-1)//2)*2

print(ans + max(a1,a2))

Submission status: Wrong Answer

Solution code:
data = list(map(int,input().split()))
ans = data[1]
a1 = data[0]//2*2 + data[3]//2*2 + data[4]//2*2
a2 = 3 + (data[0]-1)//2*2 + (data[3]-1)//2*2 + (data[4]-1)//2*2

print(ans + max(a1,a2))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
a = [int(item) for item in input().split()]
ans = 0
ans += a[0] // 2 * 2
ans += a[1]
ans += a[3] // 2 * 2
ans += a[4] // 2 * 2
if a[0] % 2 == 1 and a[3] % 2 == 1 and a[4] % 2 == 1:
    ans += 3
print(ans)

Submission status: Wrong Answer

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

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    x,y = LI()
    if x < 0:
        if y < 0:
            if x < y:
                print(y-x)
            else:
                print(x-y+2)
        else:
            if abs(x) < y:
                print(y-abs(x)+1)
            else:
                print(-y-x+(y>0))
    else:
        if y < 0:
            if x < abs(y):
                print(abs(y)-x+1)
            else:
                print(x+y+1)
        else:
            if x < y:
                print(y-x)
            else:
                print(x-y+(x>0)+(y>0))
    return

#B
def B():

    return

#C
def C():
    a = LI()
    print(2*(a[0]//2)+a[1]+2*(a[3]//2)+2*(a[4]//2)+((a[0]&1)&(a[3]>0)&(a[4]>0)))
    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

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

Submission status: Wrong Answer

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

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    x,y = LI()
    if x < 0:
        if y < 0:
            if x < y:
                print(y-x)
            else:
                print(x-y+2)
        else:
            if abs(x) < y:
                print(y-abs(x)+1)
            else:
                print(-y-x+(y>0))
    else:
        if y < 0:
            if x < abs(y):
                print(abs(y)-x+1)
            else:
                print(x+y+1)
        else:
            if x < y:
                print(y-x)
            else:
                print(x-y+(x>0)+(y>0))
    return

#B
def B():

    return

#C
def C():
    a = LI()
    print(2*(a[0]//2)+a[1]+2*(a[3]//2)+2*(a[4]//2)+((a[0]&1)&(a[3]>1)&(a[4]>1)))
    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

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

Submission status: Wrong Answer

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

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    x,y = LI()
    if x < 0:
        if y < 0:
            if x < y:
                print(y-x)
            else:
                print(x-y+2)
        else:
            if abs(x) < y:
                print(y-abs(x)+1)
            else:
                print(-y-x+(y>0))
    else:
        if y < 0:
            if x < abs(y):
                print(abs(y)-x+1)
            else:
                print(x+y+1)
        else:
            if x < y:
                print(y-x)
            else:
                print(x-y+(x>0)+(y>0))
    return

#B
def B():

    return

#C
def C():
    a = LI()
    print(2*(a[0]//2)+a[1]+2*(a[3]//2)+2*(a[4]//2)+((a[0]&1)&((a[3]>1)|(a[4]>1))))
    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

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

Submission status: Wrong Answer

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

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    x,y = LI()
    if x < 0:
        if y < 0:
            if x < y:
                print(y-x)
            else:
                print(x-y+2)
        else:
            if abs(x) < y:
                print(y-abs(x)+1)
            else:
                print(-y-x+(y>0))
    else:
        if y < 0:
            if x < abs(y):
                print(abs(y)-x+1)
            else:
                print(x+y+1)
        else:
            if x < y:
                print(y-x)
            else:
                print(x-y+(x>0)+(y>0))
    return

#B
def B():

    return

#C
def C():
    a = LI()
    print(2*(a[0]//2)+a[1]+2*(a[3]//2)+2*(a[4]//2))
    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

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

Submission status: Wrong Answer

Solution code:
a, b, c, d, e, f, g = map(int, input().split())
ans = b * 2
ans += d // 2 * 4
ans += e // 2 * 4
ans += a // 2
if a % 2 == 1 and e % 2 == 1 and f % 2 == 1:
    ans += 6

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c, d, e, f, g = map(int, input().split())
ans = b * 2
ans += min(d, e) * 4
ans += a // 2
if a % 2 == 1 and min(d, e) > 0:
    ans += 2

print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
ans = ((a[0] // 2) * 4 + a[1] * 2 + (a[3] // 2) * 4 + (a[4] // 2) * 4) // 2
if a[0] % 2 == 1 and a[3] % 2 == 1 and a[4] % 2 == 1:
    print(ans + 3)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
ans = ((a[0] // 2) * 4 + a[1] * 2 + (a[3] // 2) * 4 + (a[4] // 2) * 4) // 2
if a[1] % 2 == 1 and a[3] % 2 == 1 and a[4] % 2 == 1:
    print(ans + 3)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
ans = ((a[0] // 2) * 4 + a[1] * 2 + (a[3] // 2) * 4 + (a[4] // 2) * 4) // 2
if a[1] % 2 == 1 and a[3] % 2 == 1 and a[4] % 2 == 1:
    print(ans + 6)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
i, o, t, j, l, s, z = map(int, input().split())
print(o + max(3 + (i-1)//2*2 + (j-1)//2*2 + (l-1)//2*2, i//2*2 + j//2*2 + l//2*2))

Submission status: Wrong Answer

Solution code:
i, o, t, j, l, s, z = map(int, input().split())
t1 = min([j, i, l])
j -= t1; i -= t1; l -= t1
if j < l:
    j, l = l, j
t2 = min(j//2, i//2)
j -= t2; i -= t2
print(o + t1*3 + t2*4 + i//2*2)

Submission status: Wrong Answer

Solution code:
i, o, t, j, l, s, z = map(int, input().split())
print(i//2*2+o)

Submission status: Wrong Answer

Solution code:
a_i,a_o,a_t,a_j,a_l,a_s,a_z=map(int,input().split())
ans1=0
ans1+=a_o
ans2=max(2*(a_i//2+a_j//2+a_l//2),3+2*((a_i-1)//2+(a_j-1)//2+(a_l-1)//2))
print(ans1+ans2)

Submission status: Wrong Answer

Solution code:
a_i,a_o,a_t,a_j,a_l,a_s,a_z=map(int,input().split())
ans=0
ans+=2*(a_i//2)
a_i%=2
ans+=a_o
a_o=0
ans+=2*(a_j//2)
a_j%=2
ans+=2*(a_l//2)
a_l%=2
if a_i==1 and a_j==1 and a_l==1:
  ans+=3
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z=map(int,input().split())
ans=0
if i==0 or j==0 or l==0:
  ans+=o+(i//2)*2+(j//2)*2+(l//2)*2+(j%2+l%2)//2
else:
  ans+=o+(i//2)*2+(j//2)*2+(l//2)*2+(j%2+l%2)//2
  ans1=o+((i-1)//2)*2+((j-1)//2)*2+((l-1)//2)*2+3+((j-1)%2+(l-1)%2)//2
  ans=max(ans,ans1)
print(ans)

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z=map(int,input().split())
ans=0
if i==0 or j==0 or l==0:
  ans+=o+(i//2)*2+min(j,l)*2
else:
  ans+=o+(i//2)*2+min(j,l)*2
  ans1=o+((i-1)//2)*2+max(0,min(j-1,l-1))*2
  ans=max(ans,ans1)
print(ans)

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z=map(int,input().split())
ans=o
if i==0 or j==0 or l==0:
  ans+=(i//2)*2+min(j,l)*2
else:
  ans+=(i//2)*2+min(j,l)*2
  ans1=o+((i-1)//2)*2+max(0,min(j-1,l-1))*2
  ans=max(ans,ans1)
print(ans)

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z=map(int,input().split())
ans=o
if i%2==0:
  ans+=2*(i//2)+2*min(l,j)
else:
  ans+=2*(i//2)
  if min(l,j)>0:
    ans+=3+2*min(l-1,j-1)
print(ans)

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z=map(int,input().split())
print(max( o+2*((i-1)//2+(j-1)//2+(l-1)//2)+3 ,o+(i//2+j//2+l//2)*2,0)  )

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z=map(int,input().split())
if i%2==1 and j%2==1 and l%2==1:
    print(o+2*(i//2+j//2+l//2)+3)
else:
    print((o+i+j+l))

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z=map(int,input().split())
if i%2==1 and j%2==1 and l%2==1:
    print(o+2*(i//2+j//2*l//2)+3)
else:
    print((o+i+j+l))

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z=map(int,input().split())
if i%2==1 and j%2==1 and l%2==1:
    print(o+(i//2+j//2*l//2)+3)
else:
    print((o+i+j+l))

Submission status: Wrong Answer

Solution code:
A = {k:a for k,a in zip(list("IOTJLSZ"),map(int,input().split()))}
m = min(A["I"],A["J"],A["L"])
ans = 0
for i in (0,1):
    ans = max(ans, 3*i + A["O"] + (A["I"]-i)//2*2 + (A["J"]-i)//2*2 + (A["L"]-i)//2*2)
print(ans)

Submission status: Wrong Answer

Solution code:
A = {k:a for k,a in zip(list("IOTJLSZ"),map(int,input().split()))}
m = min(A["I"],A["J"],A["L"])
ans = 0
for i in (0,1,m-1,m):
    ans = max(ans, 3*i + A["O"] + (A["I"]-i)//2*2 + (A["J"]-i)//2*2 + (A["L"]-i)//2*2)
print(ans)

Submission status: Wrong Answer

Solution code:
A = {k:a for k,a in zip(list("IOTJLSZ"),map(int,input().split()))}
m = min(A["I"],A["J"],A["L"])
ans = 0
for i in (0,1,m-1,m):
    ans = max(ans, 3*i + A["O"] + (A["I"]-i)//2 + (A["J"]-i)//2 + (A["L"]-i)//2)
print(ans)

Submission status: Wrong Answer

Solution code:
# 入力
a_I, a_O, a_T, a_J, a_L, a_S, a_Z = map(int, input().split())

# 使用するテトロミノはI, O, J, L型のみ
R = (a_I % 2 + a_J % 2 + a_L % 2) // 2
ans = a_O + 2 * ((a_I - R) // 2) + 2 * ((a_J - R) // 2) + \
    2 * ((a_L - R) // 2) + 3 * R

# 出力
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d,e,f,g=map(int,input().split())
k=0
k+=b
k+=3*min(a,d,e)
a-=min(a,d,e)
d-=min(a,d,e)
e-=min(a,d,e)
a-=a%2
k+=a
d-=d%2
k+=d
e-=e%2
k+=e
print(k)

Submission status: Wrong Answer

Solution code:
import math

def xv(num):
    return 2 * math.floor(0.5 * num)

a = list(map(int, input().split()))
ans = 0

Que = xv(a[0]) + xv(a[3]) + xv(a[4])

if (a[3] or a[4]) == 0:
    Qae = 0
else:
    a[0] = a[0] - 1
    a[3] = a[3] - 1
    a[4] = a[4] - 1

    Qae = 3 + xv(a[0]) + xv(a[3]) + xv(a[4])

ans = ans + a[1] + max(Que,Qae)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def xv(num):
    return 2 * math.floor(0.5 * num)

a = list(map(int, input().split()))
ans = 0

Que = xv(a[0]) + xv(a[3]) + xv(a[4])

a[0] = a[0] - 1
a[3] = a[3] - 1
a[4] = a[4] - 1

Qae = 3 + xv(a[0]) + xv(a[3]) + xv(a[4])

ans = ans + a[1] + max(Que,Qae)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def xv(num):
    return 2 * math.floor(0.5 * num)

a = list(map(int, input().split()))
ans = 0

Que = xv(a[0]) + xv(a[3]) + xv(a[4])

a[3] = a[3] - 1
a[4] = a[4] - 1
Qae = 3 + xv(a[3]) + xv(a[4])

ans = ans + a[1] + max(Que,Qae)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def is_even(num):
    return num % 2 == 0

def xv(num):
    return 2 * math.floor(0.5 * num)

a = list(map(int, input().split()))
ans = 0
L = xv(a[3]) + xv(a[4])

if is_even(a[0]) == False:
    a[0] = a[0] - 1
    a[3] = a[3] - 1
    
    ans = ans + 3 + L
else:
    ans = ans + xv(a[0]) + L
ans = ans + a[1]
print(ans)

Submission status: Wrong Answer

Solution code:
import math

a = list(map(int, input().split()))
ans = 0
i = 2 * math.floor(0.5 * a[0])

if a[5] or a[2] or a[6]:
    pass
else:
    if a[3] == a[4]:
        ans = ans + a[3] * 2
        
    ans = ans + i + a[1]

print(ans)

Submission status: Wrong Answer

Solution code:
import math

a = list(map(int, input().split()))
ans = 0
i = 2 * math.floor(0.5 * a[0])

if a[5] or a[2] or a[6]:
    pass
else:
    if a[3] == a[4]:
        ans = ans + a[3]
        
    ans = ans + i + a[1]

print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
ans = 0
ans += int(a[0] // 2) * 2
ans += int(a[3] // 2) * 2
ans += int(a[4] // 2) * 2
ans += a[1]
if a[0] % 2 == 1 and a[3] % 2 == 1 and a[4] % 2 == 1:
    ans += 3
print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
ans = 0
ans += 4 * int(a[0] // 2) * 2
ans += 4 * int(a[3] // 2) * 2
ans += 4 * int(a[4] // 2) * 2
ans += 4 * a[1]
if a[0] % 2 == 1 and a[3] % 2 == 1 and a[4] % 2 == 1:
    ans += 12
print(int(ans / 4))

Submission status: Wrong Answer

Solution code:
a,square,qqq,b,c,qqqq,qqqqq=  list(map(int,input().split()))


b_ = b%2
c_ = c%2

b_sub = b-b_
c_sub = c-c_

if b_==1 and c_==1:
    a=a-1
    a_ = a%2
    a_sub = a-a_
    print(a_sub+b_sub+c_sub+3+square)
else:
    a_ = a%2
    a_sub = a-a_
    print(a_sub+b_sub+c_sub+square)

Submission status: Wrong Answer

Solution code:
a,square,qqq,b,c,qqqq,qqqqq=  list(map(int,input().split()))

a_ = a%2
b_ = b%2
c_ = c%2
a_sub = a-a_
b_sub = b-b_
c_sub = c-c_

if a_ == 1 and b_==1 and c_==1:
    print(a_sub+b_sub+c_sub+3+square)
else:
    print(a_sub+b_sub+c_sub+square)

Submission status: Wrong Answer

Solution code:
a,square,qqq,b,c,qqqq,qqqqq=  list(map(int,input().split()))

a_ = a%2
b_ = b%2
c_ = c%2
a_sub = a-a_
b_sub = b-b_
c_sub = c-c_

if a_ == 1 and b_==1 and c_==1:
    print(a_sub+b_sub+c_sub+1+square)
else:
    print(a_sub+b_sub+c_sub+square)

Submission status: Wrong Answer

Solution code:
all=input().split()
I=int(all[0]);O=int(all[1]);J=int(all[3]);L=int(all[4])
count=0
while min(I,J,L)!=0:
    count+=6
    J-=1;L-=1;I-=1
print(I,O,J,L,count)
while I>=2:
    count+=4
    I-=2
print(I,O,J,L,count)
while O!=0:
    count+=2
    O-=1
print(I,O,J,L,count)
while J>=2:
    count+=3
    J-=2
print(I,O,J,L,count)
while L>=2:
    count+=3
    L-=2
print(I,O,J,L,count)
print(str(int(count/2)))

Submission status: Wrong Answer

Solution code:
all=input().split()
I=int(all[0]);O=int(all[1]);J=int(all[3]);L=int(all[4])
count=0
while I>=2:
    count+=4
    I-=2
while O!=0:
    count+=2
    O-=1
while J>=2:
    count+=3
    J-=2
while L>=2:
    count+=3
    L-=2
while True:
    if J>=1 and L>=1 and I>=1:
        count+=6
        J-=1;L-=1;I-=1
    else:
        break
print(str(int(count/2)))

Submission status: Wrong Answer

Solution code:
I,O,T,J,L,S,Z = map(int,input().split())
if I==1 and J==1 and L==1:                                                     
    print(3) 
elif ((I-1)//2+(J-1)//2+(L-1)//2)*2+O==0 and (I//2+J//2+L//2)*2+O==0:  
    print(0)
else:
    print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3,(I//2+J//2+L//2)*2+O))

Submission status: Wrong Answer

Solution code:
I,O,T,J,L,S,Z = map(int,input().split())
if (((I-1)//2+(J-1)//2+(L-1)//2)*2+O==0 and (I//2+J//2+L//2)*2+O==0): 
    print(0)
else:
    print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3,(I//2+J//2+L//2)*2+O))

Submission status: Wrong Answer

Solution code:
I,O,T,J,L,S,Z = map(int,input().split())
print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3,(I//2+J//2+L//2)*2+O))

Submission status: Wrong Answer

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
#n = ip()                                     #入力整数1つ
#a,b,c= (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)

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
a.pop(6)
a.pop(5)
a.pop(2)
s = sum(a)
for i in range(4):
    if i != 1 and a[i]%2: s-=1
if s+3==sum(a):s = sum(a)
if s+2==sum(a):s = sum(a)-1
print(s)

Submission status: Wrong Answer

Solution code:
i,o,t,j,l,s,z = map(int,input().split())
ans = o
if i%2 == 1 and j%2 == 1 and l%2 == 1:
    ans += i+j+l
else:
    for a in [i,j,l]:
        if a % 2 == 1:
            ans += a-1
        else:
            ans += a
print(ans)

Submission status: Wrong Answer

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
#n = ip()                                     #入力整数1つ
#a,b,c= (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)

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
a.pop(6)
a.pop(5)
a.pop(2)
s = sum(a)
for i in range(4):
    if i != 1 and a[i]%2: s-=1
if s+3==sum(a):s = sum(a)
print(s)