Problem:


Score : 100 points

Problem Statement

Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.

Given are two integers A and B.

If Takahashi can calculate A \times B, print the result; if he cannot, print -1 instead.

Constraints

1 \leq A \leq 20

1 \leq B \leq 20

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

If Takahashi can calculate A \times B, print the result; if he cannot, print -1.

Sample Input 1

2 5

Sample Output 1

10

2 \times 5 = 10.

Sample Input 2

5 10

Sample Output 2

-1

5\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.

Sample Input 3

9 9

Sample Output 3

81



Sample input:
2 5


Sample output:
10

Submission status: Accepted

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

if a > 9 or b > 9:
    print(-1)
else :
    print(a * b)

Submission status: Accepted

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

if A < 10 and B < 10 :
    print(A*B)
else :
    print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if 1<=a<10 and 1<=b<10:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

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

if 0 <= a <= 9 and 0 <= b <= 9:
    ans = a * b
else:
    ans = -1

print(ans)

Submission status: Accepted

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


if (a in range(10) and (b in range(10))):
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(-1 if a > 9 or b > 9 else a * b)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if(a>9 or b>9):
    print(-1)
else:
    print(a*b)

Submission status: Accepted

Solution code:
import sys
read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
readlines=sys.stdin.buffer.readlines

A,B=map(int,read().split())

answer=A*B if A<10 and B<10 else -1
print(answer)

Submission status: Accepted

Solution code:
num=list(map(int,input().split()))
#print(num)
ans=0
for i in num:
  if not 0<i<10:
    ans=-1
if ans==-1:
  print(ans)
else:
  print(num[0]*num[1])

Submission status: Accepted

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


if a//10!=0:
    print(-1)

elif b//10!=0:
    print(-1)

else:
    print(a*b)

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
if A >= 10 or B >= 10:
    print(-1)
else:
    print(A * B)

Submission status: Accepted

Solution code:
def is_valid_input(num: int) -> bool:
    return 1 <= num <= 9


ab = list(map(int, input().split()))
A = ab[0]
B = ab[1]

if is_valid_input(A) and is_valid_input(B):
    print(A * B)
else:
    print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8

a, b = map(int, input().split())
if not 0 <= a <= 9 or not 0 <= b <= 9:
  print("-1")
else:
  c = a * b
  print(c)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if 0<A and A<10 and 0<B and B<10:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

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


def main():
    a, b = input_line(int, int)
    if a > 9 or b > 9:
        print(-1)
    else:
        print(a * b)


def input_line(*types):
    if len(types) == 1:
        return types[0](input())
    else:
        return [t(x) for t, x in zip(types, input().split())]


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
if A>9 or B>9:
        print(-1)
else:
        print(A*B)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a<10  and  b<10:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if A>9 or B>9:
  print('-1')
else:
  print(A*B)

Submission status: Accepted

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

if a <= 9 and b <= 9:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

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

if (1 <= A <= 9) and (1 <= B <= 9):
    print(A * B)
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b =(int(x) for x in input().split())
if int(a/10)==0 and int(b/10) == 0:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

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

if 1 <= A and 9 >= A and 1 <= B and 9 >= B:
    print(A*B)
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys

A, B = map(int, sys.stdin.read().split())

result = A * B if 1 <= A and A <= 9 and 1 <= B and B <= 9 else -1
print(result)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(a * b if max(a, b) <= 9 else -1)

Submission status: Accepted

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

if A >= 10 or B >= 10:
    print(-1)
else:
    print(A*B)

Submission status: Accepted

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

if A>=10 or  B>=10:
  print(-1)
else:
  print(A*B)

Submission status: Accepted

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

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

if (a < 10) and (b < 10):
    print(a*b)
else:
    print(-1)

Submission status: Accepted

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

if max(A, B) <= 9:
    print(A * B)
else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
if A<10 and B<10:
	C = int(A*B)
else:
  	 C = -1
print(C)

Submission status: Accepted

Solution code:
#ABC144:  A - 9x9

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

print(A * B if A < 10 and B < 10 else -1)

Submission status: Accepted

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

if (a <= 9 and b <= 9):
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
#coding:utf-8
a, b = map(int, input().split())

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

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

ch = 1

if(a>=10):
    ch = 0
if(b>=10):
    ch  = 0
    
if(ch==0):
    print(-1)
else:
    print(a*b)

