import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int getMax(int[] array) { int i = -1; int n = -1; for(int x = 0;xn) { n = array[x]; i = x; } } return array[i]; } static int getMin(int[] array) { int i = -1; int n = 1000000002; for(int x = 0;x=k) { int size = getSize(real_r,real_l); if(size>largest) { largest = size; } } } } } toreturn[i] = largest; } return toreturn; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int[] A = new int[n]; for(int A_i = 0; A_i < n; A_i++){ A[A_i] = in.nextInt(); } int[] result = costlyIntervals(n, k, A); for (int i = 0; i < result.length; i++) { System.out.print(result[i] + (i != result.length - 1 ? "\n" : "")); } System.out.println(""); in.close(); } }