Problem:


Score: 100 points

Problem Statement

E869120's and square1001's 16-th birthday is coming soon.

Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.

E869120 and square1001 were just about to eat A and B of those pieces, respectively,

when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake".

Can both of them obey the instruction in the note and take desired numbers of pieces of cake?

Constraints

A and B are integers between 1 and 16 (inclusive).

A+B is at most 16.

Input

Input is given from Standard Input in the following format:

A B

Output

If both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.

Sample Input 1

5 4

Sample Output 1

Yay!

Both of them can take desired number of pieces as follows:

Sample Input 2

8 8

Sample Output 2

Yay!

Both of them can take desired number of pieces as follows:

Sample Input 3

11 4

Sample Output 3

:(

In this case, there is no way for them to take desired number of pieces, unfortunately.



Sample input:
5 4


Sample output:
Yay!

Submission status: Runtime Error

Solution code:
#coding:utf-8
import sys

input_nums = [int(x) for x in split(readline())]

if len(input_num) > 2 :
	sys.exit("illegal input")
    
if (sum(input_nums)) > 16:
  sys.exit("illegal input")
  
if (min(input_nums)) < 1:
  sys.exit("illegal input")
  
if (max_num = max(input_nums)) > 16:
  sys.exit("illegal input")
elif max_num > 8:
  print(":(")
else :
  print('Yay!')

Submission status: Runtime Error

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

cnt = 0

for i in range(n):
    while(True):
        if a[i] % 2 != 0:
            break
        else:
            a[i] = int(a[i] / 2)
            cnt += 1

print(cnt)

Submission status: Runtime Error

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

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

if a >= 8 o r b >= 8:
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split()) #Nは種類、Mは食べる個数
ListPPP=[]
ListPPM=[]
ListPMP=[]
ListMPP=[]
ListPMM=[]
ListMPM=[]
ListMMP=[]
ListMMM=[]
for i in range(0,N,1):
  x,y,z=map(int,input().split())
  ListPPP.append(x+y+z)
  ListPPM.append(x+y-z)
  ListPMP.append(x-y+z)
  ListMPP.append(-x+y+z)
  ListPMM.append(x-y-z)
  ListMPM.append(-x+y-z)
  ListMMP.append(-x-y+z)
  ListMMM.append(-x-y-z)

MAXList=[]
a=0;b=0;c=0;d=0;e=0;f=0;g=0;h=0


ListPPP.sort()
for i in range(0,M,1):
  a+=int(ListPPP[-1-i])
  
ListPPM.sort()
for i in range(0,M,1):
  b+=int(ListPPM[-1-i])

ListPMP.sort()
for i in range(0,M,1):
  c+=int(ListPMP[-1-i])

ListMPP.sort()
for i in range(0,M,1):
  d+=int(ListMPP[-1-i])

ListPMM.sort()
for i in range(0,M,1):
  e+=int(ListPMM[-1-i])


ListMPM.sort()
for i in range(0,M,1):
  f+=int(ListMPM[-1-i])


ListMMP.sort()
for i in range(0,M,1):
  g+=int(ListMMP[-1-i])

ListMMM.sort()
for i in range(0,M,1):
  h+=int(ListMMM[-1-i])
  
MAXList.append(a)
MAXList.append(b)
MAXList.append(c)
MAXList.append(d)
MAXList.append(e)
MAXList.append(f)
MAXList.append(g)
MAXList.append(h)
print(max(MAXList))

Submission status: Runtime Error

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

if abs(a-b) < 2:
    print("Yay!")
else:
    printa, b = map(int, input().split())

if abs(a-b) < 2:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

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

if abs(a-b) < 2:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
a,b=(int(i) for i in input().split())
if a>=9
  print(':(')
elif b>=9:
  print(':(')
else:
  print('Yay!')

Submission status: Runtime Error

Solution code:
a,b=int(input().split())
if a>=9:
  print('')
elif b>=9:
  print(':(')
else:
  print('Yay!')

Submission status: Runtime Error

Solution code:
a,b=input().split()
if a>=9:
  print('')
