Problem:


Score : 100 points

Problem Statement

Compute A \times B.

Constraints

1 \leq A \leq 100

1 \leq B \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the value A \times B as an integer.

Sample Input 1

2 5

Sample Output 1

10

We have 2 \times 5 = 10.

Sample Input 2

100 100

Sample Output 2

10000



Sample input:
2 5


Sample output:
10

Submission status: Runtime Error

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

print(a * B)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B=int(input())
print(A*B)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
 
# Aに0が含まれていたら、積も0とする
# Aに0が含まれていなければ、順に積を取り、10^18を超えたら終了する
ans = 0
if 0 not in A:
  ans = 1
  for a in A:
    ans *= a
    if ans > 10**18:
      ans = '-1'
      break
 
print(ans)

Submission status: Runtime Error

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

ans=0
if 0 not in A:
  ans=1
  for a in A:
    ans*=a
    if ans>10**18:
      ans='-1'
      break

print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
    exit(0)
    
ans = 1 
for i in A:
    ans *= i
    if ans > 10**18:
        print(-1)
        exit(0)
        
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split())
if 0 in A:
  print(0)
  exit(0)

ans=1
for i in A:
  ans*=i
  if ans>10**18:
    print(-1)
    exit(0)

print(ans)

Submission status: Runtime Error

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

print(A * B)

Submission status: Runtime Error

Solution code:
n = int(input())
a = sorted([int(i) for i in input().split()])
cnt = 1
for ai in a:
  cnt *= ai
  if cnt > 10 ** 18:
    print(-1)
    exit()
print(cnt)

Submission status: Runtime Error

Solution code:
st = input().strip().split()

a = int(st[0])
b = 0

for x in st[1]:
  if x == '.':
  else: b = b*10 + x

print(a*b//100)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
 
ans = 1
for x in a:
  if ans <= 10**18:
    ans = ans * x

print(-1 if ans > limit else ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
 
ans, limit = 1, 10**18
for x in a:
  ans = (ans if ans > limit else ans * x)

print(-1 if ans > limit else ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
 
ans, limit = 1, 10**18
for x in a: ans = (ans if ans > limit else ans * x)
 
print(-1 if ans > limit else ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split())).sort()
 
ans = 1
for x in a:
  ans = (ans if ans > 10**18 else ans * x)
 
print(-1 if ans > 10**18 else ans)

Submission status: Runtime Error

Solution code:
print(int(input())*int(input()))

Submission status: Runtime Error

Solution code:
print(int(input())*int(input()))

Submission status: Runtime Error

Solution code:
import math

R = int(input())
print(2 * R * math.pi)

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
print (a*b)

Submission status: Runtime Error

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    while n%2 == 0:
        n//=2
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)

            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Runtime Error

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while 2*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)

            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(A * B)

Submission status: Runtime Error

Solution code:
 169A

#　1．入力をちゃんと受け取ること
# ex:「2 5」=>a=2,b=5と変数を作成する
# スペース区切りの入力を整数として受け取る例
a, b = map(int, input().split())
# print(a)
# print(b)

# 2．目的通りの計算をする
# ex:2つの整数AとBの掛け算をやる
answer = a * b

# 3.計算結果を出力する
print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
x = 1

for i in range(N):
  x*= A[i]
  
if x>pow(10,18):
  print(-1)
else:
  print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = a * b
           
print(ans)

Submission status: Runtime Error

Solution code:
   a169
#  値 A × B を整数として出力せよ。

#   入力（スペース区切りの2整数を受け取る）
a, b = map(int, input().split())
#   print(a, b)

#   処理
answer = a * b

#   出力
print(answer)

Submission status: Runtime Error

Solution code:
n,m=int(input().split())
print(n*m)

Submission status: Runtime Error

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

answer　= a * b

print(answer)

Submission status: Runtime Error

Solution code:
# 変数宣言
int A;
int B;

#計算結果の出力
print(A * B)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
m = 1
for i in a:
  m = m*i
if m<= 10**18:
  print(m)
else:
  print(-1)

Submission status: Runtime Error

Solution code:
A=input()
B=input()
print(A*B)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <sstream>
#include <iomanip>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <set>
#include <map>
#include <stdlib.h>
#include <cctype>
#include <bitset>
using namespace std;
int main(){
    int a,b;
    cin >> a >> b;
    cout << a * b << endl;
}

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
rint(b)
answer = a * b
print(answer)

