알고리즘

[알고리즘] 백준 2783 - 삼각 김밥 (C++)

blueberrysoda 2024. 11. 9. 23:42

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

#include <iostream>
using namespace std;

int main(){
    double A, B, N, Ans;
    cin >> A >> B >> N;
    Ans = A / B;
    
    for(int i=0; i<N; i++){
        cin >> A >> B;
        if(Ans > A / B){
            Ans = A / B;
        }
    }
    cout << fixed;
    cout.precision(2);
    cout << Ans*1000 << "\n";
    return 0;
}