elif b>=9:
  print(':(')
else:
  print('Yay!')

Submission status: Runtime Error

Solution code:
if max(int(input()),int(input()))>8:print(":(")
else:print("Yay!")

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
max = 8
if A <= max && B <= max:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
A,B=map(iny,input().split())
if A<=8 and B<=8:
    print('Yay!')
else :
    print(':(')

Submission status: Runtime Error

Solution code:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in a:
    while i%2==0:
        i/=2
        count+=1
print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in a:
    while b%2==0:
        b/=2
        count+=1
print(count)

Submission status: Runtime Error

Solution code:
def happy_birthday(A: int, B: int) -> bool:
    return A <= 8 and B <= 8:


if __name__ == "__main__":
    A, B = map(int, input().split())
    yes = happy_birthday(A, B)
    print('Yay!' if yes else ':(')

Submission status: Runtime Error

Solution code:
a,b=int(input())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
#include<stdio.h>

int main(void)
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a>8 || b>8){
        printf(":(");
    } else{
        printf("Yay!");
    }
    
}

Submission status: Runtime Error

Solution code:
a, b = int(input())
if a <= 8 and b <= 8:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
if 'A<9) and (B<9):
    print('Yay!')
else:
    print(':)')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
print("Yay!" if A<9 and B<9 else ":(")

Submission status: Runtime Error

Solution code:
a,b=map(int,input(),split())
if a<=8 and b<=8:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a,b =map(int,input(),split())
if a<=8 or b<=8:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a,b =int(input(),split())
if a<=8 or b<=8:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a = list(map(int, input().split()))
a.sort()
if a < 9:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
if 1 <= a <= 8 & 1 <= b <= 8:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A,B=map(int,input().split())
if A <= 8 and B <= 8:
  print(Yay!)
