#K59117. Contradictory Widget Inspections
Contradictory Widget Inspections
Contradictory Widget Inspections
You are given T test cases. In each test case there are several inspections of widgets. Each inspection is described by a widget ID (an integer) and an inspection result (a boolean value, where True
indicates a pass and False
indicates a fail).
A widget is considered to have contradictory inspection results if it has been inspected and recorded both True
and False
results.
Your task is to process each test case and output the list of widget IDs (in ascending order) that have contradictory inspection results. For a test case with no contradictory inspections, simply output an empty line.
Note: The input is provided via stdin
and the output should be printed to stdout
.
inputFormat
The first line of input contains an integer T
indicating the number of test cases. For each test case:
- The first line contains an integer
N
representing the number of inspections. - The next
N
lines each contain a widget ID and its inspection result separated by a space. The inspection result is given as eitherTrue
orFalse
.
outputFormat
For each test case, output a single line containing the space‑separated list of widget IDs (in ascending order) that have contradictory inspection results. If no widget has contradictory inspections, output an empty line.
## sample1
4
1 True
2 True
1 False
3 True
1
</p>