If S can cannot be represented as sum of K integers
if ( S < min_sum S > max_sum ) { Console . WriteLine ( " - 1" ) ; return ; } int s1 = 0 ; List < int > nums = new List < int > ( ) ; for ( int i = 1 ; i <= N ; i ++ ) {