【Codeforces Round #476 (Div. 2) [Thanks, Telegram!] A】Paper Airplanes

【Link】 I am the link, click on me :)【Title】


enter question here

【answer】


Count the number of sheets each person needs.
Multiply by k
and then divide by p is the number of packs needed

【Code】

#include <bits/stdc++.h>
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;

const double pi = acos(-1);
const int dx[4] = {0,0,1,-1};
const int dy[4] = {1,-1,0,0};

int k,n,s,p;

int main(){
    #ifdef LOCAL_DEFINE
        freopen("rush_in.txt", "r", stdin);
    #endif
    ios::sync_with_stdio(0),cin.tie(0);
    cin >> k >> n >> s >> p;
    int need = (n-1)/s+1;
    need*=k;
    need=(need-1)/p+1;
    cout<<need<<endl;

    return 0;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324940339&siteId=291194637