AT_abc406_b [ABC406B] Product Calculator
Description
Takahashi has a calculator that initially displays $ 1 $ .
He will perform $ N $ operations on the calculator.
In the $ i $ -th operation $ (1 \leq i \leq N) $ , he multiplies the currently displayed number by a positive integer $ A_i $ .
However, the calculator can display at most $ K $ digits. If the result of the multiplication has $ (K+1) $ or more digits, the display shows $ 1 $ instead; otherwise, the result is shown correctly.
Find the number showing on the calculator after the $ N $ operations.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ K $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $
Output Format
Output the number shown on the calculator after the $ N $ operations.
Explanation/Hint
### Sample Explanation 1
This calculator can display at most two digits and initially shows $ 1 $ . Takahashi operates as follows:
- The 1st operation multiplies by $ 7 $ . Since $ 1 \times 7 = 7 $ , the calculator shows $ 7 $ .
- The 2nd operation multiplies by $ 13 $ . Since $ 7 \times 13 = 91 $ , the calculator shows $ 91 $ .
- The 3rd operation multiplies by $ 3 $ . Since $ 91\times 3=273 $ , which has three digits, the calculator shows $ 1 $ .
- The 4th operation multiplies by $ 2 $ . Since $ 1\times 2=2 $ , the calculator shows $ 2 $ .
- The 5th operation multiplies by $ 5 $ . Since $ 2\times 5=10 $ , the calculator shows $ 10 $ .
### Constraints
- $ 1 \leq N \leq 100 $
- $ 1 \leq K \leq 18 $
- $ 1 \leq A_i < 10^K $
- All input values are integers.