101440: [AtCoder]ABC144 A - 9x9

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

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

Input

题意翻译

### 题目描述 高橋君刚学习了九九乘法口诀表,他迫不及待的来考你了。 输入$ 2 $ 个正整数 $ A $, $ B $ 如果它们在 $1$ 到 $9$ 之间,输出它们的积。否则,输出 $-1$。 ### 输入格式 按以下格式输入。 > $ A $ $ B $ ### 输出格式 如果 $ 1\ \leq\ A, B\leq\ 9 $ ,输出它们的积,否则,输出 $-1$ 。 ## 提示 - $ 1\ \leq\ A\ \leq\ 20 $ - $ 1\ \leq\ B\ \leq\ 20 $ - $A,B$ 皆为自然数。 ### 样例说明 1 $ 2\ \times\ 5 $ 等于 $ 10 $ 且它们小于 $9$ ,所以,输出 $10$ 。 ### 样例说明 2 $ 5\times\ 10 $ 等于 $ 50 $ 但是 $10$ 大于 $9$ ,所以输出 $-1$ 。 感谢@[Mr__AC](https://www.luogu.com.cn/user/762010) 提供的题目翻译。

加入题单

算法标签: