Internship Preparation

0

0 votes
Easy
Problem

Ritesh is an IT under-graduate. He is going to sit for an internship test. He was preparing for the test one night and came across a question. The question was:

You have been given a chip of size n x m. Your task is to cut that piece of the chip into smaller identical chips such that each piece of the chip that is cut from the original chip is a square having maximum possible side length. You need to take care of the wastage also. Your task is to cut original chip into smaller pieces such that there is no wastage. 

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

The 1st test case has a chip whose original dimensions are, the chip is uncut and is a square. Hence the answer is 1. 

Editor Image

?