Cody

# Problem 1066. Multiples of a Number in a Given Range

Solution 3203646

Submitted on 14 Oct 2020
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   Fail
assert(isequal(bounded_multiples(66,119,163),132))

multiples = Columns 1 through 17 172.0000 171.0462 170.0923 169.1385 168.1846 167.2308 166.2769 165.3231 164.3692 163.4154 162.4615 161.5077 160.5538 159.6000 158.6462 157.6923 156.7385 Columns 18 through 34 155.7846 154.8308 153.8769 152.9231 151.9692 151.0154 150.0615 149.1077 148.1538 147.2000 146.2462 145.2923 144.3385 143.3846 142.4308 141.4769 140.5231 Columns 35 through 51 139.5692 138.6154 137.6615 136.7077 135.7538 134.8000 133.8462 132.8923 131.9385 130.9846 130.0308 129.0769 128.1231 127.1692 126.2154 125.2615 124.3077 Columns 52 through 66 123.3538 122.4000 121.4462 120.4923 119.5385 118.5846 117.6308 116.6769 115.7231 114.7692 113.8154 112.8615 111.9077 110.9538 110.0000

Assertion failed.

2   Fail
assert(isequal(bounded_multiples(50,341,960),[350 400 450 500 550 600 650 700 750 800 850 900 950]))

multiples = Columns 1 through 17 382.0000 392.9592 403.9184 414.8776 425.8367 436.7959 447.7551 458.7143 469.6735 480.6327 491.5918 502.5510 513.5102 524.4694 535.4286 546.3878 557.3469 Columns 18 through 34 568.3061 579.2653 590.2245 601.1837 612.1429 623.1020 634.0612 645.0204 655.9796 666.9388 677.8980 688.8571 699.8163 710.7755 721.7347 732.6939 743.6531 Columns 35 through 50 754.6122 765.5714 776.5306 787.4898 798.4490 809.4082 820.3673 831.3265 842.2857 853.2449 864.2041 875.1633 886.1224 897.0816 908.0408 919.0000

Assertion failed.

3   Fail
assert(isequal(bounded_multiples(59,224,752),[236 295 354 413 472 531 590 649 708]))

multiples = Columns 1 through 17 271.0000 278.4828 285.9655 293.4483 300.9310 308.4138 315.8966 323.3793 330.8621 338.3448 345.8276 353.3103 360.7931 368.2759 375.7586 383.2414 390.7241 Columns 18 through 34 398.2069 405.6897 413.1724 420.6552 428.1379 435.6207 443.1034 450.5862 458.0690 465.5517 473.0345 480.5172 488.0000 495.4828 502.9655 510.4483 517.9310 Columns 35 through 51 525.4138 532.8966 540.3793 547.8621 555.3448 562.8276 570.3103 577.7931 585.2759 592.7586 600.2414 607.7241 615.2069 622.6897 630.1724 637.6552 645.1379 Columns 52 through 59 652.6207 660.1034 667.5862 675.0690 682.5517 690.0345 697.5172 705.0000

Assertion failed.

4   Fail
assert(isequal(bounded_multiples(26,506,700),[520 546 572 598 624 650 676]))

multiples = Columns 1 through 17 518.0000 524.8000 531.6000 538.4000 545.2000 552.0000 558.8000 565.6000 572.4000 579.2000 586.0000 592.8000 599.6000 606.4000 613.2000 620.0000 626.8000 Columns 18 through 26 633.6000 640.4000 647.2000 654.0000 660.8000 667.6000 674.4000 681.2000 688.0000

Assertion failed.

5   Fail
assert(isequal(bounded_multiples(90,548,960),[630 720 810 900]))

