P10570求调
  • 板块灌水区
  • 楼主S_Z_Xcoco
  • 当前回复9
  • 已保存回复9
  • 发布时间2024/6/9 15:07
  • 上次更新2024/6/9 18:07:11
查看原帖
P10570求调
918508
S_Z_Xcoco楼主2024/6/9 15:07
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    long long t;
    cin>>t;
    while(t--){
        long long a,b,c;
        cin>>a>>b>>c;
        if(a>b)swap(a,b);
        long long ta,tb;
        if((b*c)%a!=0)c+=a-(b*c)%a;
        tb=c;
        ta=b*c/a;
        cout<<ta+tb<<'\n';
    }
    return 0;
}
2024/6/9 15:07
加载中...