#P8708. [蓝桥杯 2020 省 A1] 整数小拼接
[蓝桥杯 2020 省 A1] 整数小拼接
Problem Description
Given an array of length . You can choose two numbers and (), then concatenate and in order to form a new integer. For example, 12 and 345 can be concatenated into 12345 or 34512. Note that swapping the order of and is always considered as different ways, even when .
Please calculate how many concatenations produce an integer that is less than or equal to .
Input Format
The first line contains integers and .
The second line contains integers .
Output Format
Output one integer representing the answer.
4 33
1 2 3 4
8
Hint
For of the test cases, , , .
For all test cases, , , .
Lanqiao Cup 2020, first round of the provincial contest, Group A, Problem H.
Translated by ChatGPT 5