Madrid hit by pollution, restricts thousands of cars