logo AlgoBeat OnlineJudge
登录 注册

#212626. [UTS 2024] Big

内存限制:512 MiB 时间限制:3500 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 .

输入格式

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.

输出格式

The only line of the output should contain a string of length , where the -th character will be the answer to the -th query.

样例

样例输入 1

8 13
4
0 3 8 9

样例输出 1

9310

数据范围与提示

  • ( points): ;
  • ( points): ;
  • ( points):
  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): no further restrictions.