Codeforces Round #524 A

                                                                          A. Petya and Origami

standard output

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

input

3 5

output

10

input

15 6

output

38

还是CF的水题做的开心

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int n, k;
	cin >> n >> k;
	int r = n * 2;
	int g = n * 5;
	int b = n * 8;
	cout << (r - 1) / k + (g - 1) / k + (b - 1) / k + 3 << endl;
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_41695941/article/details/84582945