#include <iostream>
#include <algorithm>
int main () {
std::array<int, 9> arr = {3, 4, 8, -1, 9, 2, -7, 6, 0};
for (auto it = arr.begin() + 2; it != arr.end() - 3; it++) {
std::cout << *it << ' ';
}
if (std::any_of(arr.begin() + 2, arr.end() - 3, [](int n){return n < 0;}))
std::cout << "\nyes";
else
std::cout << "\nno";
return 0;
}
/*
run:
8 -1 9 2
yes
*/