#include #include #include #include using namespace std; typedef long long LL; typedef pair PLL; PLL x[5],y[5]; bool cmp1(const PLL &x,const PLL &y) {return x.first>y.first;} bool cmp2(const PLL &x,const PLL &y) {return x.first0) sort(x,x+5,cmp1); else sort(x,x+5,cmp2); if(b>0) sort(y,y+5,cmp1); else sort(y,y+5,cmp2); } } LL ans=-1e20; for(int i=0;i