A12214 | Petya and Origami
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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.
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.
输入格式
The first line contains two integers $n$ and $k$ ( $1\leq n, k\leq 10^8$ ) — the number of Petya's friends and the number of sheets in each notebook respectively.
输出格式
Print one number — the minimum number of notebooks that Petya needs to buy.
输入输出样例
输入 #1
3 5
输出 #1
10
输入 #2
15 6
输出 #2
38
In the first example, we need $2$ red notebooks, $3$ green notebooks, and $5$ blue notebooks.
In the second example, we need $5$ red notebooks, $13$ green notebooks, and $20$ blue notebooks.
In the second example, we need $5$ red notebooks, $13$ green notebooks, and $20$ blue notebooks.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted