Coding Test - cpp/Greedy
[백준 4796: 캠핑] - C++
에드윈H
2021. 2. 3. 21:03
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int a, b, c;
int day = 0;
int i = 1;
while (1) {
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0)
{
break;
}
day = (c / b)*a + min(c%b, a);
cout <<"Case "<<i<<": "<< day<<"\n";
i++;
}
return 0;
}