To end the everlasting rivalry between Tom and Jerry, the Lady of the house found an Idea. She gives them a list of N numbers, denoted as A1, A2, A3, … , An. And they play Q independent games.

This is a companion discussion topic for the original entry at https://toph.co/p/k-game