#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> T; while(T--){ ll a,b,c; cin >> a >> b >> c; ll K; cin >> K; while(K--){ ll na = (b+c)/2; ll nb = (a+c)/2; ll nc = (a+b)/2; a = na; b = nb; c = nc; if(a==b && b==c) break; } cout << a+b+c << '\n'; } return 0; }