Submission status: Runtime Error

Solution code:
print(a)
print(b)

answer = a * b

print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# 169a
# A*Bを整数として出力せよ

# ①入力をプログラムでとらえるように受け取る
a, b = map(int, input(),split())
# print(a, b)

# ②受け取った入力値を適切に出力
answer = a * b

# ③結果出力
print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B = map(int,input())
print(A*B)

Submission status: Runtime Error

Solution code:
# map関数:map(関数,リスト) リストのすべての要素に関数を適用する
# split関数:変数名.split() 変数を区切る
# split関数は文字列型の為、数字に認識させるためにintを入れる
answer = a * b

print(answer)

Submission status: Runtime Error

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

answer = A * B
print(answer)

Submission status: Runtime Error

Solution code:
nums = input().split()
print(int(num[0]) * int(num[1]))

Submission status: Runtime Error

Solution code:
nums = input().split()
print(float(num[0]) * float(num[1]))

Submission status: Runtime Error

Solution code:
t = input()
bool ok = 0 
for i in range (0,t):
	ans = 1
	a = input()
	ans = ans*a
	if ans>1000000000000000000 :
		ok = False
if ok :
	print(ans)
else : 
	print(-1)

Submission status: Runtime Error

Solution code:
    # 入力をプログラムで扱えるように受け取ること
    a, b = map(int, input().split())
    # print(a, b)
     
    # 受け取った入力値を使い、適切に処理（計算）する
    answer = a * b
     
    # 計算した結果を出力する
    print(answer)

Submission status: Runtime Error

Solution code:
a,b = int(input().split())
print(str(a*b))

Submission status: Runtime Error

Solution code:

a,b = int(input().sqlit())
print(str(a*b))

Submission status: Runtime Error

Solution code:
n1 = input()
n2 = input()

print(n1 * n2)

Submission status: Runtime Error

Solution code:
a = input()
b = input()

print(a * b)

Submission status: Runtime Error

Solution code:
N = int(input())
arr = list(map(int, input().split()))
result = 0
for i in range(N):
    if result == 0:
        result += arr[i]
    else:
        result *= arr[i]
if result > 10**18:
    print(-1)
else:
    print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
s = 1

for i in range(n):
    s *= a[i]

if s <= 10**18:
    print(s)
elif s > 10**18:
    print("-1")

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
s = 1

for i in range(n):
    s *= a[i]

if s < 10**18:
    print(s)
elif s > 10**18:
    print(-1)

Submission status: Runtime Error

Solution code:
a = input()
b = input() 
print(a*b)

Submission status: Runtime Error

Solution code:
A, B = int(input()), int(input())
print(A*B)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
if(0 in l):
  print(0)
else:
  p=1
  for i in l:
      p*=i
      if(p>1000000000000000000):
          print(-1)
          exit()
  print(p)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
if(0 in l)::
    print(0)
    exit()
p=1
for i in l:
    p*=i
    if(p>1000000000000000000):
        print(-1)
        exit()
print(p)

Submission status: Runtime Error

Solution code:
import sys
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")
    sys.exit()
else:
    for i in range(N):
        a *= An[i]
        if a > 10**18:
            print("-1")
            sys.exit()
    if a <= 10**18:
        print(a)
        sys.exit()

Submission status: Runtime Error

Solution code:
a, b = map(int, intput().split())
print(a * b)

Submission status: Runtime Error

Solution code:
a, b = map(int, intpu().split())
print(a * b)

Submission status: Runtime Error

Solution code:
A = int(input())
print(int(input())*A)

Submission status: Runtime Error

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

ans = 1
for i in range(N):
  ans *= A[i]
  if ans > 10**18:
    ans = -1
    break
    
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(a*b)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
print(a * b)

Submission status: Runtime Error

Solution code:
N=int(input())
A_list=sorted(list(map(int, input().split())), reverse=True)
ans=1

if 0 in A_list:
  print(0)
  exit()
else:
  for a in A_list:
    ans*=a
    if ans>1e+18:
      print(-1)
      exit()
  print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
t = list(map(int, input().strip().split()))

r = 1
for tt in t:
    r *= tt

rr = r - 10**18
if rr > 0:
    print(-1)
else:
    print(r)

Submission status: Runtime Error

Solution code:
N = input()
ls = map(int, input().split())
tot = 1
for i in ls:
    tot = i*tot
    if tot > 10^18:
        break
    elif tot ==0:
        break
    
