How do I input 1 integer A and input multiple integer based on the number of integer A in one line using cin?

example input:
3 3 1 2 (the first input is 3, so I want to input 3 variables)
2 7 8 (the first input is 2, so I want to input 2 variables)
4 5 3 7 2 (the first input is 4, so I want to input 4 variables)