#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <array>
#include <cstdint>
#include <iomanip>
template <typename Iter>
std::string hex_str(Iter begin, Iter end)
{
std::ostringstream output;
output << std::hex << std::setw(2) << std::setfill('0');
while(begin != end)
output << static_cast<unsigned>(*begin++);
return output.str();
}
template<typename C>
std::string hex_str(const C &data) {
return hex_str(data.begin(), data.end());
}
int main() {
std::array<uint8_t, 5> arr = {0x79, 0x6c, 0x65, 0x6f};
std::cout << hex_str(arr.begin(), arr.end()) << std::endl;
std::cout << hex_str(arr) << std::endl;
std::vector<uint8_t> vec = {0x79, 0x6c, 0x65, 0x6f};
std::cout << hex_str(vec.begin(), vec.end()) << std::endl;
std::cout << hex_str(vec) << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGFycmF5PgojaW5jbHVkZSA8Y3N0ZGludD4KI2luY2x1ZGUgPGlvbWFuaXA+Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgSXRlcj4Kc3RkOjpzdHJpbmcgaGV4X3N0cihJdGVyIGJlZ2luLCBJdGVyIGVuZCkKewoJc3RkOjpvc3RyaW5nc3RyZWFtIG91dHB1dDsKCW91dHB1dCA8PCBzdGQ6OmhleCA8PCBzdGQ6OnNldHcoMikgPDwgc3RkOjpzZXRmaWxsKCcwJyk7Cgl3aGlsZShiZWdpbiAhPSBlbmQpCgkJb3V0cHV0IDw8IHN0YXRpY19jYXN0PHVuc2lnbmVkPigqYmVnaW4rKyk7CglyZXR1cm4gb3V0cHV0LnN0cigpOwp9Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBDPgpzdGQ6OnN0cmluZyBoZXhfc3RyKGNvbnN0IEMgJmRhdGEpIHsKICAgIHJldHVybiBoZXhfc3RyKGRhdGEuYmVnaW4oKSwgZGF0YS5lbmQoKSk7Cn0KCmludCBtYWluK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