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 = 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:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

A, B = mapint()
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())
print(a*b if a <10 and b<10 else -1)

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:
a, b = map(int, input().split())
if len(str(a)) == 1 and len(str(b)) == 1:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

Solution code:
# 144 A

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:
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:
a1=input()
a2=[i for i in a1.split()]
x,y=float(a2[0]),float(a2[1])
v,v1=x.is_integer(),y.is_integer()
if 1<=x<=20 and 1<=y<=20 and v==v1==True:
    if 1<=x<=9 and 1<=y<=9:
        print(int(x*y))
    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 = (int(x) for x in 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>9 or B>9:
  print(-1)
  exit()
print(A*B)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if a<=9 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:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = list(input().split())
    if len(n[0]) == 1 and len(n[1]) == 1:
        print(int(n[0])*int(n[1]))
    else:
        print(-1)
    
if __name__ == '__main__':
    main()

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 and B<=9:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math

(A, B) = [int(n) for n in input().split()]

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
A = [int(s) for s in input().split()]
print(A[0] * A[1] if sum(map(lambda x: 1 <= x <= 9, A)) == 2 else -1)

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:
a, b = list(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<10 and b<10:
  print(a*b)
else:
  print(-1)

Submission status: Accepted

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

if len(a) == 1 and len(b) == 1:
  print(int(a)*int(b))
else:
  print(-1)

Submission status: Accepted

Solution code:
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=mi()
ans=1
for i in a:
  if 1<=i<=9:
    ans*=i
  else:
    print(-1)
    sys.exit()
print(ans)

Submission status: Accepted

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

if __name__ == '__main__':
    solve()

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())

ok = 1 <= A <= 9
ok = ok and (1 <= B <= 9)

print(A * B if ok else -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 <= 9 and 1 <= 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 >= 10 or b >= 10:
    print(-1)
    exit()
else:
    print(a*b)

Submission status: Accepted

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys
#import sympy
sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    #頂点が探索済みかどうかのチェック配列
    check=[False for _ in range(n)]
    check[s]=True
    #次見る頂点を格納するキュー
    queue=deque([s])
    visited_num=1

    #問題固有の配列
    #color_check=[[True for _ in range(l)] for _ in range(n)]
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        #グラフが全連結ではない場合
        if len(queue)==0:
            #空配列を返す
            #現状までの計算済み配列を返してもいいと思う
            return color

        now_vertex=queue.popleft()
        #インデックスがない場合は
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            #問題固有の計算
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color

#n=int(input())z
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))



#n=int(input())
n,m=input_list()
#a=input_list()
if n>9 or m>9:
    print(-1)
    exit()

