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: Runtime Error

Solution code:
a, b = map(int, input().split())
if a and b = 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9:
  print(a * b)
else:
  print('-1')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if a[0]>=10 or a[1]>=10:
  return -1
elif:
  return a[0]*a[1]

Submission status: Runtime Error

Solution code:
n = int(input())

for i in range(1, 10):
    if n % i == 0 and n / i < 10:
        print('Yes')
        break

else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
line = [int(i) for i in input.split()]
v1 = line[0]
v2 = line[1]

if 0 < v1 and v1 < 10 and 0 < v2 and v2 < 10 :
  print(v1*v2)
else:
  print(str(-1))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

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

Submission status: Runtime Error

Solution code:
import fractions

input = sys.stdin.readline

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

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

Submission status: Runtime Error

Solution code:
a, b = input().split()
a= int(a)
b = int(b)
if not len(a) <2;
 if not len(b) < 2;
  print(a*b)
else:
  print("-1")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
/*
 * @author Dhruvit
 */
#include<cstring>
#include<math.h>
#include<stdlib.h>
#include <fstream>
#include<algorithm>
#include<vector>
using namespace std;
#define fast ios::sync_with_stdio(false); cin.tie(0);cout.tie(0);
#include<bits/stdc++.h>
#define vi          vector<int>
#define vii         vector<vector<int>>
#define pii         pair<int,int>
#define pb          push_back
#define pf          push_front
#define all(v)      v.begin(),v.end()
class A9x9 {
public:
	void solve(std::istream& in, std::ostream& out) {
	    int a,b;
	    in>>a>>b;
	    if(a%10 ==0 || b%10 == 0){
	        out<<"-1";
	    }else{
	        out<<a*b;
	    }

	}
};


signed main() {
    fast;
	A9x9 solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

Submission status: Runtime Error

Solution code:
a, b = input().split()
a= int(a)
b = int(b)
if not len(a) ==2;
 if not len(b) == 2;
  print(a*b)
else:
  print("-1")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
_ = input().split(" ")
if 0<_[0]<10 and 0<_[1]<10:
  print(_[0]*_[1])
else:
  print(-1)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    A,B=mis()
    print(A*b if 0<A<10 and 0<B<10 else '-1')


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
import pandas as pd


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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections
import numpy as np

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    A,B=mis
    print(A*b if 0<A<10 and 0<B<10 else '-1')


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = raw_input(), raw_input()
print a*b if 1 <= a <= 9 and 1 <= b <= 9 else -1

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

const long long MOD = 1000000007LL;
const long long INF = 1e18;

int GCD(int a, int b){return b == 0 ? a : GCD(b, a % b);}
long long fast_exp(long long base, long long exp, long long mod = MOD) {
    long long tot = 1;
    for(;exp > 0;exp >>= 1) {
       if((exp & 1) == 1) tot = tot * base % mod;
       base = base * base % mod;
    }
    return tot;
}
long long slow_mult(long long base, long long exp, long long mod = MOD) {
    long long tot = 0;
    for(;exp > 0;exp >>= 1){
       if((exp & 1) == 1) tot = (tot + base) % mod;
       base = base * 2 % mod;
    }
    return tot;
}

struct chash {
    static uint64_t splitmix64(uint64_t x) {x += 0x8e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf54876d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31);}
    size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM);}
    size_t operator()(pair<uint64_t,uint64_t> x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x.first + FIXED_RANDOM)^(splitmix64(x.second + FIXED_RANDOM) >> 1);}
};

int main(){

    cin.sync_with_stdio(0); cin.tie(0); cout.tie(0);

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int a, b; cin >> a >> b;

    if(a < 10 && b < 10) cout << a*b;
    else cout << -1;

    return 0;

}

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <cmath>
#include <typeinfo>
#include <set>
#include <bitset>
#include <map>
#include <numeric>
#include <queue>

using namespace std;
typedef long long ll;

int main(){
    int a,b;
    cin >> a >> b;
    if(a<10 and b<10){
        cout << a*b << endl;
    }else{
        cout << -1 << endl;
    }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

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