#include using namespace std; using ll = long long; using P = pair; #define fix(x) fixed << setprecision(x) #define asc(x) x, vector, greater #define rep(i, n) for(ll i = 0; i < n; ++i) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> l >> n; int z = 0; vector> bit(2,0); auto v = bit; bit[0][100000] = 1; rep(i,n+1){ int x; if(i==n) x = l; else cin >> x; int y = x-z; auto upd = v; upd[0] |= bit[0] << y; if(i){ upd[1] |= bit[1]>>y; upd[1] |= bit[0]>>y; upd[0] |= bit[1]<