------
## 最终结论
```python
import sys

def read_input():
    input = sys.stdin.read
    data = input().split()
    
    index = 0
    T = int(data[index])
    index += 1
    
    test_cases = []
    
    for _ in range(T):
        n, m = int(data[index]), int(data[index + 1])
        index += 2
        
        tracks = []
        for __ in range(m):
            x, y = int(data[index]), int(data[index + 1])
            tracks.append((x, y))
            index += 2
            
        test_cases.append((n, m, tracks))
    
    return test_cases

def solve(test_cases):
    results = []
    
    for n, m, tracks in test_cases:
        # Calculate the number of spots to close using the formula ceil(4/7 * n).
        k = (4 * n + 6) // 7  # This calculates ceil(4/7 * n)
        
        # We can just close the first k spots as a simple solution.
        closed_spots = list(range(1, k + 1))
        
        results.append(f"{k}\n{' '.join(map(str, closed_spots))}")
    
    return results

def main():
    test_cases = read_input()
    results = solve(test_cases)
    print("\n".join(results))

if __name__ == "__main__":
    main()
```