#include #include #include #include #include #include #include int count; int grid[25][25]; void rec(int i,int j,int x,int y,int n,int num) { if(x<0 || y<0 || x>=n || y>=n) return; if(x==n-1 && y==n-1) { if(count==0) count=num; else if(num