Get Integer sided triangles for which the area/perimeter ratio is integral

Problem:

Consider the triangle with sides 6, 8 and 10. It can be seen that the perimeter and the area are both equal to 24. So the area/perimeter ratio is equal to 1.
Consider also the triangle with sides 13, 14 and 15. The perimeter equals 42 while the area is equal to 84. So for this triangle the area/perimeter ratio is equal to 2.

Try to find Integer sided triangles for which the area/perimeter ratio is integer: r

Solution was from : Goehl's Problem

It returns:

Ratio Perimeter Area Triangle
----------------------------------------
11 471420 5185620 (486,235225,235709)
11 236682 2603502 (487,117855,118340)
11 119316 1312476 (489,59170,59657)
11 95844 1054284 (490,47433,47921)
11 48906 537966 (495,23959,24452)
11 44640 491040 (496,21825,22319)
11 25452 279972 (505,12222,12725)
11 23322 256542 (507,11155,11660)
11 12696 139656 (529,5820,6347)
11 10584 116424 (540,4753,5291)
11 6972 76692 (582,2905,3485)
11 6426 70686 (595,2619,3212)
11 6060 66660 (606,2425,3029)
11 4746 52206 (679,1695,2372)
11 4512 49632 (705,1552,2255)
11 4362 47982 (727,1455,2180)
11 3924 43164 (873,1090,1961)
11 3876 42636 (969,970,1937)
11 119070 1309770 (245,59292,59533)
11 60024 660264 (246,29768,30010)
11 30504 335544 (248,15006,15250)
11 15750 173250 (252,7625,7873)
11 11730 129030 (255,5612,5863)
11 6384 70224 (266,2928,3190)
11 3744 41184 (288,1586,1870)
11 3030 33330 (305,1212,1513)
11 2490 27390 (332,915,1243)
11 2190 24090 (365,732,1093)
11 2184 24024 (366,728,1090)
11 1944 21384 (486,488,970)
11 80190 882090 (165,39933,40092)
11 15120 166320 (168,7395,7557)
11 10020 110220 (170,4843,5007)
11 6156 67716 (174,2907,3075)
11 4296 47256 (179,1972,2145)
11 3036 33396 (187,1334,1515)
11 2100 23100 (203,850,1047)
11 1470 16170 (245,493,732)
11 1326 14586 (289,377,660)
11 30744 338184 (126,15250,15368)
11 6552 72072 (130,3150,3272)
11 3264 35904 (136,1500,1628)
11 1752 19272 (150,730,872)
11 1152 12672 (180,400,572)
11 984 10824 (246,250,488)
11 98940 1088340 (102,49373,49465)
11 9360 102960 (104,4581,4675)
11 1260 13860 (126,509,625)
11 42282 465102 (87,21060,21135)
11 10824 119064 (88,5330,5406)
11 4536 49896 (90,2184,2262)
11 3570 39270 (91,1700,1779)
11 2256 24816 (94,1040,1122)
11 1410 15510 (100,611,699)
11 1176 12936 (104,490,582)
11 1134 12474 (105,468,561)
11 870 9570 (116,325,429)
11 762 8382 (127,260,375)
11 744 8184 (130,248,366)
11 672 7392 (160,182,330)
11 5964 65604 (78,2911,2975)
11 2100 23100 (82,975,1043)
11 630 6930 (117,205,308)
11 16836 185196 (69,8357,8410)
11 1776 19536 (74,822,880)
11 516 5676 (129,137,250)
11 30618 336798 (63,15255,15300)
11 5760 63360 (64,2825,2871)
11 3276 36036 (65,1582,1629)
11 810 8910 (75,339,396)
11 468 5148 (113,130,225)
11 3750 41250 (60,1825,1865)
11 630 6930 (73,252,305)
11 570 6270 (76,219,275)
11 5040 55440 (56,2475,2509)
11 2622 28842 (57,1265,1300)
11 1416 15576 (59,660,697)
11 1176 12936 (60,539,577)
11 702 7722 (65,297,340)
11 660 7260 (66,275,319)
11 480 5280 (75,176,229)
11 462 5082 (77,165,220)
11 396 4356 (99,110,187)
11 1344 14784 (56,628,660)
11 2520 27720 (50,1224,1246)
11 1554 17094 (51,740,763)
11 378 4158 (68,135,175)
11 336 3696 (80,102,154)
11 4320 47520 (48,2127,2145)
11 1176 12936 (49,555,572)
11 384 4224 (60,148,176)
11 21870 240570 (45,10908,10917)
11 4446 48906 (45,2197,2204)
11 456 5016 (52,195,209)
11 2268 24948 (45,1110,1113)
11 2070 22770 (45,1012,1013)
11 1104 12144 (46,528,530)
11 624 6864 (48,286,290)
11 390 4290 (52,165,173)
11 330 3630 (55,132,143)
11 264 2904 (66,88,110)
11 348 3828 (53,145,150)
11 240 2640 (65,87,88)
----------------------------------------
103 integer-sided triangles whose area/perimeter=11 were found.

你可能感兴趣的:(C++,c,F#,C#)