- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Minimum Cuts can be made in the Chessboard such that it is not divided into 2 parts in C++

## Concept

Given A x B Chessboard, the task is to calculate the Maximum numbers of cuts that we can build in the Chessboard so that the Chessboard is not divided into 2 parts.

**Examples **

The examples are given below −

**Input **

A = 2, B = 4

**Output **

Number of maximum cuts = 3

**Input **

A = 2, B = 2

**Output **

Number of maximum cuts = 1

## Method

For A = 2, B = 2 ,we can only build 1 cut (mark in red). If we build 1 more cut then the chessboard will divide into 2 pieces

For A = 2, B = 4 ,we can makes 3 cuts (marks in red). If we build 1 more cut then the chessboard will divide into 2 pieces.

As a result of this, it can be observed that no. of cuts = (A-1) * (B-1).

## Example

//This is C++ implementation of above approach #include <bits/stdc++.h> using namespace std; // function that calculates the maximum no. of cuts int numberOfCuts1(int A, int B){ int result1 = 0; result1 = (A - 1) * (B - 1); return result1; } // Driver Code int main(){ int A = 4, B = 4; // Calling function. int Cuts = numberOfCuts1(A, B); cout << "Maximum cuts = " << Cuts; return 0; }

## Output

Maximum cuts = 9

- Related Questions & Answers
- Minimum Cuts can be made in the Chessboard such that it is not divided into 2 parts in Python
- Is pizza healthy? If not, can it be made healthy?
- Check if an array of 1s and 2s can be divided into 2 parts with equal sum in Python
- Check if array can be divided into two sub-arrays such that their absolute difference is Ks in Python
- Possible cuts of a number such that maximum parts are divisible by 3 in C++
- Check if any square (with one colored cell) can be divided into two equal parts in Python
- Maximum bishops that can be placed on N*N chessboard in C++
- Can array be divided into n partitions with equal sums in JavaScript
- Maximum elements that can be made equal with k updates in C++
- Find if array can be divided into two subarrays of equal sum in C++
- Check if an array can be divided into pairs whose sum is divisible by k in Python
- Place k elements such that minimum distance is maximized in C++
- Print all possible strings that can be made by placing spaces in C++
- Find the sums for which an array can be divided into subarrays of equal sum in Python
- Find alphabetical order such that words can be considered sorted in C++

Advertisements