Problem:
Multiplication of Big Integers

Given two integers $A$ and $B$, compute the product, $A \times B$.

Input

Two integers $A$ and $B$ separated by a space character are given in a line.

Output

Print the product in a line.

Constraints

$-1 \times 10^{1000} \leq A, B \leq 10^{1000}$

Sample Input 1

5 8

Sample Output 1

40

Sample Input 2

100 25

Sample Output 2

2500

Sample Input 3

-1 0

Sample Output 3

0

Sample Input 4

12 -3

Sample Output 4

-36

Solution in C# (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.IO;


namespace ConsoleApp1
{
    class Program
    {
        //乗算
        static string MultBig(string s, string t)
        {
            if (s == "0" || t == "0") return "0";

            string sign = "";
            if ((s[0] == '-' && t[0] != '-') || (s[0] != '-' && t[0] == '-'))
            {
                sign = "-";
            }

            int[] a = StringToPlusInt(s);
            int[] b = StringToPlusInt(t);
            int a_len = (s[0] != '-' ? s.Length : s.Length - 1);
            int b_len = (t[0] != '-' ? t.Length : t.Length - 1);

            int size = a_len + b_len + 1;
            int[] sum = new int[size];

            for (int i = b.Length - 1; i >= 0; i--)
            {
                int[] temp = new int[size];
                if (b[i] == 0) continue;
                for (int j = a_len - 1; j >= 0; j--)
                {
                    int v = b[i] * a[j] + temp[i + j + 2];
                    temp[i + j + 1] += v / 10;
                    temp[i + j + 2] = v % 10;
                }
                int[] _sum = new int[size];
                Plus(sum, temp, _sum);
                sum = _sum;
            }
            return sign + IntArrayToString(sum);
        }

        //符号なし数字文字列において、数値としてsのほうがtよりなら1 同じなら0 小さいなら -1
        static int Cmp(string s, string t)
        {
            if (s == t) return 0;
            if (s.Length > t.Length) return 1;
            if (s.Length < t.Length) return -1;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] > t[i]) return 1;
                else if (s[i] < t[i]) return -1;
            }

            return -9999999; //エラー
        }
        //どちらも正のときの加算 結果をsumに。sumは0で初期化されている必要がある。
        //右詰め sum[0]は0であることがありえる。
        static void Plus(int[] a, int[] b, int[] sum)
        {
            int i = a.Length - 1;
            int j = b.Length - 1;
            int k = sum.Length - 1;
            while (i >= 0 || j >= 0)
            {
                int v = 0;
                int w = 0;
                if (i >= 0) v = a[i];
                if (j >= 0) w = b[j];
                int x = v + w + sum[k];
                if (x >= 10)
                {
                    sum[k - 1] += 1;
                    x %= 10;
                }

                sum[k] = x;
                i--;
                j--;
                k--;
            }
        }

        //符号付き(-のみ)数字文字列をint[]に変換。
        static int[] StringToPlusInt(string s)
        {
            return s.SkipWhile(x => x == '-').Select(y => y - '0').ToArray();
        }

        //int[]をstringに変換。最初の値が0の場合無視
        static string IntArrayToString(int[] array)
        {
            string ret = string.Join("", array.SkipWhile(x => x == 0).Select(y => y.ToString()));
            if (ret == "") ret = "0";
            return ret;
        }

        static void Main(string[] args)
        {
            var st = Console.ReadLine().Split(' ');
            string s = st[0];
            string t = st[1];

            string ans = MultBig(s, t);
            Console.WriteLine(ans);
        }
    }
}