#include <algorithm> iterator copy_n( iterator from, size_t num, iterator to );
The copy_n() function copies num elements starting at from to the destination pointed at by to. To put it another way, copy_n() performs num assignments and duplicates a subrange.
The return value of copy_n() is an iterator that points to the last element that was copied, i.e. (to + num).
This function runs in linear time.