Multiply Two

Easy · rating 800 · math

Read two integers a and b. Print their product.

Constraints: |a|, |b| ≤ 109

Editorial

Multiply Two prints the product of two integers. The subtlety is range: two values up to 10⁹ multiply to about 10¹⁸, which needs a 64-bit integer to hold.

print(a * b)

Complexity

Time: O(1). Space: O(1).

Open Multiply Two in Code Arena →