- 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

Suppose we have one A x B chessboard (matrix), we have to calculate the maximum numbers of cuts that we can make in this board so that the board is not divided into 2 parts.

So, if the input is like A = 2 and B = 4,

then the output will be 3

To solve this, we will follow these steps −

- res := 0
- res :=(M - 1) *(N - 1)
- return res

Let us see the following implementation to get better understanding −

def max_cuts_count(M, N): res = 0 res = (M - 1) * (N - 1) return res M, N = 2, 4 Cuts = max_cuts_count(M, N) print(Cuts)

2,4

3

- Related Questions & Answers
- Minimum Cuts can be made in the Chessboard such that it is not divided into 2 parts in C++
- 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
- Is pizza healthy? If not, can it be made healthy?
- Check if any square (with one colored cell) can be divided into two equal parts in Python
- Possible cuts of a number such that maximum parts are divisible by 3 in C++
- Maximum bishops that can be placed on N*N chessboard in C++
- Check if an array can be divided into pairs whose sum is divisible by k in Python
- Can array be divided into n partitions with equal sums in JavaScript
- Find the sums for which an array can be divided into subarrays of equal sum in Python
- Program to find the length of the longest, that can be made using given letters in Python
- Check if array sum can be made K by three operations on it in Python
- Maximum elements that can be made equal with k updates in C++
- Find the minimum positive integer such that it is divisible by A and sum of its digits is equal to B in Python
- Find if array can be divided into two subarrays of equal sum in C++

Advertisements