Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/string-katta-sonni-kopaytirish

Multiply a big number by a digit

Medium 1000 ms 128 MB 66%
Share

A positive integer $N$ and a digit $d$ are given. Find their product $P$:

$$P = N * d$$

Multiplying a multi-digit number by a one-digit number in a column

Input

One line with a positive integer $N$ and a digit $d$ separated by a space.

Output

One integer $P$ — without leading zeros.

Note

$1 \le N \lt 10^{100000}$
$N$ has no leading zero
$0 \le d \le 9$

Examples

Input #1
123456789123456789123456789 9
Output #1
1111111102111111102111111101
Input #2
5 0
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.