Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
scanf("%d %d", &n, &k);
int r = n * 2;
int g = n * 5;
int b = n * 8;
int res = ceil(1.0 * r / k) + ceil(1.0 * g / k) + ceil(1.0 * b / k);
printf("%d\n", res);
return 0;
}
Copy The Code &
Try With Live Editor
Input
3 5
Output
10
Demonstration
Codeforcess Solution-A. Petya and Origami-Solution in C, C++, Java, Python,Codeforcess Solution,Petya and Origami