This page is still under construction.

Parts of this page are still being built. What you see may change.

Multiplication of Large Numbers (3)

Time limit1sMemory limit512 MB

Summary
Multiply two non-negative integers of up to one million digits each and print the exact product.
Level

Medium7 of 10

Topics
Math, String, Implementation, Divide and conquer
Solved
No attempts yet

Problem

Given two integers A and B, write a program that prints their product.

Input

The first line contains the integers A and B. Both are integers greater than or equal to 0, and any integer other than 0 does not start with 0 and has no unnecessary leading zeros. Also, the length of each number does not exceed 1,000,000 digits.

Output

Print the product of the two numbers.

Examples3

  1. Example 1

    Input
    1 2
    
    Expected output
    2
    
  2. Example 2

    Input
    3 4
    
    Expected output
    12
    
  3. Example 3

    Input
    893724358493284 238947328947329
    
    Expected output
    213553048277135320552236238436