else:
  print(:()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A,B=map(int,input().split)
if A <= 8 and B <= 8:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A,B=map(int,input().split)
if A <= 8 and B <= 8:
  print(Yay!)
else:
  print(:()

Submission status: Runtime Error

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

if max(a,b) <= 8:
        print('Yay!')
else:
        print(':(')

Submission status: Runtime Error

Solution code:
import sys
array =[]
for line in sys.stdin.readlines():
    array.append(line.rstrip())
num1 = array[0]
box =list()
num2 = array[1]
print(num2)
for i in range(0,len(num2.split(" "))) :
    box.append(int(num2.split(" ")[i]))
count =0
for j in range(len(box)):
    while(True):
        if box[j]%2==0:
            count+=1
            box[j]=box[j]//2
        else:
            break;
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(n):
  while a[i] % 2 == 0:
    count += 1
    a[i] /= 2
print(count)

Submission status: Runtime Error

Solution code:
D, N = map(int, input().split())
l = []
for i in range(1, 100):
	if 100/i == D:
		l.append(i)
print(l[N-1])

Submission status: Runtime Error

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

if( abs(A - B) == 1):
  print('yey!)
        
else:
  print(':(')

Submission status: Runtime Error

Solution code:
a=input().strip().split(" ")
b=[int(i) for in a]

if(b[0]<=8 and b[1]<=8):
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
a,b = input().split()
#print(a)
#print(b)

if a>8 or b>8:
    print(':(')
else:
    print('Yay!')

Submission status: Runtime Error

Solution code:
a,b = input().split()
#print(a)
#print(b)

if a>8 or b>8:
    print(':(')
else:
  print('Yay!')

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
print("Yay!") if a <= 8 and b <= 8 else print(":(
")

Submission status: Runtime Error

Solution code:
a, b = int(input())
print("Yay!") if a <= 8 and b <= 8 else print(":(
")

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
if a[0] <=8 and a[1] <=8:
  print("Yay!")
else:
  print(:()

Submission status: Runtime Error

Solution code:
print('Yay!'if max(map(int,input().split()))<'9' else':(')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split()):print('Yay!' if max(a,b)<=8 else ':(')

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if a >9:
  print(":(")
elif b > 9:
  print(":(")
else:
  print(""Yay!)

Submission status: Runtime Error

Solution code:
a = map(int,input().split())
if a[0] >9:
  print(":(")
elif a[1] >9:
  print(":(")
else:
  print(""Yay!)

Submission status: Runtime Error

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

if if A-B <=1 or B-A <=1:
	print("Yay!")
else:
	print(":(")

Submission status: Runtime Error

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

if A<9 AND B<9:
	print('Yay!')
else:
	print(':(')

Submission status: Runtime Error

Solution code:
A, B = (int(i) for i in input().split())
if A =< 8 and B =< 8:
  print('yay!')
else:
  print(':(')

Submission status: Runtime Error

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

if N<100:
  print(100**D*N)
else:
  print(100**D*101)

Submission status: Runtime Error

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

if N<100:
  print(pow(100,D)*N)
else:
  print(pow(100,D)*101)

Submission status: Runtime Error

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

if N<100:
  print(pow(100,D)*N)
else:
  print(pow(100,D)*101)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split)
if (A>8) or (B>8):
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split)
if A>8 or B>8:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
A = int(raw_input())
B = int(raw_input())

if (A <= 8) and (B <= 8):print "Yay!"
else : print ":("

Submission status: Runtime Error

Solution code:
if (A <= 8) and (B <= 8):print "Yay!"
else : print ":("

Submission status: Runtime Error

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

if (a > 8 or b>8):
    print(":(")
else
    print("Yay!")

Submission status: Runtime Error

Solution code:
a,b=int(input().split())
if a>8|b>8:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

if a > 8 or b > 8:
    print(":(")



else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

if a > 8:
    print(":(")

elif b > 8:
    print(":(")

else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
N = int(input())
a_li = list(map(int,input().split()))
     
cnt = 0
for i in a_li:
    while i % 2 == 0:
        cnt += 1
        i //= 2
        if i % 2 != 0:
            break
     
print(cnt)

Submission status: Runtime Error

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

if a <= 8 and n <= 8:
    print('Yay!')
else:
    print(':(')

Submission status: Runtime Error

Solution code:
A, B = map(int, raw_input().split())

if A <= 8 and B <= 8:
    print('Yay!')
else:
    print(':(')

Submission status: Runtime Error

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

if a>8 and b>8
	print(":)")
else:
	print("Yay")

Submission status: Runtime Error

Solution code:
A, B = list(map(int, input()))
if A<9 and B<9:
    print('Yay!')
else:
    print(':(')

Submission status: Runtime Error

Solution code:
A = input('A:')
B = input('B:')
a = int(A)
b = int(B)

if a <= 8 and b <= 8:
    print('Yay!')
elif a > 8 or b > 8:
    print(':(')

Submission status: Runtime Error

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

if a > 8 and b > 8 :
  print (":(")
elif
  print ("Yay!")

Submission status: Runtime Error

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

if a > 8 && b > 8 :
  print (":(")
elif
  print ("Yay!")

Submission status: Runtime Error

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

if A <= 8 or B <= 8:
    return "Yay!"
else:
    return ":("

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
if 8 < a or 8 < b:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
a, b = map(int,raw_input().split())
if(a > 8 || b > 8):
	print ":("
else:
	print "Yay!"

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

if(a > 8 or b > 8):
    print (':(') 
else:
    print ('Yay!')

Submission status: Runtime Error

Solution code:
a = input()
b = input()

if(a > 8 || b > 8):
    print(':(')
else:
    print('Yay!')

Submission status: Runtime Error

Solution code:
A, B = input().split(" ")
if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
# coding:utf-8
import itertools

n, m = map(int,input("").split())

cakes = []
for i in range(n):
    cakes.append(input().split())

maxsum = 0
for kumiawase in itertools.combinations(cakes, m):
    x = y = z = 0
    for cake in kumiawase:
        x += int(cake[0])
        y += int(cake[1])
        z += int(cake[2])
    statussum = abs(x) + abs(y) + abs(z)
    if statussum > maxsum:
        maxsum = statussum
print(maxsum)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split)
if a<= 8 and b<= 8:
    print('Yay!')
else:
    print(':(')

Submission status: Runtime Error

Solution code:
a = []
b = []
mem = {}
ans = 0
def flip(f):
    for i in range(len(a)):
        for j in range(3):
            if f & (1 << j) == 1:
                a[i][j] = - a[i][j]
def solve(n,m):
    if(mem.get((n,m))!=None):
        return mem[(n,m)]
    if m == 0:
        return 0
    if n == m:
        mem[(n,m)] = sum(b[:n])
        return mem[(n,m)]
    ans = max([solve(n-1,m-1) + b[n-1] , solve(n-1,m)])
    mem[(n,m)] = ans
    return ans
n,m = map(int,input().split())
for i in range(n):
    a.append(list(map(int,input().split())))
for f in range(8):
    b.clear()
    flip(f)
    for x in a:
        b.append(sum(x))
    mem.clear()
    ans = max([ans,solve(n,m)])
    flip(f)
print(ans)

Submission status: Runtime Error

Solution code:
A,B = map(int(input().split()))
if A<9 and B<9:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv

if(args[1]>8 or args[2]>8):
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
import sys

printf(sys.argv[1])

Submission status: Runtime Error

Solution code:
import sys

def solve(a, b):
    if a == 0 or a==1 or a==2:
        if b==100:
            answer=100**a*b+(1**a)
        else:
            answer=100**a*b
    return answer

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:

#! bin/env/python python3
# -*- coding:utf-8 -*-

d,n = map(int, raw_input().split())



print(d)
print(n)


if d == 0:
	print(n)
elif d == 1:
	print(n*100*d)
elif d == 2:
	print(n*10000)

Submission status: Runtime Error

Solution code:
import sys

def solve(a,b):
    if  a <= 8 and b <= 8 :
        return 'yay'
    else:
        return ':('
def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b):
    if 1<a and a<9:
        if 1<b and b<9:
            answer='yay!'
        else:
            answer=':('
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

def solve(n):
    if  a <= 8 and b <= 8 :
        return 'yay'
    else:
        return ':('
def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(n):
    if  a <= 8 and b <= 8 :
        return 'yay'
    else:
        return ':('

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a, b  = raw_input().split()

if int(a) > 8 or int(b) > 8:
    print(":(")
else:
    print("yay!")

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())
x = [tuple(map(int, input().split())) for _ in range(n)]
from itertools import *
print(max(sum(sorted((sum(i*j for i,j in zip(a,t)) for t in x),reverse=True)[:m]) for a in product([-1,1],[-1,1],[-1,1])))

