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
#include <bits/stdc++.h> NEW_LINE using namespace std ; int mod = 1e9 + 7 ; #define MAX  301 NEW_LINE #define MAXP  3 NEW_LINE #define MAXK  600 NEW_LINE #define MAXPREV  4 NEW_LINE int dp [ MAX ] [ MAXP + 1 ] [ MAXK ] [ MAXPREV + 1 ] ;