if i <= 10^18:
    print(tot)
else:
    print(-1)

Submission status: Runtime Error

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

print(A * B)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
import numpy as np
import sys

if 0 in A:
    print(0)
    sys.exit()

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    sys.exit()
if 10**18 < ans:
    print(-1)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
import numpy as np
import sys

if 0 in A:
    print(0)
    sys.exit()

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    sus.exit()
if 10**18 < ans:
    print(-1)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    exit(0)
if 10**18 < ans:
    print(-1)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)
    
ans = np.prod(A)
elif ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
import numpy as np
ans = np.prod(A)

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(N):
    ans = ans*A[i]

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
 a,b=(int(x) for x in input().split())
 
 print(a*b)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
x = 1
if 0 in a:
    x = 0
else:
    for j in a:
        x = j*x
        if x > 10**18:
            x = -1
            break
print(x)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
x = 1
if 0 in a:
    x = 0
for j in a:
    x = j*x
    if x > 10**18:
        x = -1
        break
print(x)

Submission status: Runtime Error

Solution code:
# ABC169
# C Multiplication 3
A, B = map(str, input().split())
A = int(A)
B = int(B[0]+B[2]+B[3])
x = A * B
x = x // 100
print(int(x))

Submission status: Runtime Error

Solution code:
A,B=map(int,input().rstrip().split(" ")
print(A*B)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().rstop().split(" ")
print(A*B)

Submission status: Runtime Error

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

ans = 1

if 0 in A:
  ans = 0
else:
  for i in range(N):
    ans *= A[i]
    i += 1
    if ans > 10**18:
      ans = -1
      break

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

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

count = 1

for i in a:
    count*=i

x = 10**18

if count > x:
    print(-1)
    break
else:
    print(count)

Submission status: Runtime Error

Solution code:

t_nums= list(map(int(),input().split()))
print(t_nums[0]*t_nums[1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
print(a[0]*a[1])

Submission status: Runtime Error

Solution code:
n = int(input())
As = list(map(int,input().split()))

ans = 1

for i in as:
    ans *= i
    ans = min(ans, 10**18 + 1)

if ans == 10**18 + 1:
    print(-1)

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(A * B)

Submission status: Runtime Error

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

def f(A):
    for a in A:
        if a == 0:
            print(0)
            return
    v = 1
    for a in A:
        v *= a
        if v > int(1e+18):
            print(-1)
            return
    print(v)
    return

f(A)

Submission status: Runtime Error

Solution code:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
n = inN()
a = inL()
if 0 in a:
    print(0)
    exit()

sum = 1
for i in range(n):
    sum *= a[i]
    if sum <= pow(10,18):
        print(-1)
        exit()
print(sum)

Submission status: Runtime Error

Solution code:
import sys
A,B = map(int,input())
if not ( 1 <= A <= 100 and 1 <= B <= 100 ): sys.exit()

print(A*B)

Submission status: Runtime Error

Solution code:
a=input()
b=input()
print(a*b)
#hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

Submission status: Runtime Error

Solution code:
a=input()
b=input()
a= int(a)
b= int(b)
print(a*b)

Submission status: Runtime Error

Solution code:
a=int(input('a='))
b=int(input('b='))
x=a*b
print(x)

Submission status: Runtime Error

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

print(A*B)

Submission status: Runtime Error

Solution code:
N = int(input())
num = list(map(int,input().split()))
b= 1
for a in range(N):
  b = b * num[a]
  if b > 10**18:
    print(-1)
  else:
    print(b)

Submission status: Runtime Error

Solution code:
N = int(input())
num = list(map(int,input().split()))
b= 0
for a in range(N):
  b = b * num[a]
  if b > 10**18:
    print('-1')
  else:
    print(b)

Submission status: Runtime Error

Solution code:
N = int(input())
num = list(map(int,input().split()))
b= 0
for a in range(N):
  b = b * num[a]
if b > 10**18:
  print('-1')
else:
  print(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
a_lis = list(input().split())

# 10^18を超えたら駄目

ans=1
rough_power=0
for i in a_lis:
    rough_power+=len(i)-1

if rough_power>18:
    print("-1")
elif 0 in a_lis:
    print(0)
else:
    for j in a_lis:
        ans=ans*int(j)

    if ans>pow(10,18):
        print("-1")
    else:
        print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
s = [int(i) for i in input().split()]
if 0 in s:
  print(0)
  exit()
ans = 1
for i in s:
  ans = ans * i
if ans > 10 ** 18:
  print(-1)
else:
  print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
p = 1
for i in a:
    p *= i
if p > int(1e18):
    print(-1)
else:
    print(p)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
print(int(a * b))

Submission status: Runtime Error

Solution code:
a = input()
b = input()
printint(a * b)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
print(str(a * b))

Submission status: Runtime Error

Solution code:
import java.util.*;
class Main
{
  public static void main(String...args)
  {
    Scanner sc = new Scanner(System.in);
    System.out.println(sc.nextInt()*sc.nextInt());
  }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(int(input()*int(input()))

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
print(A * B)

Submission status: Runtime Error

Solution code:
def main():
    arg = int(input())
    ans = arg + arg ** 2 + arg ** 3
    print(str(ans))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

# リストxsの総乗
def inf_product(xs):
    limit = int(1e9) + 7
    p = 1
    for x in xs:
        p *= x
        p %= limit
    return p

def calp():
    '''
    import random
    limit = int(1e9)
    n = int(2e5)
    k = int(n*9/10)
    x = []
    for i in range(n):
        x.append(random.randint(-limit,limit))
    '''
    n,k = map(int,input().split())
    x = list(map(int,input().split()))
    
    # n=kであれば、全要素の総乗をpとして返す
    if n == k:
        return inf_product(x)
    # 要素0の個数がn-kより大きければ、pとして0を返す
    if x.count(0) > n-k:
        return 0

    #要素を負の配列x1 と 正の配列x2 0の配列x3に分ける
    x.append(0)
    x.sort()
    #print(x)
    m1 = x.index(0)
    m2 = x.count(0)
    x1 =x[:m1]
    x2 =x[m1+m2:]
    x3 =x[m1:m1+m2-1]
    #print(x1,x2,x3)

    # 正の要素がない場合、kが偶数の場合小さい順（絶対値の大きい順）に拾う
    # kが奇数で要素に0を含む場合は、0を返す
    # kが奇数で要素に0を含まない場合は、大きい順（絶対値の小さい順）に拾う
    if len(x2) == 0:
        if k%2 == 0:
            return inf_product(x1[:k])
        elif len(x3) != 0:
            return 0
        else:
            return inf_product(x1[-k:])

    # kが奇数の場合、正のリストの最大のものをまず1個選択する
    p = 1
    if k%2 ==1:
        p *= x2[-1]
        x2.pop(-1)
        k -= 1

    x1b,x2b = [],[]
    for i in range(0,2*int(len(x1)/2),2):
        x1b.append(x1[i]*x1[i+1])
    x2.sort(reverse=True)
    for i in range(0,2*int(len(x2)/2),2):
        x2b.append(x2[i]*x2[i+1])
    
    x1b.extend(x2b)
    x1b.sort(reverse=True)
    x1b.insert(0,p)
    #print(x1b,int(k/2)+1)
    temp = int(k/2)

    if len(x1b) > temp:
        return inf_product(x1b[:int(k/2)+1])
    else:
        if len(x3) != 0:
            return 0
        else:
            return(-1)

print(calp())

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
# リストxsの総乗

def inf_product(xs):
    limit = int(1e9) + 7
    p = 1
    for x in xs:
        p *= x
        p %= limit
    return p

def calp():
    '''
    import random
    limit = int(1e9)
    n = int(2e5)
    k = int(n*9/10)
    x = []
    for i in range(n):
        x.append(random.randint(-limit,limit))
    '''
    n,k = map(int,input().split())
    x = list(map(int,input().split()))

    # n=kであれば、全要素の総乗をpとして返す
    if n == k:
        return inf_product(x)
    # 要素0の個数がn-kより大きければ、pとして0を返す
    if x.count(0) > n-k:
        return 0

    #要素を負の配列x1 と 正の配列x2 0の配列x3に分ける
    x.append(0)
    x.sort()
    m1 = x.index(0)
    m2 = x.count(0)
    x1 =x[:m1]
    x2 =x[m1+m2:]
    x3 =x[m1:m1+m2-1]

    # 正の要素がない場合、kが偶数の場合小さい順（絶対値の大きい順）に拾う
    # kが奇数で要素に0を含む場合は、0を返す
    # kが奇数で要素に0を含まない場合は、大きい順（絶対値の小さい順）に拾う
    if len(x2) == 0:
        if k%2 == 0:
            return inf_product(x1[:k])
        elif len(x3) != 0:
            return 0
        else:
            return inf_product(x1[-k:])

    # kが奇数の場合、正のリストの最大のものをまず1個選択する
    p = 1
    if k%2 ==1:
        p *= x2[-1]
        x2.pop(-1)
        k -= 1

    x1b,x2b = [],[]
    for i in range(0,2*int(len(x1)/2),2):
        x1b.append(x1[i]*x1[i+1])
    x2.sort(reverse=True)
    for i in range(0,2*int(len(x2)/2),2):
        x2b.append(x2[i]*x2[i+1])
    
    x1b.extend(x2b)
    x1b.sort(reverse=True)
    x1b.insert(0,p)
    return inf_product(x1b[:int(k/2)+1])


print(calp())

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import numpy
import random
# リストxsの総乗
def inf_product(xs):
    limit = int(1e9) + 7
    p = 1
    for x in xs:
        p *= x
        p %= limit
    return p

def calp():
    '''
    limit = int(1e9)
    n = int(2e5)
    k = int(n*9/10)
    x = []
    for i in range(n):
        x.append(random.randint(-limit,limit))
    '''
    n,k = map(int,input().split())
    x = list(map(int,input().split()))

    # n=kであれば、全要素の総乗をpとして返す
    if n == k:
        return inf_product(x)
    # 要素0の個数がn-kより大きければ、pとして0を返す
    if x.count(0) > n-k:
        return 0

    #要素を負の配列x1 と 正の配列x2 0の配列x3に分ける
    x.append(0)
    x.sort()
    m1 = x.index(0)
    m2 = x.count(0)
    x1 =x[:m1]
    x2 =x[m1+m2:]
    x3 =x[m1:m1+m2-1]

    # 正の要素がない場合、kが偶数の場合小さい順（絶対値の大きい順）に拾う
    # kが奇数で要素に0を含む場合は、0を返す
    # kが奇数で要素に0を含まない場合は、大きい順（絶対値の小さい順）に拾う
    if len(x2) == 0:
        if k%2 == 0:
            return inf_product(x1[:k])
        elif len(x3) != 0:
            return 0
        else:
            return inf_product(x1[-k:])

    # kが奇数の場合、正のリストの最大のものをまず1個選択する
    p = 1
    if k%2 ==1:
        p *= x2[-1]
        x2.pop(-1)
        k -= 1

    x1b,x2b = [],[]
    for i in range(0,2*int(len(x1)/2),2):
        x1b.append(x1[i]*x1[i+1])
    x2.sort(reverse=True)
    for i in range(0,2*int(len(x2)/2),2,):
        x2b.append(x2[i]*x2[i+1])
    
    x1b.extend(x2b)
    x1b.sort(reverse=True)
    x1b.insert(0,p)
    return inf_product(x1b[:int(k/2)+1])

print(calp())

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
 
if 0 in a: 
    ans = 0
else:
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10**18:
            ans = -1
            break
print(prod)

Submission status: Runtime Error

Solution code:
A = A[::-1]
ans = 1
for i in range(N):
  if 0 in A:
    ans = 0
    break
  elif ans > 10**18:
    ans = -1
    break
  else:
    ans = ans*A[i]
if ans > 10**18:
  print(-1)
else:
  print(ans)

Submission status: Runtime Error

Solution code:
a,b=map(int,inpnut().split())
print(a*b)

Submission status: Runtime Error

Solution code:
a, b = int(input())
ans = a*b
print(ans)

Submission status: Runtime Error

Solution code:
A , B =map9int,input().split())
print(A*B)

Submission status: Runtime Error

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

a = int(a)

ans = 0
ans += int(b[0])*100
ans += int(b[2])*10
ans += int(b[3])

print((ans*a)//100)

Submission status: Runtime Error

Solution code:
n = int(input())

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

ans = 1
lim = int(1e18)

if 0 in arr:
    print(0)

else:
    for x in arr:
        ans *= x
        if ans > lim:
            ans = -1
            break 

    print(ans)

Submission status: Runtime Error

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

n = 1

for i in a:
    n *= i
    if n > 10**18:
        print('-1')
        break
else:
    print(n)

Submission status: Runtime Error

Solution code:
def prime(n):
    nums = [True]*n
    primes = []
    for i in range(2,n):
        if nums[i]:
            primes.append(i)
            for j in range(2*i,n,i):
                nums[j] = False
    return primes

def prime_fac(n):
    fac = {}
    primes = prime(int(n**0.5)+1)
    for p in primes:
        while n%p==0:
            fac[p] = fac.get(p,0)+1
            n//=p
    if n > 1:
        fac[n] = 1
    return fac

def main():
    n = int(input())
    fac = prime_fac(n)

    ans = 0
    for i in fac.values():
        ct = 1
        while i >= ct*(ct+1)//2:
            ct += 1
            ans+=1
    print(ans)
main()

Submission status: Runtime Error

Solution code:
1 X = list(map(int, input().split()))

print(X[0]*X[1])

Submission status: Runtime Error

Solution code:
N=int(input())
A = [int(x) for x in input().split()]

ans=1
if 0 in A:
    ans = 0
else:
    for a in A:
        A.reverse()
        if a > 10**18:
            ans = -1
            break
        else:
            ans *= a
            if ans > 10**18:
                ans = -1
                break
print(ans)

Submission status: Runtime Error

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

print(a[0]*a[1])

Submission status: Runtime Error

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

print(a*b)

Submission status: Runtime Error

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

print(a[0]*a[1])

Submission status: Runtime Error

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

print(a*b)

Submission status: Runtime Error

Solution code:
a,b = int(input())
print(a*b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
in = input()
in = int(in.split())
print(in[0] * in[1])

Submission status: Runtime Error

Solution code:
a = (int)input()
b = (int)input()
print(a*b)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
result = 1

for i in range(n):
  result = a[i] * result
  
if result >= 10000000000000000000:
  result = -1

print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
M = list(map(int,input().split()))
    
mult = 1

if 0 in A:
  print(0)
  
for a in M:
    mult *= a
    if mult> 1000000000000000000:
        print(-1)
        
print(mult)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
m=int(input())
print(n*m)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N =int(input())
A = list(map(int, input().split()))
ans = 1
for a in A:
    ans *= a
    if ans > 10**18:
        print(-1)
        exit()
print(ans)

Submission status: Runtime Error

Solution code:
N =int(input())
A = list(map(int, input().split()))
 
for a in A:
    ans *= a
    if ans > 10**18:
        print(-1)
        exit()
print(ans)

Submission status: Runtime Error

Solution code:
ans = A * B
print(ans)

Submission status: Runtime Error

Solution code:
ans = a * b
print(ans)

Submission status: Runtime Error

Solution code:
a,b = mao(int,input().split())
print(a*b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
n = list(map(int, input().split()))
import numpy as np
if np.prod(n) >= 10 ** 18:
  print('-1')
else:
  print(np.prod(n))

Submission status: Runtime Error

Solution code:
a = input()
n = list(map(int, input().split()))
import numpy as np
if np.prod(n) =>10 ** 18:
  print('-1')
else:
  print(np.prod(n))

Submission status: Runtime Error

Solution code:
a = list(map(int, input()))
print(a[0] * a[1])

Submission status: Runtime Error

Solution code:
N = int(input())

a = list(map(int, input().split()))
ans = 1
if a.index(0):
    ans = (0)
else :
    for i in range(N):
        ans = ans * a[i]
        if ans > 10**18:
            ans = -1
            break
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input(). split ()))
mul=1
for a in A:
  mul*=a
if mul>1000000000000000000:
  print(-1)
else:
  print(mul)

Submission status: Runtime Error

Solution code:
a, b = map(int, __import('sys')__.stdin.readline().split())
print(a * b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
t = n.split()

result = int(n[0]) * int(n[1])

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
A = list(map(int,input().split()))
a = np.prod(A)
if a > 10**18:
  print(-1)
else:
  print(a)

Submission status: Runtime Error

Solution code:
A, B = int(input())
print(A * B )

Submission status: Runtime Error

Solution code:
from sys import stdin
data = stdin.readlines()

a = int(data[0])
b = [int(s) for s in data[1].split()]

i = 0
ans = 1
while i <= a-1:
    ans = ans * b[i]
    i += 1
if ans > 10 ** 18:
    ans = -1

print(ans)

Submission status: Runtime Error

Solution code:
a, b = map(int(intput().split()))
print(a * b)

Submission status: Runtime Error

Solution code:
a, b = int(intput().split())
print(a * b)