#C9521. Unique Question ID Generation
Unique Question ID Generation
Unique Question ID Generation
You are given two positive integers \(k\) and \(n\). Your task is to generate \(n\) distinct question ID strings. Each ID must consist of exactly 8 characters, chosen from the set of uppercase English letters and digits.
In addition, the sum of the ASCII values of the characters in each ID must be divisible by \(k\). For example, if an ID is "00000006
", then the sum of the ASCII codes of each character should be a multiple of \(k\). You can generate the IDs by scanning through potential candidates in a deterministic order until you find \(n\) valid ones.
Note: The output order must be the same as the order in which they are found.
inputFormat
The input is read from standard input. The first line contains two integers (k) and (n) separated by space, where (k) is the divisor for the ASCII sum and (n) is the number of unique question IDs to generate.
outputFormat
Print exactly (n) lines to the standard output. Each line should contain one valid 8-character question ID. All generated IDs must be unique and satisfy the condition that the sum of ASCII values of its characters is divisible by (k).## sample
10 3
00000006
0000000J
0000000T
</p>