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())
# = int(input())
# = input()
# = list(map(int, input().split()))

if a//10 == 0 and b //10 == 0:
	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:
    C = A * B
else:
    C = -1

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:
import sys
input = sys.stdin.readline

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

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:
#!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float('inf')
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:
#!/usr/bin/env python3
import sys
args = sys.argv
if len(args) == 2:
  from IPython import embed
  em = True
else:
  em = False
input = sys.stdin.readline
A, B = map(int, input().split())
if em: sys.stdin = open('/dev/tty')
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< min(a, b) and max(a, b) < 10:
    print(a*b)
else:
    print(-1)

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:
def solve():
    a,b = list(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:
#!/usr/bin/env python
import sys

a,b = [ int(x) for x in sys.stdin.readline().strip().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<=9 and b<=9:
    print(a*b)
else:
    print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- Coding: utf-8 -*-

import sys


input = sys.stdin.readline


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    A, B = map(int, input().split())

    ans = solve(A, B)

    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:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a, b = readmi()

if 9 >= a >= 1 and 9 >= b >= 1:
    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:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    a, b = LI()
    if a > 0 and a < 10 and b > 0 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<=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 1 <= A <= 9:
    if 1 <= B <= 9:
        print(A*B)
        exit()
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

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

Submission status: Accepted

Solution code:
a, b = [int(x) for x in 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:
import queue

"""
N = int(input())
#S = input()
# (N,M) = (int(i) for i in input().split(" "))
# A = [int(i) for i in input().split()]
A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
(N,M) = (int(i) for i in input().split(" "))
if N>=10 or M>=10:
	print(-1)
else:
	print(N*M)

Submission status: Accepted

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

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

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())
print(a*b if 0<a<10 and 0<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
# Your code here!

x,y = map(int,input().split())

if x > 9 or y > 9:
    print(-1)
else:
    print(x*y)

Submission status: Accepted

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

Submission status: Accepted

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

else:
    print(A * B)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


a, b = read_i()
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(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:
x,y = map(int,input().split())

if(x > 9 or y > 9):
    print(-1)
else:
    print(x*y)

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 = [int(i) for i in 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:
def main():
    A, B = map(int, input().split())
    if A <= 9 and B <= 9:
        print(A*B)
    else:
        print(-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# abc144/abc144_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    A,B=i2nn()
    if (A<10 and B<10):
        print(A*B)
    else:
        print(-1)
    return

main()

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 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:
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 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:
def main():
    A, B = map(int, input().split())

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

if __name__ == "__main__":
    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, raw_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())
print(a * b if (a >= 1 and a <= 9 and b >= 1 and 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 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 = -1
if 1 <= a <= 9:
    if 1 <= b <= 9:
        ans = a*b
        
print(ans)

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:
from bisect import bisect_left,bisect_right
import sys
def input(): return sys.stdin.readline().strip()

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

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:
#!/usr/bin/python3

import array
import math
import os
import sys


def main():
    A, B = read_ints()
    print(A * B if A <= 9 and B <= 9 else -1)


###############################################################################
# AUXILIARY FUNCTIONS

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

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:
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)

def main():
    a, b = map(int, input().strip().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 >=10:
    print("-1")
elif b >= 10:
    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().strip().split())

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

Submission status: Accepted

Solution code:
# coding:utf-8

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

result = A * B

if A > 9 or A < 1 or B > 9 or B < 1:
    result = -1
    
print(result)

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B] = string_to_int(inputs[0])
    if A >= 10 or B >= 10:
        return -1
    return A * B


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

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

Submission status: Accepted

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


def main():
    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__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve():
  A, B = map(int, input().split())
  return A * B if A in range(1, 10) and B in range(1, 10) else -1

print(solve())

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

Submission status: Accepted

Solution code:
def resolve():

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

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

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 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:
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

# debug = True
debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    A, B = LI()
    if A > 9:
        print(-1)
        return
    if B > 9:
        print(-1)
        return
    print(A*B)

solve()

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:
import sys
input = sys.stdin.readline

def main():
    A, B = [int(x) for x in input().split()]
    if A >= 10 or B >=10:
        print(-1)
        exit()

    print(A * B)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


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

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


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    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:
if __name__ == '__main__':
    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:
import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs= sys.stdin.buffer.readlines
#rstrip().decode('utf-8')

#import math
#import numpy as np
#import operator
#from heapq import heapify,heappop,heappush
#from math import gcd
#from fractions import gcd
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from itertools import accumulate
#from itertools import groupby
#from itertools import permutations
#from itertools import combinations
#from scipy.sparse import csr_matrix
#from scipy.sparse.csgraph import floyd_warshall
#from scipy.sparse.csgraph import csgraph_from_dense
#from scipy.sparse.csgraph import dijkstra
#sys.setrecursionlimit(10**7)

#map(int,input().split())

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




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:
def test():
    a,b = map(int,input().split())
    if a >= 10 or b >= 10:
        print("-1")
    else:
        print(a*b)


if __name__ == "__main__":
    test()

Submission status: Accepted

Solution code:
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())
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:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


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

def main():
    A, B = read_int_n()
    print(slv(A, B))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

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:
import sys
a, b = [int(i) for i in sys.stdin.readline().split()]
if a > 9 or a <= 0 or b > 9 or b <= 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:
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())
result = A*B

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    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__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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 > 9 or B > 9 or A < 0 or B < 0:
  print(-1)
else:
  print(A*B)

Submission status: Accepted

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

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

print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

A, B = [int(x) for x in 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)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:

N, M=(int(i) for i in input().split())

if N<=9:
    if M<=9:
        print(N*M)
    else:
        print(-1)
else:
    print(-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:
import sys
#input = sys.stdin.readline
sys.setrecursionlimit(10**7)
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>=10 or b>=10:
    print(-1)
else:
    print(a*b)

Submission status: Accepted

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

Submission status: Accepted

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

if not(a<=9) or not(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 = list(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:
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:
import sys
import math
input = sys.stdin.readline

A, B = (int(i) for i in input().split())
# = [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 or b >= 10: print(-1)
else: print(a * b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



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


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