CodeforcesJul 10, 2025

Petya and Origami

Hazrat Ali

Codeforces

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.

Input

The first line contains two integers n and k (1n,k108) — 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


Solution

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, k;
  cin >> n >> k;
  int ans = ceil(2.0 * n / k) + ceil(5.0 * n / k) + ceil(8.0 * n / k);
  cout << ans << endl;
  return 0;
}





Comments