multiples = Columns 1 through 17 556.0000 560.4494 564.8989 569.3483 573.7978 578.2472 582.6966 587.1461 591.5955 596.0449 600.4944 604.9438 609.3933 613.8427 618.2921 622.7416 627.1910 Columns 18 through 34 631.6404 636.0899 640.5393 644.9888 649.4382 653.8876 658.3371 662.7865 667.2360 671.6854 676.1348 680.5843 685.0337 689.4831 693.9326 698.3820 702.8315 Columns 35 through 51 707.2809 711.7303 716.1798 720.6292 725.0787 729.5281 733.9775 738.4270 742.8764 747.3258 751.7753 756.2247 760.6742 765.1236 769.5730 774.0225 778.4719 Columns 52 through 68 782.9213 787.3708 791.8202 796.2697 800.7191 805.1685 809.6180 814.0674 818.5169 822.9663 827.4157 831.8652 836.3146 840.7640 845.2135 849.6629 854.1124 Columns 69 through 85 858.5618 863.0112 867.4607 871.9101 876.3596 880.8090 885.2584 889.7079 894.1573 898.6067 903.0562 907.5056 911.9551 916.4045 920.8539 925.3034 929.7528 Columns 86 through 90 934.2022 938.6517 943.1011 947.5506 952.0000

Assertion failed.

6   Fail
assert(isequal(bounded_multiples(14,150,258),[154 168 182 196 210 224 238 252]))

multiples = 160.0000 166.7692 173.5385 180.3077 187.0769 193.8462 200.6154 207.3846 214.1538 220.9231 227.6923 234.4615 241.2308 248.0000

Assertion failed.

7   Fail
assert(isequal(bounded_multiples(85,255,815),[255 340 425 510 595 680 765]))

multiples = Columns 1 through 17 255.0000 261.6667 268.3333 275.0000 281.6667 288.3333 295.0000 301.6667 308.3333 315.0000 321.6667 328.3333 335.0000 341.6667 348.3333 355.0000 361.6667 Columns 18 through 34 368.3333 375.0000 381.6667 388.3333 395.0000 401.6667 408.3333 415.0000 421.6667 428.3333 435.0000 441.6667 448.3333 455.0000 461.6667 468.3333 475.0000 Columns 35 through 51 481.6667 488.3333 495.0000 501.6667 508.3333 515.0000 521.6667 528.3333 535.0000 541.6667 548.3333 555.0000 561.6667 568.3333 575.0000 581.6667 588.3333 Columns 52 through 68 595.0000 601.6667 608.3333 615.0000 621.6667 628.3333 635.0000 641.6667 648.3333 655.0000 661.6667 668.3333 675.0000 681.6667 688.3333 695.0000 701.6667 Columns 69 through 85 708.3333 715.0000 721.6667 728.3333 735.0000 741.6667 748.3333 755.0000 761.6667 768.3333 775.0000 781.6667 788.3333 795.0000 801.6667 808.3333 815.0000

Assertion failed.

8   Fail
assert(isequal(bounded_multiples(25,350,930),[350 375 400 425 450 475 500 525 550 575 600 625 650 675 700 725 750 775 800 825 850 875 900 925]))

multiples = Columns 1 through 17 350.0000 374.1667 398.3333 422.5000 446.6667 470.8333 495.0000 519.1667 543.3333 567.5000 591.6667 615.8333 640.0000 664.1667 688.3333 712.5000 736.6667 Columns 18 through 25 760.8333 785.0000 809.1667 833.3333 857.5000 881.6667 905.8333 930.0000

Assertion failed.

9   Fail
assert(isequal(bounded_multiples(20,252,617),[260 280 300 320 340 360 380 400 420 440 460 480 500 520 540 560 580 600]))

multiples = Columns 1 through 17 264.0000 281.9474 299.8947 317.8421 335.7895 353.7368 371.6842 389.6316 407.5789 425.5263 443.4737 461.4211 479.3684 497.3158 515.2632 533.2105 551.1579 Columns 18 through 20 569.1053 587.0526 605.0000

Assertion failed.

10   Fail
assert(isequal(bounded_multiples(48,352,831),[384 432 480 528 576 624 672 720 768 816]))

