Algorithm


A. Petya and Origami
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Petya is having a party soon, and he has decided to invite his n 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 k sheets. That is, each notebook contains k sheets of either red, green, or blue.

Find the minimum number of notebooks that Petya needs to buy to invite all n of his friends.

Input

The first line contains two integers n and k (1n,k1081≤�,�≤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
input
Copy
3 5
output
Copy
10
input
Copy
15 6
output
Copy
38
Note

In the first example, we need 22 red notebooks, 33 green notebooks, and 55 blue notebooks.

In the second example, we need 55 red notebooks, 1313 green notebooks, and 2020 blue notebooks.

 



 

Code Examples

#1 Code Example with C++ Programming

Code - C++ Programming

#include <bits/stdc++.h>

using namespace std;

int n, k;

int main() {
  scanf("%d %d", &n, &k);

  int r = n * 2;
  int g = n * 5;
  int b = n * 8;

  int res = ceil(1.0 * r / k) + ceil(1.0 * g / k) + ceil(1.0 * b / k);

  printf("%d\n", res);

  return 0;
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
3 5

Output

x
+
cmd
10
Advertisements

Demonstration


Codeforcess Solution-A. Petya and Origami-Solution in C, C++, Java, Python,Codeforcess Solution,Petya and Origami

Previous
Codeforces solution 1080-B-B. Margarite and the best present codeforces solution
Next
CodeChef solution DETSCORE - Determine the Score CodeChef solution C,C+