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


Added by:Darek Dereniowski
Date:2004-06-01
Time limit:1.649s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:PAL

hide comments
2014-05-13 18:20:42 Charizard_
mine too s correct but getting TLE.....

edit: make sure your algo is fast enough
make sure ur I/O is fast enough
in case of C++: use scanf,printf than cin,cout
in case of Java: use BufferedReader than Scanner

Last edit: 2011-05-14 23:52:22
2014-05-13 18:20:42 Shreya Inamdar
please suggest a few more test cases.All the given test cases give right results but still it shows "WA"
2014-05-13 18:20:42 Archzilon Eshun-Davies
I keep trying out my code and I keep getting "runtime error" but when I try to run it locally on my OpenBSD4.8 it works perfectly could we get more accurate sample input like the so could 10000 digits.
2014-05-13 18:20:42 Sherimbek Junushev
My program shows time limit too
2014-05-13 18:20:42 satyaprakash patel
i know my coding for this program is 100% corect.....but status shows error......
please tell me which type of coding i do for this.....
2014-05-13 18:20:42 Venkateshwaran.M
my program run on system turbo c nd gave correct output bt result s run time error...how

Last edit: 2011-02-17 10:09:39
2014-05-13 18:20:42 Lureohc Otnafifa
why TLE..?? who can help me???
2014-05-13 18:20:42 YatsukoYin
Should we use FFT to solve this problem or something else?
Karatsuba?

ps
used FFT - got TLE...
tomorrow will try Karatsuba...

Last edit: 2011-01-24 18:35:42
2014-05-13 18:20:42 oleng
my program in c++ was produces the correct output,but why it still wrong answer??
2014-05-13 18:20:42 Kos
@I Made Krisna Widhiastra: second
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.