print(n*m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if 0<a<10:
    if 0<b<10:
        print(a*b)
        exit()
        
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:
#!/usr/bin/env python3

def main():
    A, B = map(int, input().split())
    if A>9 or B>9:
        ans=-1
    else:
        ans=A*B
    print(ans)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A,B = (int(a) for a 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())
print("{}".format(A*B if (A < 10 and B < 10) else -1))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
from collections import defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b = readInts()
if 1 <= a <= 9 and 1 <= b <= 9:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys

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

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = A*B
if A > 9 or B > 9:
  ans = -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:
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
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:
a,b = input().split()
if len(a) >= 2 or len(b) >= 2: print(-1)
else: print(int(a)*int(b))

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b=mi()

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

Submission status: Accepted

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

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 max(a,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:
A,B = input().split()
A = int(A)
B = int(B)
if(A < 10):
  if(B < 10):
    print(A*B)
  else:
    print(-1)
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())
print(a*b if a<10 and b<10 else -1)

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 = 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 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:
  print(-1)
elif b > 9:
  print(-1)
else:
  print(a*b)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
print(a*b if a>=1 and a<=9 and 0<b<10 else -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 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(str, input().split())
print(int(a)*int(b) if len(a)==len(b)==1 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:
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 > 9 or b > 9:
    print(-1)
else:
    print(a*b)

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 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 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<10  and b<10:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(a * b if 1 <= a <= 9 and 1 <= b <= 9 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>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());print(a*b if a<10 and b<10 else -1)

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())

if A // 10 == 0 and B // 10 == 0:
  print(A * B)
else:
  print(-1)
# 2 5
#5 10
#9 9

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:
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限

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 >= 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())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
A - 9x9
https://atcoder.jp/contests/abc144/tasks/abc144_a

"""
import sys


def solve(A, B):
    if 1 <= A <= 9 and 1 <= B <= 9:
        return A * B
    return -1


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

ans = a * b
if a > 9 or b > 9: ans = -1

print(ans)

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 or B >= 10:
    print(-1)
else:
    print(A * B)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if max(a,b) < 10:
    print(a*b)
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())
aa = a if a < 10 else 0
bb = b if b < 10 else 0

print(-1 if aa*bb == 0 else aa*bb)

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 <= 9) and (1 <= b <= 9):
  	print(a * b)
else:
  	print('-1')

Submission status: Accepted

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

if (len(str(a)) == 1 and len(str(b)) ==1):
    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())

print(-1 if A > 9 or B > 9 else A*B)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if max(a,b)<=9 and min(a,b)>=1:
    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(str,input().split())
if len(a)==1 and len(b)==1:
  print(int(a)*int(b))
else:
  print(-1)

Submission status: Accepted

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

ans = A*B

if A > 9 or B > 9:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
a,b=list(map(int, input().split()))
if 9>=a>=1 and 9>=b>=1:
    # aとbの積を表示
    print(a*b)
else:
    # 9×9を計算できないので-1を表示
    print(-1)

Submission status: Accepted

Solution code:
a,b = (int(x) for x in 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 1 <= A <= 9 and 1 <= B <= 9:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

Solution code:
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    a, b = map(int, input().split())
    if a >= 10 or b >= 10:
        print(-1)
        return
    print(a*b)
    
    
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=list(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 or b >= 10):
    print(-1)
    exit()
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:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
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:
import sys
sys.setrecursionlimit(10**6)

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 a <= 9 and b <= 9:
  print(a * b)
else:
  print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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()

if len(a) * len(b) == 1:
  print(int(a)*int(b))
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

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, b = map(int, input().split())
ans = -1
if a < 10 and b < 10:
    ans = a * b
print(ans)

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 < 10 and b < 10:
    print(a * b)
else:
    print('-1')

Submission status: Accepted

Solution code:
A,B = map(int,input().strip().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>=10 or b>=10:
  print(-1)
else:
  print(a*b)

Submission status: Accepted

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

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())

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 <= 9 and 1 <= B <= 9:
    print(A*B)
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, raw_input().split(' '))
res = a * b * (1 if a < 10 and b < 10 else 0)
print res if res else -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==0 or A>=10 or B==0 or B>=10:
  print(-1)
else:
  print(A*B)

Submission status: Accepted

Solution code:
ab=list(map(int,input().split()))
a=ab[0]
b=ab[1]
if a<10 and b<10:
    print(a*b)
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 = list(map(int,input().split()))

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

    print(a*b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


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

    if 1 <= A and A <= 9 and 1 <= B and 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 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 A <= 9 and B <= 9:
  print(A*B)
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def kuku(a, b):

    return a*b if max(a, b) < 10 else -1
def main():
    a, b = map(int, input().split())
    print(kuku(a, b))

if __name__ == '__main__':
    main()

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 and A <= 9 and B >= 1 and B <= 9:
    print(str(A * B))
else:
    print('-1')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
print(A*B) if A < 10 and B < 10 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())
print(a*b if 1<=a<=9 and 1<=b<=9 else -1)

Submission status: Accepted

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    A, B = map(int, readline().split())
    if (A <= 9) & (B <= 9):
        print(A * B)
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if N[0] > N[1]:
  if N[0] > 9:
    print(-1)
  else:
    print(N[0]*N[1])
else:
  if N[1] > 9:
    print(-1)
  else:
    print(N[0]*N[1])

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
if A // 10 > 0 or B // 10 > 0:
    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:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    a, b = map(int, input().split())

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


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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 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 a>9 or b>9:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

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