MUL  Fast Multiplication
Multiply the given numbers.
Input
n [the number of multiplications <= 1000]
l1 l2 [numbers to multiply (at most 10000 decimal digits each)]
Text grouped in [ ] does not appear in the input file.
Output
The results of multiplications.
Example
Input: 5 4 2 123 43 324 342 0 12 9999 12345 Output: 8 5289 110808 0 123437655
Warning: large Input/Output data, be careful with certain languages
hide comments
Vamsi Krishna Avula:
20150204 16:06:10
try VFMUL after this Last edit: 20150225 17:19:51 

[Lakshman]:
20140907 22:11:31
@abdullah malikyar In this problem you have to multiply only two number, But the number can have at most 10000 digits. 

abdullah malikyar:
20140907 09:00:38
Do they mean they have only 2 numbers(100 10) to multiply or they can have multiple numbers (2 10 200 100) aswell? and i did implement it using my own algorithm and ran all the test cases the output was correct but when i submit my code here in SPOJ it says wrong answer can anyone explain how? Last edit: 20140907 09:17:28 

/* Nitin Jaiman */:
20140813 13:45:41
I implemented Karatsuba it was giving me tle for "Not SO Fast Multiplication " which means it was taking more than 12 sec. I implemented the same algo in c++ it took only 1.2 secs. In short JAVA SUCKS


candide:
20140604 21:50:15
@jinank jain My peasant multiplication implementation is about 10 times slower than my schoolbook algorithm implementation. 

sai spoorthy:
20140530 10:56:37
I HAVE DONE BY KARATSUBA algorithm and used biginteger but it is not accepting my answer can anyone give me some test cases 

candide:
20140528 01:30:28
EDIT 2015/05


[Lakshman]:
20140513 18:20:42
@Mohit Read the problem statement once again.


NOVICE:
20140513 18:20:42
BigInteger here will give TLE...Refer KARATSUBA algorithm or you can try easier version of this problem(TMUL). 

Saurabh_P:
20140513 18:20:42
I tried it using BigIntegr datatype in java and it is showing me compilation error here. Last edit: 20131226 00:13:11 
Added by:  Darek Dereniowski 
Date:  20040601 
Time limit:  1.649s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 
Resource:  PAL 