multiples = Columns 1 through 17 368.0000 377.5106 387.0213 396.5319 406.0426 415.5532 425.0638 434.5745 444.0851 453.5957 463.1064 472.6170 482.1277 491.6383 501.1489 510.6596 520.1702 Columns 18 through 34 529.6809 539.1915 548.7021 558.2128 567.7234 577.2340 586.7447 596.2553 605.7660 615.2766 624.7872 634.2979 643.8085 653.3191 662.8298 672.3404 681.8511 Columns 35 through 48 691.3617 700.8723 710.3830 719.8936 729.4043 738.9149 748.4255 757.9362 767.4468 776.9574 786.4681 795.9787 805.4894 815.0000

Assertion failed.

11   Fail
assert(isequal(bounded_multiples(59,550,918),[590 649 708 767 826 885]))

multiples = Columns 1 through 17 569.0000 574.6897 580.3793 586.0690 591.7586 597.4483 603.1379 608.8276 614.5172 620.2069 625.8966 631.5862 637.2759 642.9655 648.6552 654.3448 660.0345 Columns 18 through 34 665.7241 671.4138 677.1034 682.7931 688.4828 694.1724 699.8621 705.5517 711.2414 716.9310 722.6207 728.3103 734.0000 739.6897 745.3793 751.0690 756.7586 Columns 35 through 51 762.4483 768.1379 773.8276 779.5172 785.2069 790.8966 796.5862 802.2759 807.9655 813.6552 819.3448 825.0345 830.7241 836.4138 842.1034 847.7931 853.4828 Columns 52 through 59 859.1724 864.8621 870.5517 876.2414 881.9310 887.6207 893.3103 899.0000

Assertion failed.

12   Fail
assert(isequal(bounded_multiples(29,754,758),754))

multiples = Columns 1 through 17 754.0000 754.1429 754.2857 754.4286 754.5714 754.7143 754.8571 755.0000 755.1429 755.2857 755.4286 755.5714 755.7143 755.8571 756.0000 756.1429 756.2857 Columns 18 through 29 756.4286 756.5714 756.7143 756.8571 757.0000 757.1429 757.2857 757.4286 757.5714 757.7143 757.8571 758.0000

Assertion failed.

13   Fail
assert(isequal(bounded_multiples(39,76,568),[78 117 156 195 234 273 312 351 390 429 468 507 546]))

multiples = Columns 1 through 29 113 124 135 146 157 168 179 190 201 212 223 234 245 256 267 278 289 300 311 322 333 344 355 366 377 388 399 410 421 Columns 30 through 39 432 443 454 465 476 487 498 509 520 531

Assertion failed.

14   Fail
assert(isequal(bounded_multiples(6,531,780),[534 540 546 552 558 564 570 576 582 588 594 600 606 612 618 624 630 636 642 648 654 660 666 672 678 684 690 696 702 708 714 720 726 732 738 744 750 756 762 768 774 780]))

multiples = 534.0000 582.6000 631.2000 679.8000 728.4000 777.0000

Assertion failed.

15   Fail
assert(isequal(bounded_multiples(94,130,569),[188 282 376 470 564]))

multiples = Columns 1 through 17 166.0000 169.9462 173.8925 177.8387 181.7849 185.7312 189.6774 193.6237 197.5699 201.5161 205.4624 209.4086 213.3548 217.3011 221.2473 225.1935 229.1398 Columns 18 through 34 233.0860 237.0323 240.9785 244.9247 248.8710 252.8172 256.7634 260.7097 264.6559 268.6022 272.5484 276.4946 280.4409 284.3871 288.3333 292.2796 296.2258 Columns 35 through 51 300.1720 304.1183 308.0645 312.0108 315.9570 319.9032 323.8495 327.7957 331.7419 335.6882 339.6344 343.5806 347.5269 351.4731 355.4194 359.3656 363.3118 Columns 52 through 68 367.2581 371.2043 375.1505 379.0968 383.0430 386.9892 390.9355 394.8817 398.8280 402.7742 406.7204 410.6667 414.6129 418.5591 422.5054 426.4516 430.3978 Columns 69 through 85 434.3441 438.2903 442.2366 446.1828 450.1290 454.0753 458.0215 461.9677 465.9140 469.8602 473.8065 477.7527 481.6989 485.6452 489.5914 493.5376 497.4839 Columns 86 through 94 501.4301 505.3763 509.3226 513.2688 517.2151 521.1613 525.1075 529.0538 533.0000

