#include using namespace std; int find(int l,int r,vector A){ vector res(4); res[0]=A[l]; res[1]=A[l]; res[2]=A[l]; res[3]=A[l]; for(int x=l+1;x<=r;x++){ if(A[x]>res[0]) res[0]=A[x]; if(A[x] costlyIntervals(int n, int k, vector A) { vector out(n); for(int v=0;v=k){ int size=j-i+1; for(int y=i;y<=j;y++) { if(out[y]> n >> k; vector A(n); for(int A_i = 0; A_i < n; A_i++){ cin >> A[A_i]; } vector result = costlyIntervals(n, k, A); for (ssize_t i = 0; i < result.size(); i++) { cout << result[i] << (i != result.size() - 1 ? "\n" : ""); } cout << endl; return 0; }