ll@++(N,A,B),@(X,Y)[N-1];VI Z(A,B);VVI D(N,Z);D[0][0]=0;REP(i,N-1)rrep(c,1,N)rrep(a,X[i],A)Z[c]