Accepted solution

1080A - Petya and Origami

Open original problem
Source code

#include<bits/stdc++.h>

using namespace std;

int main(void)

{

    int n,m;

    int t,f,e;

    int ans=0;

    cin>>n>>m;

    t = 2*n;

    f=5*n;

    e=8*n;

     if(t%m==0)

     {

         ans +=t/m;

     }

     else

     {

         ans+= t/m;

         ans++;

     }

     if(f%m==0)

     {

         ans +=f/m;

     }

     else

     {

         ans+= f/m;

         ans++;

     }

    if(e%m==0)

     {

         ans +=e/m;

     }

     else

     {

         ans+= e/m;

         ans++;

     }

    cout<<ans<<endl;

    return 0;

}
Join the discussion

Add your comment