#include <iostream>
#include <algorithm>
template <typename T, size_t N> const T* mybegin(const T (&a)[N]) { return a; }
template <typename T, size_t N> const T* myend (const T (&a)[N]) { return a+N; }
int main()
{
const int cloud[] = { 1,2,3,4,-7,999,5,6 };
std::cout << *std::max_element(mybegin(cloud), myend(cloud)) << '\n';
std::cout << *std::min_element(mybegin(cloud), myend(cloud)) << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHNpemVfdCBOPiBjb25zdCBUKiBteWJlZ2luKGNvbnN0IFQgKCZhKVtOXSkgeyByZXR1cm4gYTsgfSAgICAKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHNpemVfdCBOPiBjb25zdCBUKiBteWVuZCAgKGNvbnN0IFQgKCZhKVtOXSkgeyByZXR1cm4gYStOOyB9CgppbnQgbWFpbigpCnsKCWNvbnN0IGludCBjbG91ZFtdID0geyAxLDIsMyw0LC03LDk5OSw1LDYgfTsKCglzdGQ6OmNvdXQgPDwgKnN0ZDo6bWF4X2VsZW1lbnQobXliZWdpbihjbG91ZCksIG15ZW5kKGNsb3VkKSkgPDwgJ1xuJzsKCXN0ZDo6Y291dCA8PCAqc3RkOjptaW5fZWxlbWVudChteWJlZ2luKGNsb3VkKSwgbXllbmQoY2xvdWQpKSA8PCAnXG4nOwp9Cg==