Assertion failed.

16   Fail
assert(isequal(bounded_multiples(47,12,338),[47 94 141 188 235 282 329]))

multiples = Columns 1 through 17 24.0000 30.5652 37.1304 43.6957 50.2609 56.8261 63.3913 69.9565 76.5217 83.0870 89.6522 96.2174 102.7826 109.3478 115.9130 122.4783 129.0435 Columns 18 through 34 135.6087 142.1739 148.7391 155.3043 161.8696 168.4348 175.0000 181.5652 188.1304 194.6957 201.2609 207.8261 214.3913 220.9565 227.5217 234.0870 240.6522 Columns 35 through 47 247.2174 253.7826 260.3478 266.9130 273.4783 280.0435 286.6087 293.1739 299.7391 306.3043 312.8696 319.4348 326.0000

Assertion failed.

17   Fail
assert(isequal(bounded_multiples(17,312,795),[323 340 357 374 391 408 425 442 459 476 493 510 527 544 561 578 595 612 629 646 663 680 697 714 731 748 765 782]))

multiples = 318.0000 347.4375 376.8750 406.3125 435.7500 465.1875 494.6250 524.0625 553.5000 582.9375 612.3750 641.8125 671.2500 700.6875 730.1250 759.5625 789.0000

Assertion failed.

18   Fail
assert(isequal(bounded_multiples(53,166,602),[212 265 318 371 424 477 530 583]))

multiples = Columns 1 through 17 173.0000 181.1154 189.2308 197.3462 205.4615 213.5769 221.6923 229.8077 237.9231 246.0385 254.1538 262.2692 270.3846 278.5000 286.6154 294.7308 302.8462 Columns 18 through 34 310.9615 319.0769 327.1923 335.3077 343.4231 351.5385 359.6538 367.7692 375.8846 384.0000 392.1154 400.2308 408.3462 416.4615 424.5769 432.6923 440.8077 Columns 35 through 51 448.9231 457.0385 465.1538 473.2692 481.3846 489.5000 497.6154 505.7308 513.8462 521.9615 530.0769 538.1923 546.3077 554.4231 562.5385 570.6538 578.7692 Columns 52 through 53 586.8846 595.0000

Assertion failed.

19   Fail
assert(isequal(bounded_multiples(27,655,690),675))

multiples = Columns 1 through 17 662.0000 662.8077 663.6154 664.4231 665.2308 666.0385 666.8462 667.6538 668.4615 669.2692 670.0769 670.8846 671.6923 672.5000 673.3077 674.1154 674.9231 Columns 18 through 27 675.7308 676.5385 677.3462 678.1538 678.9615 679.7692 680.5769 681.3846 682.1923 683.0000

Assertion failed.

20   Fail
assert(isequal(bounded_multiples(75,84,451),[150 225 300 375 450]))

multiples = Columns 1 through 17 93.0000 97.7162 102.4324 107.1486 111.8649 116.5811 121.2973 126.0135 130.7297 135.4459 140.1622 144.8784 149.5946 154.3108 159.0270 163.7432 168.4595 Columns 18 through 34 173.1757 177.8919 182.6081 187.3243 192.0405 196.7568 201.4730 206.1892 210.9054 215.6216 220.3378 225.0541 229.7703 234.4865 239.2027 243.9189 248.6351 Columns 35 through 51 253.3514 258.0676 262.7838 267.5000 272.2162 276.9324 281.6486 286.3649 291.0811 295.7973 300.5135 305.2297 309.9459 314.6622 319.3784 324.0946 328.8108 Columns 52 through 68 333.5270 338.2432 342.9595 347.6757 352.3919 357.1081 361.8243 366.5405 371.2568 375.9730 380.6892 385.4054 390.1216 394.8378 399.5541 404.2703 408.9865 Columns 69 through 75 413.7027 418.4189 423.1351 427.8514 432.5676 437.2838 442.0000

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!