Submission status: Accepted

Solution code:
A,B = [int(i) for i in input().split()]
if A < 10 and B < 10:
    print(A*B)
else:
    print(-1)

Submission status: Accepted

Solution code:
def p_a():
    A, B = map(int, input().split())
    print(A * B if A < 10 and B < 10 else -1)


def p_b():
    pass


def p_c():
    pass


def p_d():
    pass


def p_e():
    pass


def p_f():
    pass


if __name__ == '__main__':
    p_a()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a < 10 and b <10:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

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

if A>0 and A<10 and B>0 and B<10:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

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

checked = [1, 2, 3, 4, 5, 6, 7, 8, 9]

if a not in checked or b not in checked:
    print("-1")
else:
    print(str(a*b))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if 1<=a<=9 and 1<=b<=9:
    print(a*b)
else :
    print(-1)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
#入力
a = list(map(int,input().split()))

if (a[0]<=9 and a[1]<=9):
	print(a[0]*a[1])
else:
	print("-1")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if x>=10 or y>=10:
  print(-1)
else:
  print(x*y)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if 1<=A<=9:
        if 1<=B<=9:
            print(A*B)
        else:
            print(-1)
else: print(-1)

Submission status: Accepted

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

MOD = 10 ** 9 + 7

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

if 1<= a <= 9 and 1 <= b <= 9:
    print(a * b)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = a * b
if max(a, b) >= 10:
    ans = -1
print(ans)

Submission status: Accepted

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

if A>=10 or B>=10:
 print("-1")
else:
 print(A*B)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if 1 <= a <= 9 and 1 <= b <= 9:
  print(a * b)
else:
  print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if 10<=a or 10<=b:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if A > 9 or B > 9:
  print(-1)
else:
  print(A*B)

Submission status: Accepted

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

if a < 10 and b < 10:
    print(str(int(a*b)))
else:
    print('-1')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if A > 9 or B > 9:
  print (-1)
else:
  print(A*B)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if a >= 1 and a <= 9 and b >= 1 and b <= 9:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque
import re
import math
import functools

def s_raw():
    return input().rstrip("\r")

def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return list(map(int, ss_raw()))


INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


def gcd(a, b):
    if(b == 0):
        return a
    return gcd(b, a % b)


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    
def ZAlgo(s):
    l = len(s)
    A = [0]*l
    i =1
    j =0
    A[0]=l
    while i<l:
        while i+j<l and s[j] == s[i+j]:
            j+=1
        if j==0:
            i+=1
            continue
        A[i]=j
        k=1
        while (i+k<l) and (k+A[k]<j):
            A[i+k] =A[k]
            k+=1
        i+=k
        j-=k
    return A


def main():
    A,B = ints_raw()
    if A>0 and A<10 and B>0 and B<10:
        return A*B
    else:
        return -1


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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(-1 if a > 9 or b > 9 else a * b)

Submission status: Accepted

Solution code:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    a, b = list(map(int, input().rstrip('\n').split()))
    if a <= 9 and b <= 9:
        print(a * b)
    else:
        print(-1)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

a = int(a)
b = int(b)

if a < 10 and b < 10:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = a * b if a < 10 and b < 10 else -1
print(ans)

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
A=a[0]
B=a[1]

if 1<=A<=9 and 1<=B<=9:
    print(A*B)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
result = a * b if 1 <= a <= 9 and 1 <= b <= 9 else -1
print(result)

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
if (1<=i[0]<=9 and 1<=i[1]<=9):
    print(i[0]*i[1])
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(a * b if a <= 9 and b <= 9 else -1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
if 0<a<10 and 0<b<10:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

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

if (a > 9) or (b > 9):
  print(-1)
  
else:
  print('{}'.format(a*b))

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    ans = A * B if (0 < A < 10) and (0 < B < 10) else -1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

if 1<= a <=9 and 1<= b <= 9:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

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

if (A <= 9 and B <= 9):
    print(A*B)

else:
    print(-1)

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
if a[0] < 10 and a[1] < 10:
  print(a[0]*a[1])
else:
  print(-1)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
if (A<=9) & (B<=9):
  print(A*B)
else:
  print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split(" "))
if a >= 10 or b >= 10:
  print(-1)
else:
  print(a * b)

Submission status: Accepted

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

if 9 < a or 9 < b:
  print(-1)
