【CF 1080A】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

input

3 5

output

10

input

15 6

output

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.

 

代码:

#include<iostream>
#include<cmath>
using namespace std;
#define ll long long

int main()
{
	ll a,b,c,x,y;
	cin>>x>>y;
	a=x*2/y;
	b=x*5/y;
	c=x*8/y;
	if(x*2%y!=0)
		a++;
	if(x*5%y!=0)
		b++;
	if(x*8%y!=0)
		c++;
	cout<<a+b+c<<endl;
	return 0;
}

 

全部评论

相关推荐

谁知道呢_:要掉小珍珠了,库库学三年,这个结果
点赞 评论 收藏
分享
本人一直追求WLB,对大小周深恶痛疾,刷到小红书说取消大小周大喜,看来跳槽的选择又多一个了
一枚大铁锤:至于冲不冲小红书,这是个问题,我先声明我不是这方面的专家,我觉得这件事还是要慎重评论,你问我为什么不给出回答,因为我一开始就说了,我不是这方面的专家
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务