Cody

Problem 1103. Right Triangle Side Lengths (Inspired by Project Euler Problem 39)

Solution 3335523

Submitted on 22 Oct 2020 by Giovanni Mottola
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))

n = 119 a = -14160 b = 238 c = 14162 n = 59 a = -6960 b = 236 c = 6964 n = 39 a = -4560 b = 234 c = 4566 n = 29 a = -3360 b = 232 c = 3368 n = 23 a = -2640 b = 230 c = 2650 n = 19 a = -2160 b = 228 c = 2172 n = 14 a = -1560 b = 224 c = 1576 n = 11 a = -1200 b = 220 c = 1220 n = 9 a = -960 b = 216 c = 984 n = 7 a = -720 b = 210 c = 750 n = 5 a = -480 b = 200 c = 520 n = 4 a = -360 b = 192 c = 408 n = 3 a = -240 b = 180 c = 300 n = 2 a = -120 b = 160 c = 200 n = 1 a = 0 b = 120 c = 120 n = 0 a = 120 b = 0 c = 120 n = 58 a = -3360 b = 232 c = 3368 n = 28 a = -1560 b = 224 c = 1576 n = 18 a = -960 b = 216 c = 984 n = 13 a = -660 b = 208 c = 692 n = 10 a = -480 b = 200 c = 520 n = 8 a = -360 b = 192 c = 408 n = 4 a = -120 b = 160 c = 200 n = 3 a = -60 b = 144 c = 156 n = 2 a = 0 b = 120 c = 120 n = 1 a = 60 b = 80 c = 100 v = 60 80 100 f = 1 s = 1×1 cell array {1×3 double} A = 60 n = 0 a = 120 b = 0 c = 120 n = -1 a = 180 b = -240 c = 300 n = 37 a = -1360 b = 222 c = 1378 n = 17 a = -560 b = 204 c = 596 n = 7 a = -160 b = 168 c = 232 n = 5 a = -80 b = 150 c = 170 n = 2 a = 40 b = 96 c = 104 v = 40 96 104 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 60 40 n = 1 a = 80 b = 60 c = 100 v = 60 80 100 f = 1 f = 0 n = -1 a = 160 b = -120 c = 200 n = -2 a = 200 b = -480 c = 520 n = 26 a = -660 b = 208 c = 692 n = 11 a = -210 b = 176 c = 274 n = 6 a = -60 b = 144 c = 156 n = 2 a = 60 b = 80 c = 100 v = 60 80 100 f = 1 f = 0 n = 1 a = 90 b = 48 c = 102 v = 48 90 102 f = 1 s = 1×3 cell array {1×3 double} {1×3 double} {1×3 double} A = 60 40 48 n = -1 a = 150 b = -80 c = 170 n = -2 a = 180 b = -240 c = 300 n = -3 a = 210 b = -720 c = 750 n = 19 a = -336 b = 190 c = 386 n = 7 a = -48 b = 140 c = 148 n = 3 a = 48 b = 90 c = 102 v = 48 90 102 f = 1 f = 0 n = 1 a = 96 b = 40 c = 104 v = 40 96 104 f = 1 f = 0 n = -1 a = 144 b = -60 c = 156 n = -2 a = 168 b = -160 c = 232 n = -3 a = 192 b = -360 c = 408 n = -4 a = 216 b = -960 c = 984 n = 14 a = -160 b = 168 c = 232 n = 4 a = 40 b = 96 c = 104 v = 40 96 104 f = 1 f = 0 n = -1 a = 140 b = -48 c = 148 n = -2 a = 160 b = -120 c = 200 n = -4 a = 200 b = -480 c = 520 n = -5 a = 220 b = -1200 c = 1220 n = 7 a = 15 b = 112 c = 113 v = 15 112 113 f = 1 s = 1×4 cell array {1×3 double} {1×3 double} {1×3 double} {1×3 double} A = 60 40 48 15 n = -3 a = 165 b = -144 c = 219 n = -5 a = 195 b = -400 c = 445 n = -7 a = 225 b = -1680 c = 1695 n = 2 a = 96 b = 40 c = 104 v = 40 96 104 f = 1 f = 0 n = -4 a = 168 b = -160 c = 232 n = -6 a = 192 b = -360 c = 408 n = -7 a = 204 b = -560 c = 596 n = -8 a = 216 b = -960 c = 984 n = -9 a = 228 b = -2160 c = 2172 n = -2 a = 140 b = -48 c = 148 n = -7 a = 190 b = -336 c = 386 n = -10 a = 220 b = -1200 c = 1220 n = -11 a = 230 b = -2640 c = 2650 n = -7 a = 176 b = -210 c = 274 n = -11 a = 208 b = -660 c = 692 n = -13 a = 224 b = -1560 c = 1576 n = -14 a = 232 b = -3360 c = 3368 n = -14 a = 204 b = -560 c = 596 n = -17 a = 222 b = -1360 c = 1378 n = -18 a = 228 b = -2160 c = 2172 n = -19 a = 234 b = -4560 c = 4566 n = -19 a = 215 b = -912 c = 937 n = -23 a = 235 b = -5520 c = 5525 n = -26 a = 224 b = -1560 c = 1576 n = -28 a = 232 b = -3360 c = 3368 n = -29 a = 236 b = -6960 c = 6964 n = -37 a = 231 b = -2960 c = 2969 n = -39 a = 237 b = -9360 c = 9363 n = -58 a = 236 b = -6960 c = 6964 n = -59 a = 238 b = -14160 c = 14162 n = -119 a = 239 b = -28560 c = 28561 h = 4 2 3 1 s = 1×4 cell array {1×3 double} {1×3 double} {1×3 double} {1×3 double}

2   Pass
assert(isequal(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))

n = 119 a = -14160 b = 238 c = 14162 n = 59 a = -6960 b = 236 c = 6964 n = 39 a = -4560 b = 234 c = 4566 n = 29 a = -3360 b = 232 c = 3368 n = 23 a = -2640 b = 230 c = 2650 n = 19 a = -2160 b = 228 c = 2172 n = 14 a = -1560 b = 224 c = 1576 n = 11 a = -1200 b = 220 c = 1220 n = 9 a = -960 b = 216 c = 984 n = 7 a = -720 b = 210 c = 750 n = 5 a = -480 b = 200 c = 520 n = 4 a = -360 b = 192 c = 408 n = 3 a = -240 b = 180 c = 300 n = 2 a = -120 b = 160 c = 200 n = 1 a = 0 b = 120 c = 120 n = 0 a = 120 b = 0 c = 120 n = 58 a = -3360 b = 232 c = 3368 n = 28 a = -1560 b = 224 c = 1576 n = 18 a = -960 b = 216 c = 984 n = 13 a = -660 b = 208 c = 692 n = 10 a = -480 b = 200 c = 520 n = 8 a = -360 b = 192 c = 408 n = 4 a = -120 b = 160 c = 200 n = 3 a = -60 b = 144 c = 156 n = 2 a = 0 b = 120 c = 120 n = 1 a = 60 b = 80 c = 100 v = 60 80 100 f = 1 s = 1×1 cell array {1×3 double} A = 60 n = 0 a = 120 b = 0 c = 120 n = -1 a = 180 b = -240 c = 300 n = 37 a = -1360 b = 222 c = 1378 n = 17 a = -560 b = 204 c = 596 n = 7 a = -160 b = 168 c = 232 n = 5 a = -80 b = 150 c = 170 n = 2 a = 40 b = 96 c = 104 v = 40 96 104 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 60 40 n = 1 a = 80 b = 60 c = 100 v = 60 80 100 f = 1 f = 0 n = -1 a = 160 b = -120 c = 200 n = -2 a = 200 b = -480 c = 520 n = 26 a = -660 b = 208 c = 692 n = 11 a = -210 b = 176 c = 274 n = 6 a = -60 b = 144 c = 156 n = 2 a = 60 b = 80 c = 100 v = 60 80 100 f = 1 f = 0 n = 1 a = 90 b = 48 c = 102 v = 48 90 102 f = 1 s = 1×3 cell array {1×3 double} {1×3 double} {1×3 double} A = 60 40 48 n = -1 a = 150 b = -80 c = 170 n = -2 a = 180 b = -240 c = 300 n = -3 a = 210 b = -720 c = 750 n = 19 a = -336 b = 190 c = 386 n = 7 a = -48 b = 140 c = 148 n = 3 a = 48 b = 90 c = 102 v = 48 90 102 f = 1 f = 0 n = 1 a = 96 b = 40 c = 104 v = 40 96 104 f = 1 f = 0 n = -1 a = 144 b = -60 c = 156 n = -2 a = 168 b = -160 c = 232 n = -3 a = 192 b = -360 c = 408 n = -4 a = 216 b = -960 c = 984 n = 14 a = -160 b = 168 c = 232 n = 4 a = 40 b = 96 c = 104 v = 40 96 104 f = 1 f = 0 n = -1 a = 140 b = -48 c = 148 n = -2 a = 160 b = -120 c = 200 n = -4 a = 200 b = -480 c = 520 n = -5 a = 220 b = -1200 c = 1220 n = 7 a = 15 b = 112 c = 113 v = 15 112 113 f = 1 s = 1×4 cell array {1×3 double} {1×3 double} {1×3 double} {1×3 double} A = 60 40 48 15 n = -3 a = 165 b = -144 c = 219 n = -5 a = 195 b = -400 c = 445 n = -7 a = 225 b = -1680 c = 1695 n = 2 a = 96 b = 40 c = 104 v = 40 96 104 f = 1 f = 0 n = -4 a = 168 b = -160 c = 232 n = -6 a = 192 b = -360 c = 408 n = -7 a = 204 b = -560 c = 596 n = -8 a = 216 b = -960 c = 984 n = -9 a = 228 b = -2160 c = 2172 n = -2 a = 140 b = -48 c = 148 n = -7 a = 190 b = -336 c = 386 n = -10 a = 220 b = -1200 c = 1220 n = -11 a = 230 b = -2640 c = 2650 n = -7 a = 176 b = -210 c = 274 n = -11 a = 208 b = -660 c = 692 n = -13 a = 224 b = -1560 c = 1576 n = -14 a = 232 b = -3360 c = 3368 n = -14 a = 204 b = -560 c = 596 n = -17 a = 222 b = -1360 c = 1378 n = -18 a = 228 b = -2160 c = 2172 n = -19 a = 234 b = -4560 c = 4566 n = -19 a = 215 b = -912 c = 937 n = -23 a = 235 b = -5520 c = 5525 n = -26 a = 224 b = -1560 c = 1576 n = -28 a = 232 b = -3360 c = 3368 n = -29 a = 236 b = -6960 c = 6964 n = -37 a = 231 b = -2960 c = 2969 n = -39 a = 237 b = -9360 c = 9363 n = -58 a = 236 b = -6960 c = 6964 n = -59 a = 238 b = -14160 c = 14162 n = -119 a = 239 b = -28560 c = 28561 h = 4 2 3 1 s = 1×4 cell array {1×3 double} {1×3 double} {1×3 double} {1×3 double}

