题目链接:Codeforces 417E Square Table
题目大意:给出n和m,要求给出一个矩阵,要求每一列每一行的元素的平方总和是一个平方数。
解题思路:构造,按照
a a a b
a a a b
a a a b
c c c d
的方式取构造,然后a,b,c,d的值用随机生成数去枚举,不过我觉得用暴力也是可以的。
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib&