C # implementation to find the number of ways to paint K cells of 3 x N grid such that No two adjacent cells are painted
using System ; class GFG { static int mod = ( int ) ( 1e9 + 7 ) ; static readonly int MAX = 301 ; static readonly int MAXP = 3 ; static readonly int MAXK = 600 ; static readonly int MAXPREV = 4 ; static int [ , , , ] dp = new int [ MAX , MAXP + 1 , MAXK , MAXPREV + 1 ] ;