알고리즘

[알고리즘] 백준 15726 - 이칙연산 (C++)

blueberrysoda 2024. 9. 6. 23:41

[문제 링크] : https://www.acmicpc.net/problem/15726

#include <iostream>
using namespace std;

int main(){
    long long A, B, C;

    cin >> A >> B >> C;

    long long S = (double)(A * B) / C;
    long long T = ((double)A / B) * C;
    if(S > T){
        cout << S << "\n";
    }
    else{
        cout << T << "\n";
    }
    return 0;
}