#K69302. Message Distribution on Servers

    ID: 33056 Type: Default 1000ms 256MiB

Message Distribution on Servers

Message Distribution on Servers

You are given \(N\) messages, \(S\) servers, and a server capacity of \(C\). Each message is represented by an integer and is processed sequentially. A message with identifier \(m\) is assigned to the server at index \((m-1) \mod S\) (using 0-indexing). However, if a server has already stored \(C\) messages, it cannot store any additional messages, and such messages are dropped.

Your task is to simulate this process and output the final count of messages stored on each server.

inputFormat

The input is given via standard input (stdin). The first line contains three space-separated integers: \(N\), \(S\), and \(C\). The second line contains \(N\) space-separated integers representing the message IDs.

outputFormat

Output a single line to standard output (stdout) with \(S\) space-separated integers. Each integer represents the number of messages stored on the corresponding server.

## sample
10 3 3
1 2 3 4 5 6 7 8 9 10
3 3 3