#P7038. [NWRRC 2016] Hard Cuts
[NWRRC 2016] Hard Cuts
题目描述
Given a rectangle with integer side lengths, your task is to cut it into the smallest possible number with integer side lengths.
输入格式
The first line contains a single integer -- the number of test cases . Each of the lines contains two integers -- the dimensions of the rectangle ; for any or
输出格式
For the i-th test case, output -- the minimal number of squares, such that it is possible to cut by rectangle into squares. The following should contain three integers each: coordinates of the bottom-left corner of the j-th square and its side length The bottom-left corner of the rectangle has coordinates and the top-right coordinates
题目大意
题目描述
给定一个边长为整数的矩形,您的任务是将其切割成边长为整数的正方形的尽可能少的正方形。
提示
Time limit: 2 s, Memory limit: 256 MB.