#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #define rep(i,n) for(int i=0;i<(n);i++) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define sz(x) ((int)(x).size()) #define pb push_back using ll = long long; using namespace std; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> a >> b >> c >> d >> p >> q; ll mx = -(1LL<<60), mn=1LL<<60; ll mxp=0,mnp=0; for(ll x=p;x<=q;x++){ if(chmax(mx,f(x))) mxp=x; if(chmin(mn,f(x))) mnp=x; } cout << mx << ' ' << mxp << ' ' << mn << ' ' << mnp << endl; return 0; }