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. Decorator模式 装饰器模式

    Android 使用了装饰器模式 1. 概述 若你从事过面向对象开发,实现给一个类或对象增加行为,使用继承机制,这是所有面向对象语言的一个基本特性.如果已经存在的一个类缺少某些方法,或者须要给方法添加 ...

  2. wait命令

    wait命令用来等待指令的指令,直到其执行完毕后返回终端.该指令常用于shell脚本编程中,待指定的指令执行完成后,才会继续执行后面的任务.该指令等待作业时,在作业标识号前必须添加备份号"% ...

  3. PHP的count(数组)和strlen(字符串)的内部实现

    PHP的count(数组)和strlen(字符串)的内部实现上是直接显示一个长度变量,还是重头依次数一遍有多少个元素?关乎我理解这2个函数的效率..希望高人能从php的c源码上讲一讲.没有源码看过源码 ...

  4. java过滤器 Fliter

    定义:过滤器是一个服务器端组件,他可以截取用户端请求信息与响应信息,并对信息进行过滤 例:当进入csdn要进行文章编辑时,检测用户是否登录,若未登录,跳转到登录界面. 过滤器操作方法: init() ...

  5. 触摸屏、X11去掉鼠标

    cursor disable in X11 Last updated 8 years ago 摘自:http://www.noah.org/wiki/cursor_disable_in_X11 Whe ...

  6. Swingr的JTextField、JPasswordField设置圆角输入框

    方法1:定义Border,然后给JTextField设置即可 摘自并整理:https://blog.csdn.net/u012093968/article/details/39316679 最好添加这 ...

  7. [译]Javascript中的mutators

    本文翻译youtube上的up主kudvenkat的javascript tutorial播放单 源地址在此: https://www.youtube.com/watch?v=PMsVM7rjupU& ...

  8. WPF之MVVM模式(1)

    MVVM模式 一.MVVM模式概述 MVVM Pattern : Model\View\ViewModel View:视图.UI界面 ViewModel:ViewModel是对Model的封装,通过一 ...

  9. c#百分比计算

    //此方法得到的百分比后小数太多,不行double percent=Convert.ToDouble(2)/Convert.ToDouble(34); string result=(percent*1 ...

  10. EIP权限工作流升级说明-2019/3/5

    首页增加待办事项直接处理按钮 2,新增处理历史记录