#K42417. Missing Books Problem
Missing Books Problem
Missing Books Problem
You are given a collection of N books, uniquely identified by the numbers \(1 \leq i \leq N\). Out of these, exactly M books have been returned. Your task is to determine which books are missing from the returned list. In other words, find all the book IDs in the range \(1,2,\dots,N\) that are not present in the list of returned books.
Input Format: The input is given from standard input. The first line contains a single integer \(T\) denoting the number of test cases. Then, for each test case, the first line contains two integers \(N\) and \(M\). The next line contains \(M\) space-separated integers representing the IDs of the returned books. Note that if no book is returned, the corresponding line will be empty.
Output Format: For each test case, output a single line listing the missing book IDs in ascending order separated by a space. If all books are returned, output an empty line.
inputFormat
The first line of the input contains an integer \(T\), the number of test cases. For each test case:
- The first line contains two integers \(N\) and \(M\) separated by a space, where \(N\) is the total number of books and \(M\) is the number of returned books.
- The second line contains \(M\) space-separated integers representing the book IDs that were returned. If \(M = 0\), this line will be empty.
outputFormat
For each test case, print a single line listing the missing book IDs in ascending order separated by a space. If no book is missing, print an empty line.
## sample3
5 3
2 3 1
4 4
1 2 3 4
6 2
2 4
4 5
1 3 5 6
</p>