text: Represent N as sum of K even numbers | C # implementation to represent N as sum of K even numbers ; Function to print the representation ; N must be greater than equal to 2 * K and must be even ; Driver Code
code: using System ; class GFG { static void sumEvenNumbers ( int N , int K ) { int check = N - 2 * ( K - 1 ) ; if ( check > 0 && check % 2 == 0 ) { for ( int i = 0 ; i < K - 1 ; i ++ ) { Console . Write ( "2 ▁ " ) ; } Console . WriteLine ( check ) ; } else { Console . WriteLine ( " - 1" ) ; } } static public void Main ( String [ ] args ) { int N = 8 ; int K = 2 ; sumEvenNumbers ( N , K ) ; } }