結果

問題 No.1423 Triangle of Multiples
ユーザー 👑 CleyL
提出日時 2022-09-21 14:34:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 638 ms
コンパイル使用メモリ 67,216 KB
最終ジャッジ日時 2025-02-07 13:20:39
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
void solve(){
  int a,b,c;cin>>a>>b>>c;
  if(a<=b && a<=c){
    int sm = b+c;
    int mx = max(b,c);
    //mx <= a < sm
    cout << (mx+a-1)/a*a << " " << b << " " << c << endl;
  }else if(b<=a && b<=c){
    int sm = a+c;
    int mx = max(a,c);
    cout << a << " " << (mx+b-1)/b*b << " " << c << endl;
  }else{
    int sm = a+b;
    int mx = max(a,b);
    cout << a << " " << b << " " << (mx+c-1)/c*c << endl;
  }
}

int main(){
  int t;cin>>t;
  for(int i = 0; t > i; i++)solve();
}
0