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.

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

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.

题解:此题太水,基本都会

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
using namespace std; int main()
{
int n,k;
cin>>n>>k;
int red=n*/k;
int green=n*/k;
int blue=n*/k;
if(red<n*2.0/k)
{
red=red+;
}
if(green<n*5.0/k)
{
green=green+;
}
if(blue<n*8.0/k)
{
blue+=;
}
cout<<red+green+blue<<endl;
return ;
}

Petya and Origami的更多相关文章

  1. Codeforces Round #524 (Div. 2) A. Petya and Origami

    A. Petya and Origami 题目链接:https://codeforc.es/contest/1080/problem/A 题意: 给出n,k,k表示每个礼品里面sheet的数量(礼品种 ...

  2. CF1080A Petya and Origami 题解

    Content 小 P 想给 \(n\) 位朋友各发一张邀请函,每张邀请函需要耗费 \(2\) 张红色纸,\(5\) 张绿色纸和 \(8\) 张蓝色纸.商店里面的纸是一堆一堆卖的,每堆里面有 \(k\ ...

  3. Codeforces Round #524 (Div. 2)

    A. Petya and Origamitime limit per test1 secondmemory limit per test256 megabytesinputstandard input ...

  4. Codeforces Round #524 (Div. 2) Solution

    A. Petya and Origami Water. #include <bits/stdc++.h> using namespace std; #define ll long long ...

  5. CodeForces-Round524 A~D

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

  6. Codeforces Round #524 (Div.2)题解

    题解 CF1080A [Petya and Origami] 这道题其实要我们求的就是 \[\lceil 2*n/k \rceil + \lceil 5*n/k \rceil + \lceil 8*n ...

  7. Codeforces Round #524 (Div. 2)(前三题题解)

    这场比赛手速场+数学场,像我这样读题都读不大懂的蒟蒻表示呵呵呵. 第四题搞了半天,大概想出来了,但来不及(中途家里网炸了)查错,于是我交了两次丢了100分.幸亏这次没有掉rating. 比赛传送门:h ...

  8. Petya勒索木马

    同事小学妹神好奇心,在陌生群里下载了个软件,接下来就是自动重启无法开机. 找我一看,凭我专业帮妹纸装系统多年的经验,起初也不觉得有啥困难,兼容模式下重启,接下来出现这个: 按下any key后: 试了 ...

  9. Origami – 用于 Quartz 的免费的交互设计框架

    Origami 是一个为 Quartz Composer 开发的免费的工具包——由Facebook设计团队创建,让交互设计原型更加简单,不需要编程. 如今,大多数设计师通过创建静态原型来表达要实现的应 ...

随机推荐

  1. IDEA创建的Maven项目中 解决编写pom.xml没有提示

    问题如下 没有提示信息 解决方案 把Repositories中的配置更新成本地仓库 问题解决

  2. 开源项目weiciyuan运行前gradle调试过程记录

    折腾了几个小时,终于能成功运行了,由于该项目使用的gradle版本过旧,需要做一些调整,具体如下 1.将使用gradle版本号改为你现在用的 2.将build tools版本号改为同上 3.将defa ...

  3. JAVA反射机制学习随笔

    JAVA反射机制是用于在运行时动态的获取类的信息或者方法,属性,也可以用来动态的生成类,由于所有类都是CLASS的子类,我们可以用一个CLASS类的实例来实例化各种类 例如: Class<?&g ...

  4. interface 接口 和多态的含义

    <?php //interface关键字用于定义接口 interface ICanEat{ //接口里面的方法不需要方法的实现 public function eat($food) ; } // ...

  5. C/C++读写csv文件

    博客转载自:http://blog.csdn.net/u012234115/article/details/64465398 C++ 读写CSV文件,注意一下格式即可 #include <ios ...

  6. 数字图像处理实验(2):PROJECT 02-02, Reducing the Number of Gray Levels in an Image 标签: 图像处理MATLAB 2017-

    实验要求: Reducing the Number of Gray Levels in an Image Objective To understand how the number of gray ...

  7. noi.ac day5t1 count

    传送门 分析 首先一个很重要的性质是每个数至少出现一次 所以只有一个数会出现两次 我们只需要求出n+1个数选k个数的方案数再减去重复的部分即可 重复部分于两个相同数中间的距离有关,详见代码 代码 #i ...

  8. scala中同步块

    private def initializeIfNecessary() { if (!Logging.initialized) { Logging.initLock.synchronized { if ...

  9. SpringMVC @RequestBody 自动转json Http415错误

    转自: http://blog.csdn.net/tiantiandjava/article/details/46125141 项目中想用@RequestBody直接接收json串转成对象 网上查了使 ...

  10. hustOJ SPJ(special judge)模板

    #include <stdio.h> #include <math.h> #define PI acos(-1.0) #define AC 0 #define WA 1 int ...