import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int[] costlyIntervals(int n, int k, int[] a) { // Return a list of length n consisting of the answers int i,j; int or,and,min,max,cost; int [] ans = new int [n]; for(i=0;imax) max = a[i]; if(a[i]max) max = a[j]; if(a[j]=k) { for(int x=i;x<=j;x++) { if(ans[x]