#include using namespace std; struct Mast{ int n; int w; vector y; int &operator[](int i){ return y[i]; } int64_t area(){ return w*(int64_t)w; } Mast(){ cin>>n>>w; y.resize(n); for (auto &i: y){ cin>>i; } sort(y.begin(),y.end()); } }; int main(){ int gap; cin>>gap; Mast a,b,c; assert(a.w<=gap and b.w<=gap and c.w<=gap); int ab_off=(max(0,(a.w+b.w)-gap) + 1)/2; int bc_off=(max(0,(b.w+c.w)-gap) + 1)/2; vector ya,yb,yc; for (int i=0; i