Submission status: Runtime Error

Solution code:
    d, n = map(int, input().split())
    if d == 0:
      if n == 100:
        print(101)
      else:
        print(n)
    else:
      if n == 100:
      	print(100**d * n)
      else:
        print(100**d * 101)

Submission status: Runtime Error

Solution code:
innum = raw_input()
if int(innum[0]) <= 8 and int(innum[2]) <= 8:
    print "Yay!"
else:
    print ":("

Submission status: Runtime Error

Solution code:
innum = raw_input()
print innum[1]
if int(innum[0]) <= 8 and int(innum[2]) <= 8:
    print "Yay!"
else:
    print ":("

Submission status: Runtime Error

Solution code:
# input
A, B = map(int, input().input())

if A >= 9 or B >= 9:
    print(':(')
else:
    print('Yay')

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
if (A > 9 or B > 9):
    print(':(')
else:
    print('Yay!')

Submission status: Runtime Error

Solution code:
#coding : utf-8

if __name__ == "__main__":
    a,b = list(map(int,input().split()))
    if a =< 8 and b =< 8:
        print('Yay!')
    else:
        print(':(')

Submission status: Runtime Error

Solution code:
import copy
import numpy as np
n,m = map(int, input().split())
cakes = []
for i in range(n):
    cakes.append(list(map(int, input().split())))

def rec(i, k, s, obj):
    if i==k:
        obj.append(s)
        return
    rec(i+1, k, copy.deepcopy(s), obj)
    s[i]=1
    rec(i+1, k, copy.deepcopy(s), obj)
    s[i]=-1


