## A Times B

View as PDFSubmit solution

Points:30
(partial)

Time limit:2.0s

Memory limit:256M

Author:

Problem type

Allowed languages

C, C++, Pascal, Rust

For a while now, ~~show off~~ demonstrate his fast multiplication code, 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 .

The second line of input will have .

Both and will be non-negative integers strictly less than .

#### Output Specification

Output the product .

#### Sample Input

```
123456123456123456123456123456123456
987987876876765765654654543543432432321321
```

#### Sample Output

`121973153300851295215956247283945278187966162014464020099359068031370037005376`

Report an issue

## Comments

Why not JAVA? Isn't BigInteger capable of processing numbers of any range?

Funny thing; I was reading the Java BigInteger documentation, and the fastest multiplication method would take 6 seconds on a worst case.

That is precisely why Java is disallowed.

Time limit lowered to 2s. Karatsuba shall not pass!

My Karatsuba pass the tests, even faster than some FFTs implementations.