

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 100 点
問題文
高橋君は九九を覚えたので、1 以上 9 以下の 2 つの整数の積を計算することができます。それ以外の計算はできません。
2 つの整数 A, B が与えられます。
高橋君が A \times B を計算できるならその結果を、できないなら代わりに -1
を出力してください。
制約
- 1 \leq A \leq 20
- 1 \leq B \leq 20
- 入力中のすべての値は整数である。
入力
入力は以下の形式で標準入力から与えられる。
A B
出力
高橋君が A \times B を計算できるならその結果を、できないなら -1
を出力せよ。
入力例 1
2 5
出力例 1
10
2 \times 5 は 10 です。
入力例 2
5 10
出力例 2
-1
5\times 10 は 50 ですが、高橋君には計算できないので、かわりに -1
を出力します。
入力例 3
9 9
出力例 3
81
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