#include <print>
#include <vector>
#include <numeric>
// const& passes the vector by reference, copying nothing
long sum(const std::vector<long>& v) {
return std::accumulate(v.begin(), v.end(), 0L);
}
int main() {
std::vector<long> data(1000);
std::iota(data.begin(), data.end(), 1);
std::println("{}", sum(data));
}const& avoids copying a whole vector