/* **************************************************************** **************************************************************** -> Coded by Stavros Chryselis -> Visit my github for more solved problems over multiple sites -> https://github.com/StavrosChryselis -> Feel free to email me at stavrikios@gmail.com **************************************************************** **************************************************************** */ #include #include #define MAX 1000005 typedef long long int LL; LL dp[MAX][4]; LL arr[MAX][4]; LL N,M; FILE* out; bool inbounds(int i,int j) { if(i>=0 && i<=N && j>=0 && j<=M) return true; return false; } LL min(LL a,LL b) { if(a>b) return b; return a; } void solve(int index) { for(int i=0;i