If the lowest filling condition is void , then it is not possible to generate the required array
if ( n < mini ) { Console . Write ( " - 1" ) ; return ; } int rem = n - mini ; int cnt = rem / k ; rem = rem % k ;