Official

A - Competition Editorial by en_translator


If you are new to learning programming and do not know where to start, please try Problem A “Welcome to AtCoder” from practice contest. There you can find a sample code for each language.


If Supermarket Takahashi want to sell the beef pack at the same price per gram to that of Supermarket Snuke, he can sell it at \(\dfrac{YZ}X\) yen.
Actually, he will sell it at a maximum integral price less than that, so the answer is \(\left\lfloor\dfrac{YZ - 1}X\right\rfloor\).

Sample Code (C++)

#include <iostream>
using namespace std;

int main(){
    int X, Y, Z;
    cin >> X >> Y >> Z;
    cout << (Y * Z - 1) / X << endl;
}

Sample Code (Python)

X, Y, Z = map(int, input().split())
print((Y * Z - 1) // X)

Sample Code (dc)

?*1-r/p

posted:
last update: