Geeksforgeeks

X

DAYS

:

HOUR

:

MINS

:

SEC

Error

Copied to Clipboard

Given two numbers **M and N**, which represents the length and breadth of a paper, the task is to cut the paper into squares of any size and find the minimum number of squares that can be cut from the paper.

**Example 1:**

Input: M = 36, N = 30Output:5Explanation: 3 (squares of size 12x12) + 2 (squares of size 18x18)

**Example 2:**

**Input: **M = 4, N = 5
**Output: **5
**Explanation**:

```
1 (squares of size 4x4) +
4 (squares of size 1x1)
```

**Your Task: **

You don't need to read input or print anything. Complete the function ** minCut() **which takes

1 ≤ M, N ≤ 10

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

YesLoading...

Min cut Square

...