C # program to count numbers in a range with digit sum divisible by K having first and last digit different
using System ; using System . Collections . Generic ; class GFG { static int K ; static int N ; static List < int > v = new List < int > ( ) ; static int [ , , , , ] dp = new int [ 20 , 1000 , 10 , 2 , 2 ] ; static void init ( int x ) { for ( int i = 0 ; i < 20 ; i ++ ) for ( int j = 0 ; j < 1000 ; j ++ ) for ( int k = 0 ; k < 10 ; k ++ ) for ( int l = 0 ; l < 2 ; l ++ ) for ( int m = 0 ; m < 2 ; m ++ ) dp [ i , j , k , l , m ] = - 1 ;