A. Petya and Origami
Petya is having a party soon, and he has decided to invite his nn friends.
He wants to make invitations in the form of origami. For each invitation, he needs two red sheets, five green sheets, and eight blue sheets. The store sells an infinite number of notebooks of each color, but each notebook consists of only one color with kk sheets. That is, each notebook contains kk sheets of either red, green, or blue.
Find the minimum number of notebooks that Petya needs to buy to invite all nn of his friends.
Input
The first line contains two integers nn and kk (1≤n,k≤1081≤n,k≤108) — the number of Petya’s friends and the number of sheets in each notebook respectively.
Output
Print one number — the minimum number of notebooks that Petya needs to buy.
Examples
inputCopy
3 5
outputCopy
10
inputCopy
15 6
outputCopy
38
Note
In the first example, we need 2 red notebooks, 3 green notebooks, and 5 blue notebooks.
In the second example, we need 5 red notebooks, 13 green notebooks, and 20 blue notebooks.
#include <iostream>
using namespace std;
int main()
{
int n, m;
while(cin >> n >> m)
{
int sum = 0;
sum += (2 * n / m) + (2 * n % m > 0 ? 1 : 0);
sum += (5 * n / m) + (5 * n % m > 0 ? 1 : 0);
sum += (8 * n / m) + (8 * n % m > 0 ? 1 : 0);
cout << sum << '\n';
}
return 0;
}