3   Pass
assert(isequal(right_triangle_sides(418),{ [57 176 185] }))

n = 208 a = -43263 b = 416 c = 43265 n = 18 a = -3553 b = 396 c = 3575 n = 10 a = -1881 b = 380 c = 1919 n = 0 a = 209 b = 0 c = 209 n = 8 a = 57 b = 176 c = 185 v = 57 176 185 f = 1 s = 1×1 cell array {1×3 double} A = 57 n = -10 a = 399 b = -4180 c = 4199 n = -8 a = 297 b = -304 c = 425 n = -18 a = 407 b = -7524 c = 7535 n = -208 a = 417 b = -86944 c = 86945 h = 1 s = 1×1 cell array {1×3 double}

4   Pass
assert(isequal(right_triangle_sides(490),{ [140 147 203] }))

n = 244 a = -59535 b = 488 c = 59537 n = 48 a = -11515 b = 480 c = 11525 n = 34 a = -8085 b = 476 c = 8099 n = 6 a = -1225 b = 420 c = 1295 n = 4 a = -735 b = 392 c = 833 n = 0 a = 245 b = 0 c = 245 n = 44 a = -1911 b = 440 c = 1961 n = 2 a = 147 b = 140 c = 203 v = 140 147 203 f = 1 s = 1×1 cell array {1×3 double} A = 140 n = -4 a = 441 b = -1960 c = 2009 n = 28 a = -735 b = 392 c = 833 n = 0 a = 245 b = 0 c = 245 n = -2 a = 315 b = -196 c = 371 n = -6 a = 455 b = -2940 c = 2975 n = -28 a = 441 b = -1960 c = 2009 n = -34 a = 483 b = -16660 c = 16667 n = -44 a = 465 b = -4312 c = 4337 n = -48 a = 485 b = -23520 c = 23525 n = -244 a = 489 b = -119560 c = 119561 h = 1 s = 1×1 cell array {1×3 double}

5   Pass
assert(isequal(right_triangle_sides(112),{ [14 48 50] }))

n = 55 a = -3024 b = 110 c = 3026 n = 27 a = -1456 b = 108 c = 1460 n = 13 a = -672 b = 104 c = 680 n = 7 a = -336 b = 98 c = 350 n = 6 a = -280 b = 96 c = 296 n = 3 a = -112 b = 84 c = 140 n = 1 a = 0 b = 56 c = 56 n = 0 a = 56 b = 0 c = 56 n = 26 a = -672 b = 104 c = 680 n = 12 a = -280 b = 96 c = 296 n = 5 a = -84 b = 80 c = 116 n = 2 a = 0 b = 56 c = 56 n = 0 a = 56 b = 0 c = 56 n = -1 a = 84 b = -112 c = 140 n = 10 a = -84 b = 80 c = 116 n = 3 a = 14 b = 48 c = 50 v = 14 48 50 f = 1 s = 1×1 cell array {1×3 double} A = 14 n = -2 a = 84 b = -112 c = 140 n = -3 a = 98 b = -336 c = 350 n = 1 a = 48 b = 14 c = 50 v = 14 48 50 f = 1 f = 0 n = -3 a = 80 b = -84 c = 116 n = -5 a = 96 b = -280 c = 296 n = -6 a = 104 b = -672 c = 680 n = -1 a = 63 b = -16 c = 65 n = -7 a = 105 b = -784 c = 791 n = -10 a = 96 b = -280 c = 296 n = -12 a = 104 b = -672 c = 680 n = -13 a = 108 b = -1456 c = 1460 n = -26 a = 108 b = -1456 c = 1460 n = -27 a = 110 b = -3024 c = 3026 n = -55 a = 111 b = -6160 c = 6161 h = 1 s = 1×1 cell array {1×3 double}

6   Pass
assert(isequal(right_triangle_sides(390),{ [52 165 173] [65 156 169] }))

n = 194 a = -37635 b = 388 c = 37637 n = 64 a = -12285 b = 384 c = 12291 n = 38 a = -7215 b = 380 c = 7225 n = 14 a = -2535 b = 364 c = 2561 n = 12 a = -2145 b = 360 c = 2175 n = 4 a = -585 b = 312 c = 663 n = 2 a = -195 b = 260 c = 325 n = 0 a = 195 b = 0 c = 195 n = 62 a = -3835 b = 372 c = 3853 n = 10 a = -455 b = 300 c = 545 n = 2 a = 65 b = 156 c = 169 v = 65 156 169 f = 1 s = 1×1 cell array {1×3 double} A = 65 n = -2 a = 325 b = -780 c = 845 n = 34 a = -1131 b = 340 c = 1181 n = 8 a = -117 b = 240 c = 267 n = -2 a = 273 b = -260 c = 377 n = -4 a = 351 b = -1560 c = 1599 n = 2 a = 165 b = 52 c = 173 v = 52 165 173 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 65 52 n = -8 a = 315 b = -624 c = 699 n = -10 a = 345 b = -1300 c = 1345 n = -12 a = 375 b = -4680 c = 4695 n = -2 a = 221 b = -60 c = 229 n = -14 a = 377 b = -5460 c = 5473 n = -34 a = 365 b = -2652 c = 2677 n = -38 a = 385 b = -14820 c = 14825 n = -62 a = 381 b = -8060 c = 8069 n = -64 a = 387 b = -24960 c = 24963 n = -194 a = 389 b = -75660 c = 75661 h = 2 1 s = 1×2 cell array {1×3 double} {1×3 double}

7   Pass
assert(isequal(right_triangle_sides(132),{ [11 60 61] [33 44 55] }))

