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

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 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 1≤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

In the first example, we need 5 blue notebooks.

In the second example, we need 20 blue notebooks.

 

题解:水题;向上取证即可;

参考代码:

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define cls(x, val) memset(x,val,sizeof(x))
 4 typedef long long ll;
 5 typedef unsigned long long ull;
 6 const int INf=0x3f3f3f3f;
 7 double n,k,n1,n2,n3;
 8 int main()
 9 {
10     scanf("%lf%lf",&n,&k);
11     n1=2*n,n2=5*n,n3=8*n;
12     int sum=ceil(n1/k)+ceil(n2/k)+ceil(n3/k);
13     printf("%d\n",sum);
14     
15     return 0;
16 } 
View Code

相关文章: