#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,a,b,c; cin >> N >> a >> b >> c; vector> dxy = {{-1,0},{0,1},{1,0},{0,-1}}; if(N <= 3){ vector> A(N,vector(N)); auto dfs = [&](auto dfs,int pos) -> void { if(pos == N*N){ int one = 0,two = 0,three = 0; for(int i=0; i= N || nk >= N) continue; now |= 1<> A(N,vector(N)); if(a >= N){ for(int i=0; i= N){ for(int i=0; i