n = 65 a = -4224 b = 130 c = 4226 n = 32 a = -2046 b = 128 c = 2050 n = 21 a = -1320 b = 126 c = 1326 n = 10 a = -594 b = 120 c = 606 n = 5 a = -264 b = 110 c = 286 n = 2 a = -66 b = 88 c = 110 n = 1 a = 0 b = 66 c = 66 n = 0 a = 66 b = 0 c = 66 n = 31 a = -957 b = 124 c = 965 n = 9 a = -231 b = 108 c = 255 n = 1 a = 33 b = 44 c = 55 v = 33 44 55 f = 1 s = 1×1 cell array {1×3 double} A = 33 n = -1 a = 99 b = -132 c = 165 n = 19 a = -352 b = 114 c = 370 n = 8 a = -110 b = 96 c = 146 n = -1 a = 88 b = -66 c = 110 n = -2 a = 110 b = -264 c = 286 n = 5 a = 11 b = 60 c = 61 v = 11 60 61 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 33 11 n = -5 a = 121 b = -660 c = 671 n = -5 a = 96 b = -110 c = 146 n = -8 a = 114 b = -352 c = 370 n = -9 a = 120 b = -594 c = 606 n = -10 a = 126 b = -1320 c = 1326 n = -19 a = 123 b = -836 c = 845 n = -21 a = 129 b = -2772 c = 2775 n = -31 a = 128 b = -2046 c = 2050 n = -32 a = 130 b = -4224 c = 4226 n = -65 a = 131 b = -8580 c = 8581 h = 2 1 s = 1×2 cell array {1×3 double} {1×3 double}

8   Pass
assert(isequal(right_triangle_sides(576),{ [64 252 260] [144 192 240] }))

n = 287 a = -82368 b = 574 c = 82370 n = 143 a = -40896 b = 572 c = 40900 n = 95 a = -27072 b = 570 c = 27078 n = 71 a = -20160 b = 568 c = 20168 n = 47 a = -13248 b = 564 c = 13260 n = 35 a = -9792 b = 560 c = 9808 n = 31 a = -8640 b = 558 c = 8658 n = 23 a = -6336 b = 552 c = 6360 n = 17 a = -4608 b = 544 c = 4640 n = 15 a = -4032 b = 540 c = 4068 n = 11 a = -2880 b = 528 c = 2928 n = 8 a = -2016 b = 512 c = 2080 n = 7 a = -1728 b = 504 c = 1800 n = 5 a = -1152 b = 480 c = 1248 n = 3 a = -576 b = 432 c = 720 n = 2 a = -288 b = 384 c = 480 n = 1 a = 0 b = 288 c = 288 n = 0 a = 288 b = 0 c = 288 n = 142 a = -20160 b = 568 c = 20168 n = 70 a = -9792 b = 560 c = 9808 n = 46 a = -6336 b = 552 c = 6360 n = 34 a = -4608 b = 544 c = 4640 n = 22 a = -2880 b = 528 c = 2928 n = 16 a = -2016 b = 512 c = 2080 n = 14 a = -1728 b = 504 c = 1800 n = 10 a = -1152 b = 480 c = 1248 n = 7 a = -720 b = 448 c = 848 n = 6 a = -576 b = 432 c = 720 n = 4 a = -288 b = 384 c = 480 n = 2 a = 0 b = 288 c = 288 n = 1 a = 144 b = 192 c = 240 v = 144 192 240 f = 1 s = 1×1 cell array {1×3 double} A = 144 n = 0 a = 288 b = 0 c = 288 n = -1 a = 432 b = -576 c = 720 n = 93 a = -8640 b = 558 c = 8658 n = 45 a = -4032 b = 540 c = 4068 n = 29 a = -2496 b = 522 c = 2550 n = 21 a = -1728 b = 504 c = 1800 n = 13 a = -960 b = 468 c = 1068 n = 9 a = -576 b = 432 c = 720 n = 5 a = -192 b = 360 c = 408 n = 3 a = 0 b = 288 c = 288 n = 1 a = 192 b = 144 c = 240 v = 144 192 240 f = 1 f = 0 n = 0 a = 288 b = 0 c = 288 n = -1 a = 384 b = -288 c = 480 n = -2 a = 480 b = -1152 c = 1248 n = 68 a = -4608 b = 544 c = 4640 n = 32 a = -2016 b = 512 c = 2080 n = 20 a = -1152 b = 480 c = 1248 n = 14 a = -720 b = 448 c = 848 n = 8 a = -288 b = 384 c = 480 n = 5 a = -72 b = 320 c = 328 n = 4 a = 0 b = 288 c = 288 n = 2 a = 144 b = 192 c = 240 v = 144 192 240 f = 1 f = 0 n = 0 a = 288 b = 0 c = 288 n = -1 a = 360 b = -192 c = 408 n = -2 a = 432 b = -576 c = 720 n = -3 a = 504 b = -1728 c = 1800 n = 42 a = -1728 b = 504 c = 1800 n = 18 a = -576 b = 432 c = 720 n = 10 a = -192 b = 360 c = 408 n = 6 a = 0 b = 288 c = 288 n = 2 a = 192 b = 144 c = 240 v = 144 192 240 f = 1 f = 0 n = 0 a = 288 b = 0 c = 288 n = -2 a = 384 b = -288 c = 480 n = -3 a = 432 b = -576 c = 720 n = -4 a = 480 b = -1152 c = 1248 n = -5 a = 528 b = -2880 c = 2928 n = 28 a = -720 b = 448 c = 848 n = 10 a = -72 b = 320 c = 328 n = 4 a = 144 b = 192 c = 240 v = 144 192 240 f = 1 f = 0 n = 1 a = 252 b = 64 c = 260 v = 64 252 260 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 144 64 n = -2 a = 360 b = -192 c = 408 n = -4 a = 432 b = -576 c = 720 n = -5 a = 468 b = -960 c = 1068 n = -6 a = 504 b = -1728 c = 1800 n = -7 a = 540 b = -4032 c = 4068 n = 23 a = -448 b = 414 c = 610 n = 7 a = 64 b = 252 c = 260 v = 64 252 260 f = 1 f = 0 n = -1 a = 320 b = -72 c = 328 n = -5 a = 448 b = -720 c = 848 n = -7 a = 512 b = -2016 c = 2080 n = -8 a = 544 b = -4608 c = 4640 n = 12 a = 0 b = 288 c = 288 n = 0 a = 288 b = 0 c = 288 n = -4 a = 384 b = -288 c = 480 n = -6 a = 432 b = -576 c = 720 n = -8 a = 480 b = -1152 c = 1248 n = -9 a = 504 b = -1728 c = 1800 n = -10 a = 528 b = -2880 c = 2928 n = -11 a = 552 b = -6336 c = 6360 n = 2 a = 252 b = 64 c = 260 v = 64 252 260 f = 1 f = 0 n = -7 a = 414 b = -448 c = 610 n = -10 a = 468 b = -960 c = 1068 n = -13 a = 522 b = -2496 c = 2550 n = -14 a = 540 b = -4032 c = 4068 n = -15 a = 558 b = -8640 c = 8658 n = -2 a = 320 b = -72 c = 328 n = -10 a = 448 b = -720 c = 848 n = -14 a = 512 b = -2016 c = 2080 n = -16 a = 544 b = -4608 c = 4640 n = -17 a = 560 b = -9792 c = 9808 n = -12 a = 432 b = -576 c = 720 n = -18 a = 504 b = -1728 c = 1800 n = -20 a = 528 b = -2880 c = 2928 n = -21 a = 540 b = -4032 c = 4068 n = -22 a = 552 b = -6336 c = 6360 n = -23 a = 564 b = -13248 c = 13260 n = -23 a = 495 b = -1472 c = 1553 n = -29 a = 549 b = -5568 c = 5595 n = -31 a = 567 b = -17856 c = 17865 n = -28 a = 512 b = -2016 c = 2080 n = -32 a = 544 b = -4608 c = 4640 n = -34 a = 560 b = -9792 c = 9808 n = -35 a = 568 b = -20160 c = 20168 n = -42 a = 540 b = -4032 c = 4068 n = -45 a = 558 b = -8640 c = 8658 n = -46 a = 564 b = -13248 c = 13260 n = -47 a = 570 b = -27072 c = 27078 n = -68 a = 560 b = -9792 c = 9808 n = -70 a = 568 b = -20160 c = 20168 n = -71 a = 572 b = -40896 c = 40900 n = -93 a = 567 b = -17856 c = 17865 n = -95 a = 573 b = -54720 c = 54723 n = -142 a = 572 b = -40896 c = 40900 n = -143 a = 574 b = -82368 c = 82370 n = -287 a = 575 b = -165312 c = 165313 h = 2 1 s = 1×2 cell array {1×3 double} {1×3 double}