def makeCombination(k):
    s=[-1 for i in range(k)]
    obj = []
    rec(0, k, s, obj)
    return obj

comb = makeCombination(3)
max = 0
for c in comb:
    sum_list = []
    nc = np.array(c)
    for cak in cakes:
        cake = np.array(cak)
        total = cake.dot(nc)
        sum_list.append(total)
    ssum_list = sorted(sum_list)
    sum_mm = sum(ssum_list[n-m:])
    if(max < sum_mm):
        max = sum_mm

print(max)

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split()))
if a >= 8:
    print(:()
elif b >= 8:
    print(:()
else:
    print(Yay!)

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split()))
if a => 8:
    print(:()
elif b => 8:
    print(:()
else:
    print(Yay!)

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split()))
if a > 8:
    print(:()
elif b > 8:
    print(:()
else:
    print(Yay!)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
if (int(a)<=8):
    if(int(b)<=8):
        print('Yay!')
else:
    print(':(')

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if a > 8 || b > 8:
 print(':(')
else:
 print('Yay!')

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if a > 8 || b > 8:
 print(':(")
else:
 print('Yay!')

Submission status: Runtime Error

Solution code:

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

cnt = 0

for a in A:
    while (a % 2 == 0):
        cnt = cnt + 1
        a = a / 2

print(cnt)

Submission status: Runtime Error

Solution code:
def sum_axis(input_list):
    x_sum, y_sum, z_sum = 0, 0, 0
    for i in input_list:
        x_sum += i[0]
        y_sum += i[1]
        z_sum += i[2]

    return x_sum, y_sum, z_sum

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

if M == 0:
    print(0)
    exit()

xyz = []
for i in range(N):
    xyz.append(list(map(int, input().split(' '))))

signs = [[1, 1, 1], [1, 1, -1], [1, -1, 1], [1, -1, -1],
        [-1, 1, 1], [-1, 1, -1], [-1, -1, 1], [-1, -1, -1]]
results = []

for sign in signs:
    sorted_list = sorted(xyz, key = lambda x: sign[0] * x[0] + sign[1] * x[1] + sign[2] * x[2])

    tmp = sum_axis(sorted_list[-M:])
    results.append(tmp[0] * sign[0] + tmp[1] * sign[1] + tmp[2] * sign[2])

print(max(results))

Submission status: Runtime Error

Solution code:
a,b=list(map(int,input().split()))
print('Yey!' if (a<=8&&b<=8) else ':(')

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
x = []
y = []
z = []
f = [[] for _ in range(8)]
for i in range(n):
    a = input()
    a = a.split(' ')
    a = list(map(int, a))
    xi = a[0]
    yi = a[1]
    zi = a[2]
    x.append(xi)
    y.append(yi)
    z.append(zi)
    fi = [0 for _ in range(8)]
    fi[0] = xi + yi + zi
    fi[1] = xi + yi - zi
    fi[2] = xi - yi + zi
    fi[3] = -xi + yi + zi
    fi[4] = xi - yi - zi
    fi[5] = -xi - yi + zi
    fi[6] = -xi + yi - zi
    fi[7] = -xi - yi - zi
    for j in range(8):
        f[j].append(fi[j])
def reversort(x):
    return list(reversed(sorted(x)))
f = list(map(reversort, f))
fmax = [0 for _ in range(8)]
for i in range(m):
    for j in range(8):
        fmax[j] += f[j][i]
print(max(fmax))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 23:09:00 2018

@author: sakas
"""
A = input()
B = input()
if A>=9 or B>=9:
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 23:09:00 2018

@author: sakas
"""
A = input()
B = input()
if A>9 or B>9:
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 23:09:00 2018

@author: sakas
"""
A,B = map(int(input()))

if A>9 or B>9:
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
n = int(input().rstrip())
a = [int(v) for v in input().rstrip().split()]

count = 0

for v in a:
    t = v
    while t % 2 == 0:
        t = t / 2
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
a=input()
b=input()
if a<=8&&b<=8:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
li = [list(map(int, input().split()))for i in range(n)]

a = 0
b = 0
c = 0
review = abs(a) + abs(b) + abs(c)
for i in range(m):
    a += li[i][0]
    b += li[i][1]
    c += li[i][2]

review = abs(a) + abs(b) + abs(c)
flag = True

while True:
    flag = True
    for i in range(m):
        for j in range(n-m):
            x = li[i]
            li[i] = li[m+j]
            li[m+j] = x
            a = 0
            b = 0
            c = 0
            for k in range(m):
                a += li[k][0]
                b += li[k][1]
                c += li[k][2]
            if review < abs(a) + abs(b) + abs(c):
                review = abs(a) + abs(b) + abs(c)
                flag = False
    if flag:
        break
    else:
        continue
print(review)

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
x = []
y = []
z = []
for i in range(n):
    a,b,c = map(int,input().split())
    x.append([a,b,c])
    y.append([-1*a,-1*b,-1*c])


max = 0
for i in range(2):
    for j in range(2):
        for k in range(2):
            list = []
            sum = 0
            for l in range(n):
                if i == 1:
                    tmp1 = x[l][0]
                else:
                    tmp1 = y[l][0]
                if j == 1:
                    tmp2 = x[l][1]
                else:
                    tmp2 = y[l][1]
                if k == 1:
                    tmp3 = x[l][2]
                else:
                    tmp3 = y[l][2]
                list.append(tmp1+tmp2+tmp3)
            list.sort()
            for t in list[n-m:]:
                sum += t
            if sum > max:
                max = sum
print(max)

Submission status: Runtime Error

Solution code:
import numpy as np

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

scores = []
for _ in range(N):
    scores.append(list(map(int, input().split())))

scores = np.array(scores)
signs = [-1, 1]
answer = 0
for sign_k in signs:
    kireisa = sign_k
    for sign_o in signs:
        oishisa = sign_o
        for sign_n in signs:
            ninki = sign_n

            kireisa_score = scores[:, 0] * kireisa
            oishisa_score = scores[:, 1] * oishisa
            ninki_score = scores[:, 2] * ninki

            sorted_score = np.stack((kireisa_score, oishisa_score, ninki_score), axis=1)
            sums = [sum(s) for s in sorted_score]

            sums.sort()
            sums.reverse()
            if sum(sums[:M]) > answer:
                answer = sum(sums[:M])

print(answer)

Submission status: Runtime Error

Solution code:
#coding:utf-8
import itertools
import numpy as np

N,M = map(int,input().split())
cakeList = [list(map(int,input().split())) for i in range(N)]
cakeList = np.array(cakeList)
numList = [i for i in range(N)]


maxv = 0
if M < N/2:
    combi = list(itertools.combinations(numList,M))
    for indexs in combi:
        cakes = [cakeList[i] for i in indexs]
        cakes = np.array(cakes)
        total = [abs(np.sum(cakes[:,i])) for i in range(3)]
        total = sum(total)
        maxv = max(total,maxv)
    print(maxv)


else:
    M = N - M
    combi = list(itertools.combinations(numList,M))
    BDP = [np.sum(cakeList[:,i]) for i in range(3)]
    for indexs in combi:
        cakes = [cakeList[i] for i in indexs]
        cakes = np.array(cakes)
        total = [abs(BDP[i] - np.sum(cakes[:,i])) for i in range(3)]
        total = sum(total)
        maxv = max(maxv,total)
    print(maxv)

Submission status: Runtime Error

Solution code:
N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)


if n_list != []:
    maxnum = max(n_list)
    maxnum = maxnum/2
    for num2 in n_list:
        for i in range(maxnum):
            if num2 % 2**(i+1) == 0:
                count+=1


print(count)

Submission status: Runtime Error

Solution code:
D, N = map(int,input().split())
if N != 100:
    print(N*100**D)
else:
    print(N*100**D + 1)
D, N = map(int,input().split())
if N != 100:
    print(N*100**D)
else:
    print((N+1)*100**D)

Submission status: Runtime Error

Solution code:
line = input().split()
a = line[0]
b = line[1]

if a > 8 or b > 8:
    print(':(')
else:
    print('Yay!')

Submission status: Runtime Error

Solution code:
from collections import deque

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

C = 0
while True:
    if len([n for n in A if n > 0 and n % 2 == 0]) == 0:
        break
    # 最大の偶数を探す
    odds3 = [n * 3 for n in A if n % 2 != 0]
    evens = sorted([n for n in A if n % 2 == 0])
    evens3 = [n * 3 for n in evens[:-1]]
    evens2 = [n // 2 for n in [evens[-1]]]
    A = odds3 + evens3 + evens2
    C += 1
print(C)

Submission status: Runtime Error

Solution code:
line = input().split()
a = line[0]
b = line[1]

if a > 8 or b > 8:
    return ':('
else:
    return 'Yay!'

Submission status: Runtime Error

Solution code:
i = int(input())
ii = input().split()

a = int(0)
n = int(0)
m = int(0)
k = int(0)
for n in ii:
    a = int(n)
    for m in range(i):
      while (a % 1 == 0):
        a = a/2
        if (a % 1 == 0):
            k += 1

print(k)

Submission status: Runtime Error

Solution code:
line = raw_input().split()
a = line[0]
b = line[1]

if a > 8 or b > 8:
    return ':('
else:
    return 'Yay!'

Submission status: Runtime Error

Solution code:
from collections import deque
N = int(input())
A = [int(i) for i in input().split()]

d = deque(A)
c = 0
while(len(d)>0):
    tmp = d.pop()
    if tmp%2==0:
        c+=1
        d.append(tmp//2)
print(c)

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
xs,ys,zs =[],[],[]
comps = []
for i in range(N):
    x,y,z = map(int,input().split())
    raw = [x+y+z,x+y-z,x-y+z,x-y-z,-x+y+z,-x+y-z,-x-y+z,-x-y-z,]
    comps.append(raw)

dp = [[[0]*8 for _ in range(M+1)] for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,M+1):
        for k in range(8):
            dp[i][j][k] = max(dp[i-1][j][k],dp[i-1][j-1][k]+comps[i-1][k] )
print(max(dp[N][M]))

Submission status: Runtime Error

Solution code:
A,B = map(int,input())
if A<9 and B<9:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

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

index, contents = [], []
X, Y, Z = [], [], []

while True:
    try:
        line = input()
    except EOFError:
        break
    contents.append(line)
N,M = map(int,contents[0].split())

for i in range(N):
    x, y, z = map(int,contents[i+1].split())
    X.append(abs(x))
    Y.append(abs(y))
    Z.append(abs(z))
    index.append(abs(x)+abs(y)+abs(z))

d = sorted(index, reverse=True)
print(sum(d[:M]))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
if A>9 or B>9:
  print ':('
else:
  print 'Yay!'

Submission status: Runtime Error

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

# スペース区切りの整数の入力
N = int(input())
an = list(map(int, input().split()))

sum_cnt = 0
for a in an:
    tmp = a
    cnt = 0
    while tmp % 2 == 0:
        cnt += 1
        tmp = tmp / 2

    sum_cnt += cnt

print(sum_cnt)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
if A>8 or b>8:
    print(":\(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
A,B = map(int, raw_input().split())
if((A <= 8) or (B <= 8)):
	print("Yay!")
else:
	print(":(")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
if int(A) <= 8 and int(B) <= 8:
    print('Yay!')
if 9 <= int(A) <=16 or 9 <= int(B) <= 16: 
    print(':(')

Submission status: Runtime Error

Solution code:
e=int(input())
s=int(input())
if(s>8 or e>8) and s+e>16:
	print(":(")
else:
	print("Yay!")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
if int(A) <= 8 and int(B) <= 8:
    print('Yay!')
else:
    print(':(')

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

if a > 8 or b > 8:
	print(':(')
else:
	print('Yey!')

Submission status: Runtime Error

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

if A > 8 or B > 8:
    print(':(')
else:
    print('Yay!')