Generate an N | C # program to implement the above approach ; Function to construct an array with sum of each subarray divisible by K ; Traverse a loop from 1 to N ; Print i - th multiple of K ; Driver Code
using System ; public class GFG { static void construct_Array ( int N , int K ) { for ( int i = 1 ; i <= N ; i ++ ) { Console . Write ( K * i + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int N = 3 , K = 3 ; construct_Array ( N , K ) ; } }