C # implementation of the above approach
using System ; using System . Collections . Generic ; class GFG { static int M = 18 ; static int a , b ; static int [ , , , ] dp = new int [ M , 90 , 90 , 2 ] ;