else:
  print(a * b)

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

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

A, B = list(map(int, sys.stdin.readline().split()))
if A < 10 and B < 10:
    print(A * B)
else:
    print(-1)

Submission status: Accepted

Solution code:
input = input()
a,b = input.split(" ")
a = int(a)
b = int(b)
if a > 9 or b > 9:
    print('-1')
else:
    print(a*b)

Submission status: Accepted

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

if a > 9 or b > 9:
  print(-1)
else:
  print(a * b)

Submission status: Accepted

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

if a<10 and b<10:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
n, m = tuple([int(i) for i in input().split(" ")])
print(n * m * int(n < 10 and m < 10) - int(not(n < 10 and m < 10)))

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
if(x<1 or x>9 or y<1 or y>9):
  print("-1")
else:
  print(x*y)

Submission status: Accepted

Solution code:
s = input().split() #s_1 s_2を分割して取得し、sに値を入れる


if  0 < int(s[0]) < 10 and 0 < int(s[1]) < 10:
    i = int(s[0]) * int(s[1])   
    print(i)
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
if a < 10 and b < 10:
  print(a * b)
else:
  print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a>9 or b>9:
  print(-1)
else:
  print(a*b)

Submission status: Accepted

Solution code:
s = input()
l = [int(x) for x in s.split(' ')]
a, b = l
if ((a <= 9) and (b <= 9)): print(a*b)
else: print(-1)

Submission status: Accepted

Solution code:
aa, bb = input().split()
if int(aa)<10 and int(bb)<10 :
  print(int(aa)*int(bb))
else:
  print("-1")

Submission status: Accepted

Solution code:
lst = list(map(int, input().split()))
if lst[0] >= 10 or lst[1] >= 10:
    print('-1')
else:
    num = lst[0] * lst[1]
    print(num)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
print(a*b) if(a<=9 and b<=9) else print(-1)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if 1 <= A <= 9 and 1 <= B <= 9:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

Solution code:
inp = input().split(" ")
if len(inp[0]) == 1 and len(inp[1]) == 1:
  print(int(inp[0]) * int(inp[1]))
else:
  print(-1)

Submission status: Accepted

Solution code:
a,b=[int(_) for _ in input().split()]
if a<10 and b<10:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a > 9 or b > 9:
 	print (-1)
else:
  	print(a * b)

Submission status: Accepted

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

if (a >= 1 and a <= 9) and (b >= 1 and b <= 9):
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = a*b if a<=9 and b<=9 else -1
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a <= 9 and b <= 9:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
data = input().split()
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(str(A * B))
else:
  print('-1')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())

if a <= 9 and b <= 9:
  print(a * b)
else:
  print(-1)

Submission status: Accepted

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

if A <= 0 or 9 < A or B <= 0 or 9 < B:
    print(-1)
    exit()

print(A*B)

Submission status: Accepted

Solution code:
n,m = list(map(int,input().split()))
if 0 < n < 10 and 0 < m < 10 :
  print(n*m)
else :
  print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
cal = A * B
if A > 9 or B > 9:
    print(-1)
else:
    print(cal)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a>=1 and a<=9 and b>=1 and b<=9:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
print("{}".format(A*B if (1 <= A <= 9 and 1 <= B <= 9) else -1))

Submission status: Accepted

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

if(a<10 and b<10):

  c=a*b
  
else:

 c=-1
 
print (c)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if 1 <= A <= 9 and 1 <= B <= 9:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

Solution code:
line = input().split()
A = int(line[0])
B = int(line[1])

if A <= 9 and B <= 9:
    print(A * B)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a <= 9 and b <= 9:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if 1 <= A <= 9 and 1 <= B <= 9:
    print(A*B)