9   Pass
assert(isequal(right_triangle_sides(60),{ [10 24 26] [15 20 25] }))

n = 29 a = -840 b = 58 c = 842 n = 14 a = -390 b = 56 c = 394 n = 9 a = -240 b = 54 c = 246 n = 5 a = -120 b = 50 c = 130 n = 4 a = -90 b = 48 c = 102 n = 2 a = -30 b = 40 c = 50 n = 1 a = 0 b = 30 c = 30 n = 0 a = 30 b = 0 c = 30 n = 13 a = -165 b = 52 c = 173 n = 3 a = -15 b = 36 c = 39 n = 1 a = 15 b = 20 c = 25 v = 15 20 25 f = 1 s = 1×1 cell array {1×3 double} A = 15 n = -1 a = 45 b = -60 c = 75 n = 7 a = -40 b = 42 c = 58 n = 2 a = 10 b = 24 c = 26 v = 10 24 26 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 15 10 n = -1 a = 40 b = -30 c = 50 n = -2 a = 50 b = -120 c = 130 n = 1 a = 24 b = 10 c = 26 v = 10 24 26 f = 1 f = 0 n = -2 a = 42 b = -40 c = 58 n = -3 a = 48 b = -90 c = 102 n = -4 a = 54 b = -240 c = 246 n = -1 a = 35 b = -12 c = 37 n = -5 a = 55 b = -300 c = 305 n = -7 a = 51 b = -140 c = 149 n = -9 a = 57 b = -540 c = 543 n = -13 a = 56 b = -390 c = 394 n = -14 a = 58 b = -840 c = 842 n = -29 a = 59 b = -1740 c = 1741 h = 2 1 s = 1×2 cell array {1×3 double} {1×3 double}

10   Pass
assert(isequal(right_triangle_sides(650),{ [25 312 313] }))

n = 324 a = -104975 b = 648 c = 104977 n = 64 a = -20475 b = 640 c = 20485 n = 24 a = -7475 b = 624 c = 7501 n = 12 a = -3575 b = 600 c = 3625 n = 4 a = -975 b = 520 c = 1105 n = 0 a = 325 b = 0 c = 325 n = 60 a = -3575 b = 600 c = 3625 n = 8 a = -195 b = 400 c = 445 n = 0 a = 325 b = 0 c = 325 n = -4 a = 585 b = -2600 c = 2665 n = 12 a = 25 b = 312 c = 313 v = 25 312 313 f = 1 s = 1×1 cell array {1×3 double} A = 25 n = -8 a = 525 b = -1040 c = 1165 n = -12 a = 625 b = -7800 c = 7825 n = -12 a = 481 b = -600 c = 769 n = -24 a = 637 b = -15600 c = 15613 n = -60 a = 625 b = -7800 c = 7825 n = -64 a = 645 b = -41600 c = 41605 n = -324 a = 649 b = -210600 c = 210601 h = 1 s = 1×1 cell array {1×3 double}

11   Pass
assert(isequal(right_triangle_sides(732),{ [183 244 305] }))

n = 365 a = -133224 b = 730 c = 133226 n = 182 a = -66246 b = 728 c = 66250 n = 121 a = -43920 b = 726 c = 43926 n = 60 a = -21594 b = 720 c = 21606 n = 5 a = -1464 b = 610 c = 1586 n = 2 a = -366 b = 488 c = 610 n = 1 a = 0 b = 366 c = 366 n = 0 a = 366 b = 0 c = 366 n = 181 a = -32757 b = 724 c = 32765 n = 59 a = -10431 b = 708 c = 10455 n = 1 a = 183 b = 244 c = 305 v = 183 244 305 f = 1 s = 1×1 cell array {1×3 double} A = 183 n = -1 a = 549 b = -732 c = 915 n = 119 a = -14152 b = 714 c = 14170 n = 58 a = -6710 b = 696 c = 6746 n = -1 a = 488 b = -366 c = 610 n = -2 a = 610 b = -1464 c = 1586 n = 55 a = -2989 b = 660 c = 3061 n = -5 a = 671 b = -3660 c = 3721 n = -55 a = 696 b = -6710 c = 6746 n = -58 a = 714 b = -14152 c = 14170 n = -59 a = 720 b = -21594 c = 21606 n = -60 a = 726 b = -43920 c = 43926 n = -119 a = 723 b = -29036 c = 29045 n = -121 a = 729 b = -88572 c = 88575 n = -181 a = 728 b = -66246 c = 66250 n = -182 a = 730 b = -133224 c = 133226 n = -365 a = 731 b = -267180 c = 267181 h = 1 s = 1×1 cell array {1×3 double}

12   Pass
assert(isequal(right_triangle_sides(648),{ [162 216 270] }))

n = 323 a = -104328 b = 646 c = 104330 n = 161 a = -51840 b = 644 c = 51844 n = 107 a = -34344 b = 642 c = 34350 n = 80 a = -25596 b = 640 c = 25604 n = 53 a = -16848 b = 636 c = 16860 n = 35 a = -11016 b = 630 c = 11034 n = 26 a = -8100 b = 624 c = 8124 n = 17 a = -5184 b = 612 c = 5220 n = 11 a = -3240 b = 594 c = 3294 n = 8 a = -2268 b = 576 c = 2340 n = 5 a = -1296 b = 540 c = 1404 n = 3 a = -648 b = 486 c = 810 n = 2 a = -324 b = 432 c = 540 n = 1 a = 0 b = 324 c = 324 n = 0 a = 324 b = 0 c = 324 n = 160 a = -25596 b = 640 c = 25604 n = 79 a = -12474 b = 632 c = 12490 n = 52 a = -8100 b = 624 c = 8124 n = 25 a = -3726 b = 600 c = 3774 n = 16 a = -2268 b = 576 c = 2340 n = 7 a = -810 b = 504 c = 954 n = 4 a = -324 b = 432 c = 540 n = 1 a = 162 b = 216 c = 270 v = 162 216 270 f = 1 s = 1×1 cell array {1×3 double} A = 162 n = 0 a = 324 b = 0 c = 324 n = -1 a = 486 b = -648 c = 810 n = 105 a = -11016 b = 630 c = 11034 n = 51 a = -5184 b = 612 c = 5220 n = 33 a = -3240 b = 594 c = 3294 n = 24 a = -2268 b = 576 c = 2340 n = 15 a = -1296 b = 540 c = 1404 n = 9 a = -648 b = 486 c = 810 n = 6 a = -324 b = 432 c = 540 n = 3 a = 0 b = 324 c = 324 n = 1 a = 216 b = 162 c = 270 v = 162 216 270 f = 1 f = 0 n = 0 a = 324 b = 0 c = 324 n = -1 a = 432 b = -324 c = 540 n = -2 a = 540 b = -1296 c = 1404 n = 77 a = -5913 b = 616 c = 5945 n = 23 a = -1539 b = 552 c = 1635 n = 5 a = -81 b = 360 c = 369 n = -1 a = 405 b = -216 c = 459 n = -3 a = 567 b = -1944 c = 2025 n = 48 a = -2268 b = 576 c = 2340 n = 21 a = -810 b = 504 c = 954 n = 12 a = -324 b = 432 c = 540 n = 3 a = 162 b = 216 c = 270 v = 162 216 270 f = 1 f = 0 n = 0 a = 324 b = 0 c = 324 n = -3 a = 486 b = -648 c = 810 n = -4 a = 540 b = -1296 c = 1404 n = -5 a = 594 b = -3240 c = 3294 n = 27 a = -648 b = 486 c = 810 n = 9 a = 0 b = 324 c = 324 n = 3 a = 216 b = 162 c = 270 v = 162 216 270 f = 1 f = 0 n = 0 a = 324 b = 0 c = 324 n = -3 a = 432 b = -324 c = 540 n = -5 a = 504 b = -810 c = 954 n = -6 a = 540 b = -1296 c = 1404 n = -7 a = 576 b = -2268 c = 2340 n = -8 a = 612 b = -5184 c = 5220 n = 15 a = -81 b = 360 c = 369 n = -3 a = 405 b = -216 c = 459 n = -9 a = 567 b = -1944 c = 2025 n = -11 a = 621 b = -7128 c = 7155 n = 0 a = 324 b = 0 c = 324 n = -9 a = 486 b = -648 c = 810 n = -12 a = 540 b = -1296 c = 1404 n = -15 a = 594 b = -3240 c = 3294 n = -16 a = 612 b = -5184 c = 5220 n = -17 a = 630 b = -11016 c = 11034 n = -15 a = 504 b = -810 c = 954 n = -21 a = 576 b = -2268 c = 2340 n = -23 a = 600 b = -3726 c = 3774 n = -24 a = 612 b = -5184 c = 5220 n = -25 a = 624 b = -8100 c = 8124 n = -26 a = 636 b = -16848 c = 16860 n = -27 a = 567 b = -1944 c = 2025 n = -33 a = 621 b = -7128 c = 7155 n = -35 a = 639 b = -22680 c = 22689 n = -48 a = 612 b = -5184 c = 5220 n = -51 a = 630 b = -11016 c = 11034 n = -52 a = 636 b = -16848 c = 16860 n = -53 a = 642 b = -34344 c = 34350 n = -77 a = 632 b = -12474 c = 12490 n = -79 a = 640 b = -25596 c = 25604 n = -80 a = 644 b = -51840 c = 51844 n = -105 a = 639 b = -22680 c = 22689 n = -107 a = 645 b = -69336 c = 69339 n = -160 a = 644 b = -51840 c = 51844 n = -161 a = 646 b = -104328 c = 104330 n = -323 a = 647 b = -209304 c = 209305 h = 1 s = 1×1 cell array {1×3 double}

