P14333 [GeeksforGeeks] Squares in reactangle3340
普及-
题目描述

Given a rectangle of size L x B. Find the minimum number of squares required to fill the rectangle such that no two square overlaps.
Example 1:
Input: L = 4, B = 5
Output: 5
Explaination: One 44 square and four 11
squares are required.
Example 2:
Input: L = 2, B = 4
Output: 2
Explaintion: Two 2*2 squares are enough to
fill the rectangle.
Your Task:
You do not need to read input or print anything. Your task is to complete the function minSquares() which takes L and B as input parameters and returns minimum number of squares required to fill the rectangle. Return the answer modulo 10^{9} + 7.
Expected Time Complexity: O(log(max(L, B)))
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ L, B ≤ 10^{10}

输入格式

见题面

输出格式

见题面

样例输入
L = 4, B = 5
样例输出
5