abc176_a - Takoyaki
12 Dec 2020 — Tags: easy — URLThe answer is: \(t \times ceil(\frac{n}{x})\)
Time complexity: $O(1)$
Memory complexity: $O(1)$
Click to show code.
using namespace std;
int ceil(int a, int b) { return (a + b - 1) / b; }
int main(void)
{
ios::sync_with_stdio(false), cin.tie(NULL);
int n, x, t;
cin >> n >> x >> t;
cout << t * ceil(n, x) << endl;
return 0;
}