13   Pass
assert(isequal(right_triangle_sides(930),{ [155 372 403] }))

n = 464 a = -215295 b = 928 c = 215297 n = 154 a = -71145 b = 924 c = 71151 n = 92 a = -42315 b = 920 c = 42325 n = 30 a = -13485 b = 900 c = 13515 n = 14 a = -6045 b = 868 c = 6107 n = 4 a = -1395 b = 744 c = 1581 n = 2 a = -465 b = 620 c = 775 n = 0 a = 465 b = 0 c = 465 n = 152 a = -23095 b = 912 c = 23113 n = 28 a = -3875 b = 840 c = 3965 n = 2 a = 155 b = 372 c = 403 v = 155 372 403 f = 1 s = 1×1 cell array {1×3 double} A = 155 n = -2 a = 775 b = -1860 c = 2015 n = 88 a = -7719 b = 880 c = 7769 n = 26 a = -1953 b = 780 c = 2103 n = -2 a = 651 b = -620 c = 899 n = -4 a = 837 b = -3720 c = 3813 n = 16 a = -31 b = 480 c = 481 n = -14 a = 899 b = -13020 c = 13051 n = -16 a = 705 b = -992 c = 1217 n = -26 a = 855 b = -4836 c = 4911 n = -28 a = 885 b = -8680 c = 8725 n = -30 a = 915 b = -27900 c = 27915 n = -88 a = 905 b = -16368 c = 16393 n = -92 a = 925 b = -85560 c = 85565 n = -152 a = 921 b = -47120 c = 47129 n = -154 a = 927 b = -143220 c = 143223 n = -464 a = 929 b = -431520 c = 431521 h = 1 s = 1×1 cell array {1×3 double}

14   Pass
assert(isequal(right_triangle_sides(876),{ [219 292 365] }))

n = 437 a = -190968 b = 874 c = 190970 n = 218 a = -95046 b = 872 c = 95050 n = 145 a = -63072 b = 870 c = 63078 n = 72 a = -31098 b = 864 c = 31110 n = 5 a = -1752 b = 730 c = 1898 n = 2 a = -438 b = 584 c = 730 n = 1 a = 0 b = 438 c = 438 n = 0 a = 438 b = 0 c = 438 n = 217 a = -47085 b = 868 c = 47093 n = 71 a = -15111 b = 852 c = 15135 n = 1 a = 219 b = 292 c = 365 v = 219 292 365 f = 1 s = 1×1 cell array {1×3 double} A = 219 n = -1 a = 657 b = -876 c = 1095 n = 143 a = -20440 b = 858 c = 20458 n = 70 a = -9782 b = 840 c = 9818 n = -1 a = 584 b = -438 c = 730 n = -2 a = 730 b = -1752 c = 1898 n = 67 a = -4453 b = 804 c = 4525 n = -5 a = 803 b = -4380 c = 4453 n = -67 a = 840 b = -9782 c = 9818 n = -70 a = 858 b = -20440 c = 20458 n = -71 a = 864 b = -31098 c = 31110 n = -72 a = 870 b = -63072 c = 63078 n = -143 a = 867 b = -41756 c = 41765 n = -145 a = 873 b = -127020 c = 127023 n = -217 a = 872 b = -95046 c = 95050 n = -218 a = 874 b = -190968 c = 190970 n = -437 a = 875 b = -382812 c = 382813 h = 1 s = 1×1 cell array {1×3 double}

15   Pass
assert(isequal(right_triangle_sides(588),{ [84 245 259] [147 196 245] }))

n = 293 a = -85848 b = 586 c = 85850 n = 146 a = -42630 b = 584 c = 42634 n = 97 a = -28224 b = 582 c = 28230 n = 48 a = -13818 b = 576 c = 13830 n = 41 a = -11760 b = 574 c = 11774 n = 20 a = -5586 b = 560 c = 5614 n = 13 a = -3528 b = 546 c = 3570 n = 6 a = -1470 b = 504 c = 1554 n = 5 a = -1176 b = 490 c = 1274 n = 2 a = -294 b = 392 c = 490 n = 1 a = 0 b = 294 c = 294 n = 0 a = 294 b = 0 c = 294 n = 145 a = -21021 b = 580 c = 21029 n = 47 a = -6615 b = 564 c = 6639 n = 19 a = -2499 b = 532 c = 2555 n = 5 a = -441 b = 420 c = 609 n = 1 a = 147 b = 196 c = 245 v = 147 196 245 f = 1 s = 1×1 cell array {1×3 double} A = 147 n = -1 a = 441 b = -588 c = 735 n = 95 a = -9016 b = 570 c = 9034 n = 46 a = -4214 b = 552 c = 4250 n = 11 a = -784 b = 462 c = 910 n = 4 a = -98 b = 336 c = 350 n = -1 a = 392 b = -294 c = 490 n = -2 a = 490 b = -1176 c = 1274 n = 43 a = -1813 b = 516 c = 1885 n = 1 a = 245 b = 84 c = 259 v = 84 245 259 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 147 84 n = -5 a = 539 b = -2940 c = 2989 n = 35 a = -1176 b = 490 c = 1274 n = 14 a = -294 b = 392 c = 490 n = 7 a = 0 b = 294 c = 294 n = 0 a = 294 b = 0 c = 294 n = -1 a = 336 b = -98 c = 350 n = -4 a = 462 b = -784 c = 910 n = -5 a = 504 b = -1470 c = 1554 n = -6 a = 546 b = -3528 c = 3570 n = 7 a = 147 b = 196 c = 245 v = 147 196 245 f = 1 f = 0 n = -7 a = 441 b = -588 c = 735 n = -11 a = 525 b = -2156 c = 2219 n = -13 a = 567 b = -7644 c = 7665 n = -7 a = 392 b = -294 c = 490 n = -14 a = 490 b = -1176 c = 1274 n = -19 a = 560 b = -5586 c = 5614 n = -20 a = 574 b = -11760 c = 11774 n = -35 a = 539 b = -2940 c = 2989 n = -41 a = 581 b = -24108 c = 24115 n = -43 a = 552 b = -4214 c = 4250 n = -46 a = 570 b = -9016 c = 9034 n = -47 a = 576 b = -13818 c = 13830 n = -48 a = 582 b = -28224 c = 28230 n = -95 a = 579 b = -18620 c = 18629 n = -97 a = 585 b = -57036 c = 57039 n = -145 a = 584 b = -42630 c = 42634 n = -146 a = 586 b = -85848 c = 85850 n = -293 a = 587 b = -172284 c = 172285 h = 2 1 s = 1×2 cell array {1×3 double} {1×3 double}

16   Pass
assert(isequal(right_triangle_sides(208),{ [39 80 89] }))

