Suspicious Imposters

A. Suspicious Imposters

No Submission Yet

Problem Statement

LHS is hosting a digital game night featuring the hit game, Among Us! Luckily for you, you have devised a foolproof method of determining the most suspicious players by stealing their admin card IDs. The \(i\)th player's admin card ID is a \(7\) digit number, \(a_i\). A player’s suspiciousness can be represented as a number determined by the remainder when the sum of the digits of their player ID is divided by 13. If two players have the same suspiciousness, the player with the larger ID is more suspicious. It is guaranteed that there are no duplicate IDs. Given \(N\) (\(1 \leq N \leq 100\)) player IDs, and the number of imposters \(M\) (\(1 \leq M \leq 3\)), determine the top \(M\) most suspicious players.

Additional Notes

Time Limit:
C++: 2.5 seconds
Java, Python: 5 seconds
Memory Limit: 256mb


\(1 \leq M \leq 3\)
\(M \leq N \leq 100\)
\(10^6 \leq a_i < 10^7\)

Input Format

The first line of input contains \(N\) and \(M\), the number of players and the number of top suspicious IDs you need to print.
The next \(N\) lines contain each player's ID.

Output Format

Output \(M\) lines, containing the IDs of the most suspicious players (listed from most suspicious to least suspicious).

Sample Input

5 2

Sample Output


Sample Explanation

\(6969420\) has a remainder of \(10\) and \(5658128\) has a remainder of \(9\), so \(6969420\) is more sussy for obvious reasons (and also because its 6969420 :clown:).

Credit: Polopopy

Contact Us
LIT Discord Server