a005. Eva 的回家作業 5/16/2025

解法一

✅ 完整代碼

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;
    
    int a, b, c, d;
    for(int i=0; i<t; i++){
        cin >> a >> b >> c >> d;
        cout << a << " " << b << " " << c << " " << d << " ";
        
        if(b/a == d/c) cout << d * (d/c) << "\n";
        else cout << d + (d-c) << "\n";
    }
    
    return 0;
}