P16322 [MX-J29-T1] Number Partitioning

Description

Given a number $m$ with length $n$, you need to output how $m$ looks if you insert a comma every $k$ digits when grouping from the lowest digit to the highest digit.

Input Format

This problem has multiple test cases. The first line contains two positive integers $c, t$, representing the Subtask ID and the number of testdata groups. In particular, in the samples $c = 0$. For each testdata group: - Input one line with three positive integers $n, m, k$.

Output Format

For each testdata group: - Output one line containing a string representing your answer.

Explanation/Hint

### Sample Explanation For the first group of data, simulating as required gives the split number string `1,145,141,919,810`. For the second group of data, simulating as required gives the split number string `11,1456,1523`. ### Constraints For all data, it is guaranteed that: - $1 \le t \le 10^5$; - $1 \le k < n \le 10^6$; - $\sum n \le 10^6$; - $10^n \le m < 10^{n+1}$. **This problem uses bundled tests**, and each subtask has the following special properties: ::cute-table{tuack} | Subtask | $\sum n \le$ | Special Property | Score | |:-:|:-:|:-:|:-:| | $1$ | $10^3$ | None | $40$ | | $2$ | $10^6$ | $k \mid n$ | $40$ | | $3$ | ^ | None | $20$ | Translated by ChatGPT 5