蓝桥/16/B.2/产值调整

点击查看代码
#include<bits/stdc++.h>
using namespace std;

int t;

void solve()
{
    long long  a,b,c,k;
    cin>>a>>b>>c>>k;
    while(k--){
        if(a==b&&b==c){
            break;
        }
        long long x,y,z;
        x=(a+b)/2;
        y=(a+c)/2;
        z=(b+c)/2;
        a=z,b=y,c=x;
    }
    
    cout<<a<<' '<<b<<' '<<c<<"\n";
}

int main()
{
    ios::sync_with_stdio(0),cin.tie(0);
    cin>>t;
    while(t--){
        solve();
    }
    
    return 0;
}
posted @ 2026-03-02 20:07  AnoSky  阅读(0)  评论(0)    收藏  举报