Codeforces•May 19, 2025
Paper Airplanes
Hazrat Ali
Codeforces
A group of kk people decided to make nn airplanes each. They are going to buy several packs of paper, each of them containing pp sheets, and then distribute the sheets between the people. Each person should have enough sheets to make nn airplanes. How many packs should they buy?
Input
The only line contains four integers kk, nn, ss, pp (1≤k,n,s,p≤1041≤k,n,s,p≤104) — the number of people, the number of airplanes each should make, the number of airplanes that can be made using one sheet and the number of sheets in one pack, respectively.
Output
Print a single integer — the minimum number of packs they should buy.
Examples
Input
5 3 2 3
Output
4
Input
5 3 100 1
Output
5
Solution
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, p;
cin >> a >> b >> c >> p;
int temp = -1;
for (int i = 0; temp == -1; i++) {
int m = i * p / a;
if (c * m >= b) {
temp = i;
break;
}
}
cout << ans << endl;
return 0;
}