n = 103 a = -10608 b = 206 c = 10610 n = 51 a = -5200 b = 204 c = 5204 n = 25 a = -2496 b = 200 c = 2504 n = 12 a = -1144 b = 192 c = 1160 n = 7 a = -624 b = 182 c = 650 n = 3 a = -208 b = 156 c = 260 n = 1 a = 0 b = 104 c = 104 n = 0 a = 104 b = 0 c = 104 n = 50 a = -2496 b = 200 c = 2504 n = 24 a = -1144 b = 192 c = 1160 n = 11 a = -468 b = 176 c = 500 n = 2 a = 0 b = 104 c = 104 n = 0 a = 104 b = 0 c = 104 n = -1 a = 156 b = -208 c = 260 n = 22 a = -468 b = 176 c = 500 n = 9 a = -130 b = 144 c = 194 n = -2 a = 156 b = -208 c = 260 n = -3 a = 182 b = -624 c = 650 n = 5 a = 39 b = 80 c = 89 v = 39 80 89 f = 1 s = 1×1 cell array {1×3 double} A = 39 n = -7 a = 195 b = -1456 c = 1469 n = -5 a = 144 b = -130 c = 194 n = -9 a = 176 b = -468 c = 500 n = -11 a = 192 b = -1144 c = 1160 n = -12 a = 200 b = -2496 c = 2504 n = -22 a = 192 b = -1144 c = 1160 n = -24 a = 200 b = -2496 c = 2504 n = -25 a = 204 b = -5200 c = 5204 n = -50 a = 204 b = -5200 c = 5204 n = -51 a = 206 b = -10608 c = 10610 n = -103 a = 207 b = -21424 c = 21425 h = 1 s = 1×1 cell array {1×3 double}

17   Pass
assert(isequal(right_triangle_sides(228),{ [57 76 95] }))

n = 113 a = -12768 b = 226 c = 12770 n = 56 a = -6270 b = 224 c = 6274 n = 37 a = -4104 b = 222 c = 4110 n = 18 a = -1938 b = 216 c = 1950 n = 5 a = -456 b = 190 c = 494 n = 2 a = -114 b = 152 c = 190 n = 1 a = 0 b = 114 c = 114 n = 0 a = 114 b = 0 c = 114 n = 55 a = -3021 b = 220 c = 3029 n = 17 a = -855 b = 204 c = 879 n = 1 a = 57 b = 76 c = 95 v = 57 76 95 f = 1 s = 1×1 cell array {1×3 double} A = 57 n = -1 a = 171 b = -228 c = 285 n = 35 a = -1216 b = 210 c = 1234 n = 16 a = -494 b = 192 c = 530 n = -1 a = 152 b = -114 c = 190 n = -2 a = 190 b = -456 c = 494 n = 13 a = -133 b = 156 c = 205 n = -5 a = 209 b = -1140 c = 1159 n = -13 a = 192 b = -494 c = 530 n = -16 a = 210 b = -1216 c = 1234 n = -17 a = 216 b = -1938 c = 1950 n = -18 a = 222 b = -4104 c = 4110 n = -35 a = 219 b = -2660 c = 2669 n = -37 a = 225 b = -8436 c = 8439 n = -55 a = 224 b = -6270 c = 6274 n = -56 a = 226 b = -12768 c = 12770 n = -113 a = 227 b = -25764 c = 25765 h = 1 s = 1×1 cell array {1×3 double}

18   Pass
assert(isequal(right_triangle_sides(312),{ [24 143 145] [78 104 130] }))

n = 155 a = -24024 b = 310 c = 24026 n = 77 a = -11856 b = 308 c = 11860 n = 51 a = -7800 b = 306 c = 7806 n = 38 a = -5772 b = 304 c = 5780 n = 25 a = -3744 b = 300 c = 3756 n = 12 a = -1716 b = 288 c = 1740 n = 11 a = -1560 b = 286 c = 1586 n = 5 a = -624 b = 260 c = 676 n = 3 a = -312 b = 234 c = 390 n = 2 a = -156 b = 208 c = 260 n = 1 a = 0 b = 156 c = 156 n = 0 a = 156 b = 0 c = 156 n = 76 a = -5772 b = 304 c = 5780 n = 37 a = -2730 b = 296 c = 2746 n = 24 a = -1716 b = 288 c = 1740 n = 11 a = -702 b = 264 c = 750 n = 4 a = -156 b = 208 c = 260 n = 1 a = 78 b = 104 c = 130 v = 78 104 130 f = 1 s = 1×1 cell array {1×3 double} A = 78 n = 0 a = 156 b = 0 c = 156 n = -1 a = 234 b = -312 c = 390 n = 49 a = -2392 b = 294 c = 2410 n = 23 a = -1040 b = 276 c = 1076 n = 10 a = -364 b = 240 c = 436 n = 1 a = 104 b = 78 c = 130 v = 78 104 130 f = 1 f = 0 n = -1 a = 208 b = -156 c = 260 n = -2 a = 260 b = -624 c = 676 n = 35 a = -1209 b = 280 c = 1241 n = 9 a = -195 b = 216 c = 291 n = -1 a = 195 b = -104 c = 221 n = -3 a = 273 b = -936 c = 975 n = 20 a = -364 b = 240 c = 436 n = 7 a = -26 b = 168 c = 170 n = -4 a = 260 b = -624 c = 676 n = -5 a = 286 b = -1560 c = 1586 n = 1 a = 143 b = 24 c = 145 v = 24 143 145 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 78 24 n = -11 a = 299 b = -3432 c = 3445 n = -1 a = 168 b = -26 c = 170 n = -7 a = 240 b = -364 c = 436 n = -9 a = 264 b = -702 c = 750 n = -10 a = 276 b = -1040 c = 1076 n = -11 a = 288 b = -1716 c = 1740 n = -12 a = 300 b = -3744 c = 3756 n = -20 a = 276 b = -1040 c = 1076 n = -23 a = 294 b = -2392 c = 2410 n = -24 a = 300 b = -3744 c = 3756 n = -25 a = 306 b = -7800 c = 7806 n = -35 a = 296 b = -2730 c = 2746 n = -37 a = 304 b = -5772 c = 5780 n = -38 a = 308 b = -11856 c = 11860 n = -49 a = 303 b = -5096 c = 5105 n = -51 a = 309 b = -15912 c = 15915 n = -76 a = 308 b = -11856 c = 11860 n = -77 a = 310 b = -24024 c = 24026 n = -155 a = 311 b = -48360 c = 48361 h = 2 1 s = 1×2 cell array {1×3 double} {1×3 double}

19   Pass
assert(isequal(right_triangle_sides(924),{ [42 440 442] [77 420 427] [132 385 407] [198 336 390] [231 308 385] }))

