#P12565. [UTS 2024] Big
[UTS 2024] Big
Description
You are given two integers, and . You concatenate all the numbers in the range in an order that produces the largest possible number, .
You are given queries of the form: --- what is the -th digit of ?
The digits of are -indexed, starting with the most significant one.
It is guaranteed that the length of will be at least .
Input Format
The first line contains two integers and ().
The second line contains one integer ().
The third line contains integers (), representing the queries. It is guaranteed that all answers exist.
Output Format
The only line of the output should contain a string of length , where the -th character will be the answer to the -th query.
8 13
4
0 3 8 9
9310
Hint
- ( points): ;
- ( points): ;
- ( points):
- ( points): ;
- ( points): ;
- ( points): ;
- ( points): no further restrictions.
京公网安备 11011102002149号