#include #include #include using namespace std; using ull = __int128; using ll = long long; std::ostream &operator<<(std::ostream &dest, __int128_t value) { std::ostream::sentry s(dest); if (s) { __uint128_t tmp = value < 0 ? -value : value; char buffer[128]; char *d = std::end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = std::end(buffer) - d; if (dest.rdbuf()->sputn(d, len) != len) { dest.setstate(std::ios_base::badbit); } } return dest; } __int128 p(string &s) { __int128 ret = 0; for (int i = 0; i < s.length(); i++) if ('0' <= s[i] && s[i] <= '9') ret = 10 * ret + s[i] - '0'; return ret; } ll gcd(ll a,ll b) { if (a%b == 0) { return(b); } else { return(gcd(b, a%b)); } } ll z(ll a,ll b){ if(a>a; vector n(a); for(int i=0;i>n.at(i); } sort(n.begin(), n.end()); if(a%2==1){ ll k=n.at((a-1)/2); ll ans=0; for(int i=0;i