本文介绍了使用较小的正方形构造大正方形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在边缘N上有一个大的正方形.我想使用边值从1N-1的较小正方形来计算构造这个较大正方形所需的小的正方形数目.我有无数个这样的小正方形.唯一的限制是我必须使用minimum个小正方形.例如,如果N = 3,则可以使用5个大小为1的正方形构建正方形. 2大小的平方.对于任何给定的N值,我该如何解决这个问题?

I have a large square of edge N. I want to calculate the number of small squares required to construct this large square using smaller squares with edge values from 1 to N-1. I have unlimited number of such small squares.The only restriction is that I have to use the minimum number of smaller squares.For example,if N=3, I can construct this square using 5 squares of size 1 and 1 square of size 2. How can I solve this problem for any given value of N?

推荐答案

对于N,甚至可以使用边N/2的4个正方形,这是可能的最小值.对于奇数N,它要复杂一些.奇数N的一种可能解决方案是(N+1)/2的一个平方,(N-1)/2的3和大小为1的N-1,但是我不完全确定这是最小的.例如,如果N=9,这将得到12个正方形,其中存在9个3x3正方形的更好解决方案.不过,它可能是素数N的最佳解决方案.

For even N, you can use 4 squares of side N/2, which is the minimum possible. For odd N, it's a bit more complicated. One possible solution for odd N is one square of (N+1)/2, 3 of (N-1)/2, and N-1 of size 1, but I'm not entirely sure that's minimal... For example, if N=9, this would give 12 squares, where a better solution of 9 3x3 squares exists. It might be the best solution for prime N, though.

这篇关于使用较小的正方形构造大正方形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-15 00:01