else:
     print (-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = a*b if 1 <= a <= 9 and 1 <= b <= 9 else -1
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if max(a, b) > 9:
    print(-1)
else:
    print(a * b)

Submission status: Accepted

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

if(A<=9 and B<=9):
    print(A*B)
else:
    print(-1)

Submission status: Accepted

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

    if A < 10 and B < 10:
        print(A * B)
    else:
        print(-1)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
str = input()
data = str.split()
n1 = int(data[0])
n2 = int(data[1])
if (n1 >9 or n2 > 9):
    print(-1)
else:
    print(n1*n2)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc144/tasks/abc144_a
A, B = list(map(int,input().split()))
if 1 <= A <= 9 and 1 <= B <= 9:
    print(A*B)
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b =  list(map(int, input().split()))
if a/10<1 and b/10<1:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

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

if max(A,B)<=9:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

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

if A <= 9 and B <=9:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if 0 < A < 10 and 0 < B < 10:
    print(A * B)
else:
    print(-1)

Submission status: Accepted

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

if max(a,b) <= 9:
  print(a * b)
else:
  print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
------------------------
author : iiou16
time : 11/01/12:09
------------------------
'''


def main():
    A, B = list(map(int, input().split()))
    if A < 10 and B < 10:
        print(A * B)
    else:
        print("-1")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if a <= 0 or b <= 0:
    print(-1)
elif a >= 10 or b >= 10:
    print(-1)
else:
    print(a * b)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if 1 <= a <= 9 and 1 <= b <= 9:
  print(a * b)
else:
  print(-1)

Submission status: Accepted

Solution code:
a,b = list(map(int, input().strip().split()))
if a <= 9 and b <= 9:
	print(a*b)
else:
	print(-1)

Submission status: Accepted

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

result = -1
if num[0] >= 1 and num[0] <= 9 and num[1] >= 1 and num[1] <= 9:
	result = num[0] * num[1]

print(result)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a>9:
    print(-1)
elif b>9:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a<10 and b<10:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a < 10 and b < 10:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
# 2019/10/31
# AtCoder Beginner Contest 144 - A
 
# Input
a, b = map(int,input().split())
 
# Calc
if a > 9 or b > 9:
    ans = -1
else:
    ans = a * b
 
# Output
print(ans)

Submission status: Accepted

Solution code:
def main():    
    a, b = map(int, input().split())
    ans = -1

    if (a < 10) and (b < 10):
        ans = a * b

    print(ans) 

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
input = [int(i) for i in input().split()]
for i in input:
  if i > 9 or i < 1:
    print(-1)
    quit()
print(input[0] * input[1])

Submission status: Accepted

Solution code:
n = [int(i) for i in input().split(" ")]
if max(n) < 10:
  print(n[0] * n[1])
else:
  print(-1)

Submission status: Accepted

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

def solve():
    A, B = list(map(int, input().split()))

    if 1 <= A <= 9 and 1 <= B <= 9:
        print(A*B)
    else:
        print(-1)

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if A<=9 and A>=1 and B<=9 and B>=1:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

Solution code:
str = input()
A_str , B_str = str.split()

A = int(A_str)
B = int(B_str)

if A < 10 and B < 10 :
    print(A * B)
else :
    print (-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if 0<a<=9 and 0<b<=9:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    A,B=map(int,input().split())
    if A<10 and B<10:
        print(A*B)
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    a,b = map(int, input().split(' '))
    print(a*b if a < 10 and b < 10 else -1)
    pass

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(A*B if A < 10 and B < 10 else -1)

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
if a > 9 or b > 9:
  print('-1')
else:
  print(a * b)

Submission status: Accepted

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

#print(str(a)+','+ str(b))

if a >= 10 or b >= 10:
	c = -1
	print(c)
	
else:
	c = a * b
	print(c)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
print(a*b if a<10 and b< 10 else -1)

Submission status: Accepted

Solution code:
#20:17
a,b = map(int,input().split())
if 0 < a < 10 and 0 < b < 10:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
if A > 9 or B > 9:
    print(-1)
else:
    print(A*B)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if 1 <= A and A <=9 and 1 <= B and B <=9 :
    print(A*B)
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if max(a,b) <= 9:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if A<10 and B<10:
    print(A*B)
else:
    print(-1)

Submission status: Accepted

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

if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
if i[0] >9 or i[0] < 1:
	print("-1")
elif i[1] >9 or i[1] < 1:
	print("-1")
else:
	print(i[0]*i[1])

Submission status: Accepted

Solution code:
ab = input().split(" ")
a = int(ab[0])
b = int(ab[1])


def check(a,b):
	if (a>9 or b>9):
		return -1
	else:
		return a*b
ans = check(a,b)
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a>9 or a<1 or b>9 or b<1:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
if A > 9 or B > 9:
  ans = -1
else:
  ans = A * B

print(ans)

Submission status: Accepted

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

if max(A,B) > 9:
  print(-1)
else:
  print(A*B)

Submission status: Accepted

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

if  data[0]<= 9 and data[1] <= 9:
    print(data[0]*data[1])
else:
    print("-1")

Submission status: Accepted

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

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

Solution code:
def solve(string):
    a, b = map(int, string.split())
    return str(a * b if 1 <= a <= 9 and 1 <= b <= 9 else -1)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

Solution code:
def kakezan():
    if (1 <= a <= 9) and (1 <= b <= 9):
        return a * b
    else:
        return -1

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

print(kakezan())

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a <= 0 or a >= 10:
    print("-1")
elif b <= 0 or b >= 10:
    print("-1")
else:
    print("{}".format(a*b))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if 1 > a or a > 20:
    raise ValueError("invalid number")
    
if 1 > b or b > 20:
    raise ValueError("invalid number")

if a <= 0 or a >= 10:
    print("-1")
elif b <= 0 or b >= 10:
    print("-1")
else:
    print("{}".format(a*b))

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
if a // 10 + b // 10 == 0:
  print(a*b)
else:
  print("-1")

Submission status: Accepted

Solution code:
A = [int(x) for x in input().split()]
a=A[0]
b=A[1]
if a>9 or b>9:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if (a >= 10) or (b >=10):
  print(-1)
else:
  print(a*b)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if 1 <= A <= 9 and 1 <= B <= 9:
	print(A*B)
else:
	print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if a <= 9 and b <= 9:
    print(a*b)
else:
    print("-1")

Submission status: Accepted

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

if (1 <= a <= 9 and 1 <= b <= 9):
    print(a * b)
else:
    print("-1")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)

Submission status: Accepted

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

if 1 <= a and a <= 9 and 1 <= b and b <= 9:
  print(a * b)
else:
  print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if (a <= 9) and (b <= 9):
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
import math

A,B=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

if A>0 and A<10 and B>0 and B<10:
    print(A*B)
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(a*b if (0<a<10) & (0<b<10) else -1)

Submission status: Accepted

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

if a < 10 and b <10:
    print(a * b)
else:
    print("-1")

Submission status: Accepted

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

if (a < 1 or a > 9) or (b < 1 or b > 9):
  print(-1)
else:
  print(a*b)

Submission status: Accepted

Solution code:
def main():
    a,b = [int(i) for i in input().split()]
    if 0 < a < 10 and 0 < b < 10:
        ans = a * b
        print(str(ans))
    else:
        print("-1")
        return -1


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = [int(e) for e in input().split(" ")]
print(n[0] * n[1] if (0 < n[0] < 10 and 0 < n[1] < 10) else -1)

Submission status: Accepted

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

if(9>=A>=1 and 9>=B>=1):
  sum = A*B
  print(sum)
else:
  print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a>9 or b>9:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

Solution code:
s = [int(a) for a in input().split(" ")]
print(s[0] * s[1] if s[0] < 10 and s[1] < 10 else -1)

Submission status: Accepted

Solution code:
import sys

# lines = sys.stdin.readlines()
line = input()
s = line.split(" ")
a = int(s[0])
b = int(s[1])

if(a < 10 and b < 10):
    print(a * b)
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a<10 and b<10:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
string = input()
 
v = string.split(" ")
 
if not len(v) == 2:
  print(-1)
 
a = int(v[0])
b = int(v[1])
 
if 0 < a < 10 and 0 < b < 10:
   print(a * b)
else: 
    print(-1)

Submission status: Accepted

Solution code:
a,b = list(map(int, input().split()))
if a >9 or b >9:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

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

def calc(x, y):
    if x < 0:
        return -1
    if x > 9:
        return -1
    if y < 0:
        return -1
    if y > 9:
        return -1
    return x * y

print(calc(a, b))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())


a,b=LI()

if a >= 1 and b >= 1 and a <= 9 and b <= 9:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
if a < 10 and b < 10:
	print(a*b)
else:
	print(-1)

Submission status: Accepted

Solution code:
import sys
 
input = sys.stdin.readline().split()
result = 1
for n in input:
  n=int(n)
  if result==-1:
    break
  if n<10:
    result = result * n
  else:
    result=-1
print(result)

Submission status: Accepted

Solution code:
data=input().split()
sum=0

for i  in data:
  if int(i)>=10:
    sum+=1
if sum==0:
  print(int(data[0])*int(data[1]))
else:
  print("-1")

Submission status: Accepted

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

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a * b)