n = 461 a = -212520 b = 922 c = 212522 n = 230 a = -105798 b = 920 c = 105802 n = 153 a = -70224 b = 918 c = 70230 n = 76 a = -34650 b = 912 c = 34662 n = 65 a = -29568 b = 910 c = 29582 n = 41 a = -18480 b = 902 c = 18502 n = 32 a = -14322 b = 896 c = 14350 n = 21 a = -9240 b = 882 c = 9282 n = 20 a = -8778 b = 880 c = 8822 n = 13 a = -5544 b = 858 c = 5610 n = 10 a = -4158 b = 840 c = 4242 n = 6 a = -2310 b = 792 c = 2442 n = 5 a = -1848 b = 770 c = 2002 n = 2 a = -462 b = 616 c = 770 n = 1 a = 0 b = 462 c = 462 n = 0 a = 462 b = 0 c = 462 n = 229 a = -52437 b = 916 c = 52445 n = 75 a = -16863 b = 900 c = 16887 n = 31 a = -6699 b = 868 c = 6755 n = 19 a = -3927 b = 836 c = 4015 n = 9 a = -1617 b = 756 c = 1785 n = 5 a = -693 b = 660 c = 957 n = 1 a = 231 b = 308 c = 385 v = 231 308 385 f = 1 s = 1×1 cell array {1×3 double} A = 231 n = -1 a = 693 b = -924 c = 1155 n = 151 a = -22792 b = 906 c = 22810 n = 74 a = -10934 b = 888 c = 10970 n = 19 a = -2464 b = 798 c = 2590 n = 11 a = -1232 b = 726 c = 1430 n = 8 a = -770 b = 672 c = 1022 n = 4 a = -154 b = 528 c = 550 n = -1 a = 616 b = -462 c = 770 n = -2 a = 770 b = -1848 c = 2002 n = 71 a = -5005 b = 852 c = 5077 n = 5 a = 77 b = 420 c = 427 v = 77 420 427 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 231 77 n = 1 a = 385 b = 132 c = 407 v = 132 385 407 f = 1 s = 1×3 cell array {1×3 double} {1×3 double} {1×3 double} A = 231 77 132 n = -5 a = 847 b = -4620 c = 4697 n = 59 a = -3432 b = 826 c = 3530 n = 26 a = -1254 b = 728 c = 1450 n = 15 a = -528 b = 630 c = 822 n = 4 a = 198 b = 336 c = 390 v = 198 336 390 f = 1 s = 1×4 cell array {1×3 double} {1×3 double} {1×3 double} {1×3 double} A = 231 77 132 198 n = -1 a = 528 b = -154 c = 550 n = -4 a = 726 b = -1232 c = 1430 n = -5 a = 792 b = -2310 c = 2442 n = -6 a = 858 b = -5544 c = 5610 n = 31 a = -840 b = 682 c = 1082 n = 10 a = 42 b = 440 c = 442 v = 42 440 442 f = 1 s = 1×5 cell array {1×3 double} {1×3 double} {1×3 double} {1×3 double} {1×3 double} A = 231 77 132 198 42 n = 3 a = 336 b = 198 c = 390 v = 198 336 390 f = 1 f = 0 n = -4 a = 630 b = -528 c = 822 n = -5 a = 672 b = -770 c = 1022 n = -8 a = 798 b = -2464 c = 2590 n = -9 a = 840 b = -4158 c = 4242 n = -10 a = 882 b = -9240 c = 9282 n = 19 a = -165 b = 532 c = 557 n = -3 a = 561 b = -252 c = 615 n = -11 a = 825 b = -3388 c = 3487 n = -13 a = 891 b = -12012 c = 12045 n = 1 a = 440 b = 42 c = 442 v = 42 440 442 f = 1 f = 0 n = -10 a = 682 b = -840 c = 1082 n = -19 a = 880 b = -8778 c = 8822 n = -20 a = 902 b = -18480 c = 18502 n = -1 a = 483 b = -44 c = 485 n = -15 a = 777 b = -1980 c = 2127 n = -19 a = 861 b = -5852 c = 5915 n = -21 a = 903 b = -19404 c = 19425 n = -19 a = 728 b = -1254 c = 1450 n = -26 a = 826 b = -3432 c = 3530 n = -31 a = 896 b = -14322 c = 14350 n = -32 a = 910 b = -29568 c = 29582 n = -31 a = 803 b = -2604 c = 2725 n = -41 a = 913 b = -37884 c = 37895 n = -59 a = 875 b = -7788 c = 7837 n = -65 a = 917 b = -60060 c = 60067 n = -71 a = 888 b = -10934 c = 10970 n = -74 a = 906 b = -22792 c = 22810 n = -75 a = 912 b = -34650 c = 34662 n = -76 a = 918 b = -70224 c = 70230 n = -151 a = 915 b = -46508 c = 46517 n = -153 a = 921 b = -141372 c = 141375 n = -229 a = 920 b = -105798 c = 105802 n = -230 a = 922 b = -212520 c = 212522 n = -461 a = 923 b = -425964 c = 425965 h = 5 2 3 4 1 s = 1×5 cell array {1×3 double} {1×3 double} {1×3 double} {1×3 double} {1×3 double}

20   Pass
assert(isequal(right_triangle_sides(980),{ [280 294 406] }))

n = 489 a = -239120 b = 978 c = 239122 n = 244 a = -119070 b = 976 c = 119074 n = 97 a = -47040 b = 970 c = 47050 n = 69 a = -33320 b = 966 c = 33334 n = 48 a = -23030 b = 960 c = 23050 n = 34 a = -16170 b = 952 c = 16198 n = 13 a = -5880 b = 910 c = 5950 n = 9 a = -3920 b = 882 c = 4018 n = 6 a = -2450 b = 840 c = 2590 n = 4 a = -1470 b = 784 c = 1666 n = 1 a = 0 b = 490 c = 490 n = 0 a = 490 b = 0 c = 490 n = 243 a = -59045 b = 972 c = 59053 n = 47 a = -11025 b = 940 c = 11065 n = 33 a = -7595 b = 924 c = 7651 n = 5 a = -735 b = 700 c = 1015 n = 3 a = -245 b = 588 c = 637 n = -1 a = 735 b = -980 c = 1225 n = 93 a = -8624 b = 930 c = 8674 n = 44 a = -3822 b = 880 c = 3922 n = 9 a = -392 b = 630 c = 742 n = 2 a = 294 b = 280 c = 406 v = 280 294 406 f = 1 s = 1×1 cell array {1×3 double} A = 280 n = -3 a = 784 b = -1470 c = 1666 n = -4 a = 882 b = -3920 c = 4018 n = 63 a = -3920 b = 882 c = 4018 n = 28 a = -1470 b = 784 c = 1666 n = 7 a = 0 b = 490 c = 490 n = 3 a = 280 b = 294 c = 406 v = 280 294 406 f = 1 f = 0 n = 0 a = 490 b = 0 c = 490 n = -2 a = 630 b = -392 c = 742 n = -5 a = 840 b = -2450 c = 2590 n = -6 a = 910 b = -5880 c = 5950 n = 39 a = -1421 b = 780 c = 1621 n = -3 a = 637 b = -420 c = 763 n = -9 a = 931 b = -8820 c = 8869 n = 21 a = -245 b = 588 c = 637 n = -7 a = 735 b = -980 c = 1225 n = -9 a = 805 b = -1764 c = 1939 n = -13 a = 945 b = -12740 c = 12775 n = -21 a = 784 b = -1470 c = 1666 n = -28 a = 882 b = -3920 c = 4018 n = -33 a = 952 b = -16170 c = 16198 n = -34 a = 966 b = -33320 c = 33334 n = -39 a = 880 b = -3822 c = 3922 n = -44 a = 930 b = -8624 c = 8674 n = -47 a = 960 b = -23030 c = 23050 n = -48 a = 970 b = -47040 c = 47050 n = -63 a = 931 b = -8820 c = 8869 n = -69 a = 973 b = -67620 c = 67627 n = -93 a = 955 b = -18228 c = 18253 n = -97 a = 975 b = -95060 c = 95065 n = -243 a = 976 b = -119070 c = 119074 n = -244 a = 978 b = -239120 c = 239122 n = -489 a = 979 b = -479220 c = 479221 h = 1 s = 1×1 cell array {1×3 double}

21   Pass
assert(isequal(right_triangle_sides(112),{ [14 48 50] }))

n = 55 a = -3024 b = 110 c = 3026 n = 27 a = -1456 b = 108 c = 1460 n = 13 a = -672 b = 104 c = 680 n = 7 a = -336 b = 98 c = 350 n = 6 a = -280 b = 96 c = 296 n = 3 a = -112 b = 84 c = 140 n = 1 a = 0 b = 56 c = 56 n = 0 a = 56 b = 0 c = 56 n = 26 a = -672 b = 104 c = 680 n = 12 a = -280 b = 96 c = 296 n = 5 a = -84 b = 80 c = 116 n = 2 a = 0 b = 56 c = 56 n = 0 a = 56 b = 0 c = 56 n = -1 a = 84 b = -112 c = 140 n = 10 a = -84 b = 80 c = 116 n = 3 a = 14 b = 48 c = 50 v = 14 48 50 f = 1 s = 1×1 cell array {1×3 double} A = 14 n = -2 a = 84 b = -112 c = 140 n = -3 a = 98 b = -336 c = 350 n = 1 a = 48 b = 14 c = 50 v = 14 48 50 f = 1 f = 0 n = -3 a = 80 b = -84 c = 116 n = -5 a = 96 b = -280 c = 296 n = -6 a = 104 b = -672 c = 680 n = -1 a = 63 b = -16 c = 65 n = -7 a = 105 b = -784 c = 791 n = -10 a = 96 b = -280 c = 296 n = -12 a = 104 b = -672 c = 680 n = -13 a = 108 b = -1456 c = 1460 n = -26 a = 108 b = -1456 c = 1460 n = -27 a = 110 b = -3024 c = 3026 n = -55 a = 111 b = -6160 c = 6161 h = 1 s = 1×1 cell array {1×3 double}

22   Pass
assert(isequal(right_triangle_sides(30),{ [5 12 13] }))

n = 14 a = -195 b = 28 c = 197 n = 4 a = -45 b = 24 c = 51 n = 2 a = -15 b = 20 c = 25 n = 0 a = 15 b = 0 c = 15 n = 2 a = 5 b = 12 c = 13 v = 5 12 13 f = 1 s = 1×1 cell array {1×3 double} A = 5 n = -2 a = 25 b = -60 c = 65 n = -2 a = 21 b = -20 c = 29 n = -4 a = 27 b = -120 c = 123 n = -14 a = 29 b = -420 c = 421 h = 1 s = 1×1 cell array {1×3 double}

