#include <vector>
#include <tuple>
#include <algorithm>
template<class... Ts>
std::vector<std::tuple<Ts...>> zip(std::vector<Ts> const&... vs){
auto lo = std::min({vs.size()...});
std::vector<std::tuple<Ts...>> v;
v.reserve(lo);
for(unsigned i = 0; i < lo; ++i)
v.emplace_back(vs[i]...);
return v;
}
#include <iostream>
int main(){
std::vector<int> a{1,3,5}, b{2,4,6}, c{3,5,7};
for(auto&& t : zip(a, b, c)){
std::cout << std::get<0>(t) << ":" << std::get<1>(t) << ":" << std::get<2>(t) << "\n";
}
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHR1cGxlPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKdGVtcGxhdGU8Y2xhc3MuLi4gVHM+CnN0ZDo6dmVjdG9yPHN0ZDo6dHVwbGU8VHMuLi4+PiB6aXAoc3RkOjp2ZWN0b3I8VHM+IGNvbnN0Ji4uLiB2cyl7CiAgICBhdXRvIGxvID0gc3RkOjptaW4oe3ZzLnNpemUoKS4uLn0pOwogICAgc3RkOjp2ZWN0b3I8c3RkOjp0dXBsZTxUcy4uLj4+IHY7CiAgICB2LnJlc2VydmUobG8pOwogICAgZm9yKHVuc2lnbmVkIGkgPSAwOyBpIDwgbG87ICsraSkKICAgICAgICB2LmVtcGxhY2VfYmFjayh2c1tpXS4uLik7CiAgICByZXR1cm4gdjsKfQoKI2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKXsKICAgIHN0ZDo6dmVjdG9yPGludD4gYXsxLDMsNX0sIGJ7Miw0LDZ9LCBjezMsNSw3fTsKICAgIGZvcihhdXRvJiYgdCA6IHppcChhLCBiLCBjKSl7CiAgICAgICAgc3RkOjpjb3V0IDw8IHN0ZDo6Z2V0PDA+KHQpIDw8ICI6IiA8PCBzdGQ6OmdldDwxPih0KSA8PCAiOiIgPDwgc3RkOjpnZXQ8Mj4odCkgPDwgIlxuIjsKICAgIH0KfQ==