
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
Maximum of smallest possible area that can get with exactly k cut of given rectangular in C++
In this tutorial, we will be discussing a program to find the maximum of smallest possible area that can get with exactly k cut of given rectangular.
For this we will be provided with the sides of the rectangle and the number of cuts that can be made. Our task is to calculate the smallest area that can be achieved by making the given number of cuts.
Example
#include <bits/stdc++.h> using namespace std; void max_area(int n, int m, int k) { if (k > (n + m - 2)) cout << "Not possible" << endl; else { int result; if (k < max(m, n) - 1) { result = max(m * (n / (k + 1)), n * (m / (k + 1))); } else { result = max(m / (k - n + 2), n / (k - m + 2)); } cout << result << endl; } } int main() { int n = 3, m = 4, k = 1; max_area(n, m, k); return 0; }
Output
6
- Related Articles
- Maximum area of rectangle possible with given perimeter in C++
- Maximum possible middle element of the array after deleting exactly k elements in C++
- Maximum array sum that can be obtained after exactly k changes in C++
- Maximum given sized rectangles that can be cut out of a sheet of paper in C
- Build Array Where You Can Find The Maximum Exactly K Comparisons in C++
- Program to find maximum possible value of smallest group in Python
- Maximum elements that can be made equal with k updates in C++
- C++ Program to Generate All Possible Subsets with Exactly k Elements in Each Subset
- Possible walks from a source to a destination with exactly k edges\n
- Area of the biggest possible rhombus that can be inscribed in a rectangle in C?
- Count all possible walks from a source to a destination with exactly k edges in C++
- Maximum number of segments that can contain the given points in C++
- Minimum Possible value of |ai + aj – k| for given array and k in C++
- C++ program to count maximum possible division can be made in a graph with given condition
- Count number of substrings with exactly k distinct characters in C++

Advertisements