23   Pass
assert(isequal(right_triangle_sides(680),{ [102 280 298] [136 255 289] }))

n = 339 a = -114920 b = 678 c = 114922 n = 169 a = -57120 b = 676 c = 57124 n = 84 a = -28220 b = 672 c = 28228 n = 67 a = -22440 b = 670 c = 22450 n = 33 a = -10880 b = 660 c = 10900 n = 19 a = -6120 b = 646 c = 6154 n = 16 a = -5100 b = 640 c = 5140 n = 9 a = -2720 b = 612 c = 2788 n = 4 a = -1020 b = 544 c = 1156 n = 3 a = -680 b = 510 c = 850 n = 1 a = 0 b = 340 c = 340 n = 0 a = 340 b = 0 c = 340 n = 168 a = -28220 b = 672 c = 28228 n = 83 a = -13770 b = 664 c = 13786 n = 32 a = -5100 b = 640 c = 5140 n = 15 a = -2210 b = 600 c = 2290 n = 8 a = -1020 b = 544 c = 1156 n = 3 a = -170 b = 408 c = 442 n = 0 a = 340 b = 0 c = 340 n = -1 a = 510 b = -680 c = 850 n = 81 a = -6545 b = 648 c = 6577 n = 13 a = -765 b = 520 c = 925 n = 1 a = 255 b = 136 c = 289 v = 136 255 289 f = 1 s = 1×1 cell array {1×3 double} A = 136 n = -3 a = 595 b = -2040 c = 2125 n = 63 a = -3944 b = 630 c = 3994 n = 29 a = -1632 b = 580 c = 1732 n = 12 a = -476 b = 480 c = 676 n = -1 a = 408 b = -170 c = 442 n = -3 a = 544 b = -1020 c = 1156 n = -4 a = 612 b = -2720 c = 2788 n = 24 a = -476 b = 480 c = 676 n = 7 a = 102 b = 280 c = 298 v = 102 280 298 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 136 102 n = -8 a = 612 b = -2720 c = 2788 n = -9 a = 646 b = -6120 c = 6154 n = 3 a = 280 b = 102 c = 298 v = 102 280 298 f = 1 f = 0 n = -7 a = 480 b = -476 c = 676 n = -12 a = 580 b = -1632 c = 1732 n = -13 a = 600 b = -2210 c = 2290 n = -15 a = 640 b = -5100 c = 5140 n = -16 a = 660 b = -10880 c = 10900 n = -3 a = 391 b = -120 c = 409 n = -19 a = 663 b = -12920 c = 12937 n = -24 a = 580 b = -1632 c = 1732 n = -29 a = 630 b = -3944 c = 3994 n = -32 a = 660 b = -10880 c = 10900 n = -33 a = 670 b = -22440 c = 22450 n = -63 a = 655 b = -8568 c = 8593 n = -67 a = 675 b = -45560 c = 45565 n = -81 a = 664 b = -13770 c = 13786 n = -83 a = 672 b = -28220 c = 28228 n = -84 a = 676 b = -57120 c = 57124 n = -168 a = 676 b = -57120 c = 57124 n = -169 a = 678 b = -114920 c = 114922 n = -339 a = 679 b = -230520 c = 230521 h = 2 1 s = 1×2 cell array {1×3 double} {1×3 double}

24   Pass
assert(isequal(right_triangle_sides(396),{ [33 180 183] [72 154 170] [99 132 165] }))

n = 197 a = -38808 b = 394 c = 38810 n = 98 a = -19206 b = 392 c = 19210 n = 65 a = -12672 b = 390 c = 12678 n = 32 a = -6138 b = 384 c = 6150 n = 21 a = -3960 b = 378 c = 3978 n = 17 a = -3168 b = 374 c = 3190 n = 10 a = -1782 b = 360 c = 1818 n = 8 a = -1386 b = 352 c = 1430 n = 5 a = -792 b = 330 c = 858 n = 2 a = -198 b = 264 c = 330 n = 1 a = 0 b = 198 c = 198 n = 0 a = 198 b = 0 c = 198 n = 97 a = -9405 b = 388 c = 9413 n = 31 a = -2871 b = 372 c = 2895 n = 9 a = -693 b = 324 c = 765 n = 7 a = -495 b = 308 c = 583 n = 1 a = 99 b = 132 c = 165 v = 99 132 165 f = 1 s = 1×1 cell array {1×3 double} A = 99 n = -1 a = 297 b = -396 c = 495 n = 63 a = -3960 b = 378 c = 3978 n = 30 a = -1782 b = 360 c = 1818 n = 19 a = -1056 b = 342 c = 1110 n = 8 a = -330 b = 288 c = 438 n = 3 a = 0 b = 198 c = 198 n = 0 a = 198 b = 0 c = 198 n = -1 a = 264 b = -198 c = 330 n = -2 a = 330 b = -792 c = 858 n = 27 a = -693 b = 324 c = 765 n = 5 a = 33 b = 180 c = 183 v = 33 180 183 f = 1 s = 1×2 cell array {1×3 double} {1×3 double} A = 99 33 n = -3 a = 297 b = -396 c = 495 n = -5 a = 363 b = -1980 c = 2013 n = 13 a = -88 b = 234 c = 250 n = 2 a = 154 b = 72 c = 170 v = 72 154 170 f = 1 s = 1×3 cell array {1×3 double} {1×3 double} {1×3 double} A = 99 33 72 n = -7 a = 352 b = -1386 c = 1430 n = -8 a = 374 b = -3168 c = 3190 n = 7 a = 72 b = 154 c = 170 v = 72 154 170 f = 1 f = 0 n = -2 a = 234 b = -88 c = 250 n = -5 a = 288 b = -330 c = 438 n = -8 a = 342 b = -1056 c = 1110 n = -9 a = 360 b = -1782 c = 1818 n = -10 a = 378 b = -3960 c = 3978 n = -7 a = 275 b = -252 c = 373 n = -17 a = 385 b = -6732 c = 6743 n = -13 a = 315 b = -572 c = 653 n = -19 a = 369 b = -2508 c = 2535 n = -21 a = 387 b = -8316 c = 8325 n = -27 a = 360 b = -1782 c = 1818 n = -30 a = 378 b = -3960 c = 3978 n = -31 a = 384 b = -6138 c = 6150 n = -32 a = 390 b = -12672 c = 12678 n = -63 a = 387 b = -8316 c = 8325 n = -65 a = 393 b = -25740 c = 25743 n = -97 a = 392 b = -19206 c = 19210 n = -98 a = 394 b = -38808 c = 38810 n = -197 a = 395 b = -78012 c = 78013 h = 2 3 1 s = 1×3 cell array {1×3 double} {1×3 double} {1×3 double}

25   Pass
assert(isequal(right_triangle_sides(988),{ [266 312 410] }))

n = 493 a = -243048 b = 986 c = 243050 n = 246 a = -121030 b = 984 c = 121034 n = 37 a = -17784 b = 962 c = 17810 n = 25 a = -11856 b = 950 c = 11894 n = 18 a = -8398 b = 936 c = 8450 n = 12 a = -5434 b = 912 c = 5510 n = 1 a = 0 b = 494 c = 494 n = 0 a = 494 b = 0 c = 494 n = 245 a = -60021 b = 980 c = 60029 n = 17 a = -3705 b = 884 c = 3809 n = 11 a = -2223 b = 836 c = 2375 n = -1 a = 741 b = -988 c = 1235 n = 25 a = -456 b = 650 c = 794 n = 6 a = 266 b = 312 c = 410 v = 266 312 410 f = 1 s = 1×1 cell array {1×3 double} A = 266 n = -11 a = 912 b = -5434 c = 5510 n = -12 a = 950 b = -11856 c = 11894 n = 7 a = 312 b = 266 c = 410 v = 266 312 410 f = 1 f = 0 n = -6 a = 650 b = -456 c = 794 n = -17 a = 936 b = -8398 c = 8450 n = -18 a = 962 b = -17784 c = 17810 n = -7 a = 627 b = -364 c = 725 n = -25 a = 969 b = -24700 c = 24719 n = -25 a = 819 b = -1900 c = 2069 n = -37 a = 975 b = -36556 c = 36569 n = -245 a = 984 b = -121030 c = 121034 n = -246 a = 986 b = -243048 c = 243050 n = -493 a = 987 b = -487084 c = 487085 h = 1 s = 1×1 cell array {1×3 double}

Suggested Problems

More from this Author56

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!