Find the smallest pair of integer sided rectangles that fit the following criteria:
The first has three times the area of the second and
the second has three times the perimeter of the first.
The smallest pair in both senses (area and perimeter) is a 15x22 and a 1x110. The table shows no set is smaller in either consideration.
large first rectangle's
h w h w area semi-perimeter
15 22 1 110 330 37
12 35 1 140 420 47
11 48 1 176 528 59
31 42 2 217 1302 73
30 44 2 220 1320 74
26 57 2 247 1482 83
24 70 2 280 1680 94
10 87 1 290 870 97
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For tot = 1 To 100
tot2 = 3 * tot
For a = 1 To tot / 2
b = tot - a
For c = 1 To tot2 / 2
d = tot2 - c
If a * b = 3 * c * d Then
Text1.Text = Text1.Text & a & Str(b) & " " & Str(c) & Str(d)
Text1.Text = Text1.Text & " " & a * b & " " & a + b & crlf
End If
DoEvents
Next
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
|
Posted by Charlie
on 2017-07-03 14:24:05 |