#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while(t--) { long long a,b,c,K; cin >> a >> b >> c >> K; while(K--) { long long A = (b+c)/2,B = (a+c)/2,C = (a+b)/2; a = A,b = B,c = C; if(a == b && b == c) break; } cout << a+b+c << "\n"; } }