#include #include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) #define all(x) begin(x), end(x) template bool chmin(T &x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T &x, T y) { return x < y ? (x = y, true) : false; } struct IOST { IOST() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(20); } } IOST; int main(){ ll a,b,c,d,n; ll p,q,r,s,t; cin>>a>>b>>c>>d>>n; cin>>p>>q>>r>>s>>t; rep(x,0,a+1) rep(y,0,b+1){ ll nn=n-x-y; if(nn<0) break; ll tt=t-p*x-q*y; if(tt<0) break; if(r==s){ if(r*nn!=tt) continue; if(nn>c+d) continue; ll tmp=min(nn,c); assert(nn-tmp<=d); cout<c) continue; ll tw=nn-tz; if(tw<0||tw>d) continue; cout<