#P7038. [NWRRC2016] Hard Cuts
[NWRRC2016] 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 $(0 \le x_{ij} \le w_{i} − l_{ij} ; 0 \le y_{ij} \le h_{i} −l_{ij} ).$ The bottom-left corner of the rectangle has coordinates and the top-right coordinates
题目大意
题目描述
给定一个边长为整数的矩形,您的任务是将其切割成边长为整数的正方形的尽可能少的正方形。
3
5 3
5 6
4 4
4
0 0 3
3 0 2
3 2 1
4 2 1
5
0 0 2
0 2 2
0 4 2
2 0 3
2 3 3
1
0 0 4
提示
Time limit: 2 s, Memory limit: 256 MB.