#include using namespace std; int T; int a,b,c,d,e; long mod=1e9+7; long comb[501][501],combsum[501][501]; long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;} main() { cin>>T>>a>>b>>c>>d>>e; comb[0][0]=1; combsum[0][0]=1; for(int i=1;i<=T;i++) { comb[i][0]=comb[i][i]=1; for(int j=1;j0) { L=max(L,D/(2*c)); if(2*c*LE)R--; } else { L=max(L,E/(-2*c)); if(2*c*L>E)L++; R=min(R,D/(-2*c)); if(2*c*R