結果
| 問題 | No.2233 Average | 
| コンテスト | |
| ユーザー |  GlinTFraulein | 
| 提出日時 | 2023-03-03 23:59:16 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 308 ms / 2,000 ms | 
| コード長 | 816 bytes | 
| コンパイル時間 | 1,910 ms | 
| コンパイル使用メモリ | 192,636 KB | 
| 最終ジャッジ日時 | 2025-02-11 04:47:35 | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 18 | 
ソースコード
#include <bits/stdc++.h>
//#include <atcoder/all>
 
#define elif else if
#define ll long long
#define vll vector<long long>
#define vec vector
#define embk emplace_back
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep3(i, n, k) for (int i = k; i < (int)(n); i++)
#define all(a) a.begin(), a.end()
 
using namespace std;
//using namespace atcoder;
const ll INF = 1LL << 60;
const ll mod = 998244353;
void solve() {
  ll a, b, c, k; cin >> a >> b >> c >> k;
  
  k = min(100LL, k);
  rep(i, k) {
    ll d = (b+c) / 2;
    ll e = (a+c) / 2;
    ll f = (a+b) / 2;
    
    if (d == e && e == f) {
      cout << d+e+f << endl;
      return;
    }
    else {
      a = d;
      b = e;
      c = f;
    }
  }
  
  cout << a+b+c << endl;
  return;
}
int main() {
  ll t; cin >> t;
  rep(i, t) solve();
  
}
            
            
            
        