A Times B

View as PDF

Submit solution

Points: 20 (partial)
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
Assembly, Brain****, C, C++, Pascal, Rust

For a while now, FatalEagle has been thinking about fast multiplication. He found the problem on SPOJ, MUL, and solved it without too much trouble. Then he found VFMUL on the same site, but the same code for MUL didn't pass as the SPOJ servers were really slow. Frustrated and desperate to show off demonstrate his fast multiplication code, FatalEagle has created a problem that really tests the accuracy and speed of your fast multiplication code.

Input Specification

The first line of input will have A.

The second line of input will have B.

Both A and B will be non-negative integers strictly less than 10^{1\,000\,001}.

Output Specification

Output the product A \times B.

Sample Input


Sample Output



  • 1
    Nyuu  commented on May 17, 2023, 1:36 a.m.

    Could NASM and or NASM64 be allowed?

    • 2
      Xyene  commented on May 17, 2023, 1:44 a.m.

      Sure, done.

  • 7
    Zafirua  commented on Nov. 8, 2018, 11:06 p.m.

    Hmmm. Is it possible for you to allow Lua on this question? Or is it not possible?