Cody

# Problem 45394. Count the number of folds needed to pack a large sheet

Solution 2185098

Submitted on 31 Mar 2020 by Nikolaos Nikolaou
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(number_of_folds(3247,2132),24))

y = 24 p = 0.7927 0.5205

2   Pass
assert(isequal(number_of_folds(1403,3757),23))

y = 23 p = 0.6851 0.9172

3   Pass
assert(isequal(number_of_folds(3504,2201),24))

y = 24 p = 0.8555 0.5374

4   Pass
assert(isequal(number_of_folds(2490,2349),24))

y = 24 p = 0.6079 0.5735

5   Pass
assert(isequal(number_of_folds(831,1205),21))

y = 21 p = 0.8115 0.5884

6   Pass
assert(isequal(number_of_folds(1884,922),21))

y = 21 p = 0.9199 0.9004

7   Pass
assert(isequal(number_of_folds(2,4),5))

y = 5 p = 0.5000 0.5000

8   Pass
assert(isequal(number_of_folds(3378,780),22))

y = 22 p = 0.8247 0.7617

9   Pass
assert(isequal(number_of_folds(904,683),20))

y = 20 p = 0.8828 0.6670

10   Pass
assert(isequal(number_of_folds(911,1743),21))

y = 21 p = 0.8896 0.8511

11   Pass
assert(isequal(number_of_folds(1245,3694),23))

y = 23 p = 0.6079 0.9019

12   Pass
assert(isequal(number_of_folds(1721,740),21))

y = 21 p = 0.8403 0.7227

13   Pass
assert(isequal(number_of_folds(3620,3919),24))

y = 24 p = 0.8838 0.9568

14   Pass
assert(isequal(number_of_folds(1756,445),20))

y = 20 p = 0.8574 0.8691

15   Pass
assert(isequal(number_of_folds(1033,1635),22))

y = 22 p = 0.5044 0.7983

16   Pass
assert(isequal(number_of_folds(2380,1049),23))

y = 23 p = 0.5811 0.5122

17   Pass
assert(isequal(number_of_folds(2412,2845),24))

y = 24 p = 0.5889 0.6946

18   Pass
assert(isequal(number_of_folds(887,470),19))

y = 19 p = 0.8662 0.9180

19   Pass
assert(isequal(number_of_folds(1187,1276),22))

y = 22 p = 0.5796 0.6230

20   Pass
assert(isequal(number_of_folds(1697,2032),22))

y = 22 p = 0.8286 0.9922

21   Pass
assert(isequal(number_of_folds(343,1050),20))

y = 20 p = 0.6699 0.5127

22   Pass
assert(isequal(number_of_folds(3205,117),19))

y = 19 p = 0.7825 0.9141

23   Pass
assert(isequal(number_of_folds(3716,2922),24))

y = 24 p = 0.9072 0.7134

24   Pass
assert(isequal(number_of_folds(1955,2315),23))

y = 23 p = 0.9546 0.5652

25   Pass
assert(isequal(number_of_folds(950,1836),21))

y = 21 p = 0.9277 0.8965

26   Pass
assert(isequal(number_of_folds(3853,2188),24))

y = 24 p = 0.9407 0.5342

27   Pass
assert(isequal(number_of_folds(2085,927),22))

y = 22 p = 0.5090 0.9053

28   Pass
assert(isequal(number_of_folds(1956,2497),23))

y = 23 p = 0.9551 0.6096

29   Pass
assert(isequal(number_of_folds(2717,1583),23))

y = 23 p = 0.6633 0.7729

30   Pass
assert(isequal(number_of_folds(1470,3952),23))

y = 23 p = 0.7178 0.9648

31   Pass
assert(isequal(number_of_folds(151,3541),20))

y = 20 p = 0.5898 0.8645

32   Pass
assert(isequal(number_of_folds(3654,3185),24))

y = 24 p = 0.8921 0.7776

33   Pass
assert(isequal(number_of_folds(395,1048),20))

y = 20 p = 0.7715 0.5117

34   Pass
assert(isequal(number_of_folds(1342,2719),23))

y = 23 p = 0.6553 0.6638

35   Pass
assert(isequal(number_of_folds(547,2885),22))

y = 22 p = 0.5342 0.7043

36   Pass
assert(isequal(number_of_folds(428,2616),21))

y = 21 p = 0.8359 0.6387

37   Pass
assert(isequal(number_of_folds(1977,3117),23))

y = 23 p = 0.9653 0.7610

38   Pass
assert(isequal(number_of_folds(2861,3615),24))

y = 24 p = 0.6985 0.8826

39   Pass
assert(isequal(number_of_folds(3564,1337),23))

y = 23 p = 0.8701 0.6528

40   Pass
assert(isequal(number_of_folds(1,4000),13))

y = 13 p = 0.5000 0.9766

41   Pass
assert(isequal(number_of_folds(2795,792),22))

y = 22 p = 0.6824 0.7734

42   Pass
assert(isequal(number_of_folds(123,2977),19))

y = 19 p = 0.9609 0.7268

43   Pass
assert(isequal(number_of_folds(2001,1920),22))

y = 22 p = 0.9771 0.9375

44   Pass
assert(isequal(number_of_folds(3619,2440),24))

y = 24 p = 0.8835 0.5957

45   Pass
assert(isequal(number_of_folds(2471,3438),24))

y = 24 p = 0.6033 0.8394

46   Pass
assert(isequal(number_of_folds(3222,2307),24))

y = 24 p = 0.7866 0.5632

47   Pass
assert(isequal(number_of_folds(732,960),20))

y = 20 p = 0.7148 0.9375

48   Pass
assert(isequal(number_of_folds(3547,115),19))

y = 19 p = 0.8660 0.8984

49   Pass
assert(isequal(number_of_folds(1960,672),21))

y = 21 p = 0.9570 0.6562

50   Pass
assert(isequal(number_of_folds(3915,2851),24))

y = 24 p = 0.9558 0.6960

51   Pass
assert(isequal(number_of_folds(2002,1885),22))

y = 22 p = 0.9775 0.9204

52   Pass
assert(isequal(number_of_folds(239,2728),20))

y = 20 p = 0.9336 0.6660

53   Pass
assert(isequal(number_of_folds(170,286),17))

y = 17 p = 0.6641 0.5586

54   Pass
assert(isequal(number_of_folds(2087,387),21))

y = 21 p = 0.5095 0.7559

55   Pass
assert(isequal(number_of_folds(3273,3271),24))

y = 24 p = 0.7991 0.7986

56   Pass
assert(isequal(number_of_folds(2890,600),22))

y = 22 p = 0.7056 0.5859

57   Pass
assert(isequal(number_of_folds(2639,2075),24))

y = 24 p = 0.6443 0.5066

58   Pass
assert(isequal(number_of_folds(3892,2596),24))

y = 24 p = 0.9502 0.6338

59   Pass
assert(isequal(number_of_folds(3202,1816),23))

y = 23 p = 0.7817 0.8867

60   Pass
assert(isequal(number_of_folds(1730,3302),23))

y = 23 p = 0.8447 0.8062

61   Pass
assert(isequal(number_of_folds(334,533),19))

y = 19 p = 0.6523 0.5205

62   Pass
assert(isequal(number_of_folds(694,1564),21))

y = 21 p = 0.6777 0.7637

63   Pass
assert(isequal(number_of_folds(3326,3214),24))

y = 24 p = 0.8120 0.7847

64   Pass
assert(isequal(number_of_folds(242,1598),19))

y = 19 p = 0.9453 0.7803

65   Pass
assert(isequal(number_of_folds(2108,1668),23))

y = 23 p = 0.5146 0.8145

66   Pass
assert(isequal(number_of_folds(2628,2512),24))

y = 24 p = 0.6416 0.6133

67   Pass
assert(isequal(number_of_folds(1168,1727),22))

y = 22 p = 0.5703 0.8433

68   Pass
assert(isequal(number_of_folds(62,3937),18))

y = 18 p = 0.9688 0.9612

69   Pass
assert(isequal(number_of_folds(669,425),19))

y = 19 p = 0.6533 0.8301

70   Pass
assert(isequal(number_of_folds(1490,793),21))

y = 21 p = 0.7275 0.7744

71   Pass
assert(isequal(number_of_folds(1959,1358),22))

y = 22 p = 0.9565 0.6631

72   Pass
assert(isequal(number_of_folds(3807,3682),24))

y = 24 p = 0.9294 0.8989

73   Pass
assert(isequal(number_of_folds(211,2952),20))

y = 20 p = 0.8242 0.7207

74   Pass
assert(isequal(number_of_folds(1077,1692),22))

y = 22 p = 0.5259 0.8262

75   Pass
assert(isequal(number_of_folds(2192,3771),24))

y = 24 p = 0.5352 0.9207

76   Pass
assert(isequal(number_of_folds(1,1),2))

y = 2 p = 0.5000 0.5000

77   Pass
assert(isequal(number_of_folds(1671,3933),23))

y = 23 p = 0.8159 0.9602

78   Pass
assert(isequal(number_of_folds(1206,2805),23))

y = 23 p = 0.5889 0.6848

79   Pass
assert(isequal(number_of_folds(2666,2157),24))

y = 24 p = 0.6509 0.5266

80   Pass
assert(isequal(number_of_folds(2793,2667),24))

y = 24 p = 0.6819 0.6511

81   Pass
assert(isequal(number_of_folds(713,513),20))

y = 20 p = 0.6963 0.5010

82   Pass
assert(isequal(number_of_folds(3997,685),22))

y = 22 p = 0.9758 0.6689

83   Pass
assert(isequal(number_of_folds(131,2245),20))

y = 20 p = 0.5117 0.5481

84   Pass
assert(isequal(number_of_folds(3528,2677),24))

y = 24 p = 0.8613 0.6536

85   Pass
assert(isequal(number_of_folds(762,1476),21))

y = 21 p = 0.7441 0.7207

86   Pass
assert(isequal(number_of_folds(1843,3927),23))

y = 23 p = 0.8999 0.9587

87   Pass
assert(isequal(number_of_folds(626,3423),22))

y = 22 p = 0.6113 0.8357

88   Pass
assert(isequal(number_of_folds(2580,1506),23))

y = 23 p = 0.6299 0.7354

89   Pass
assert(isequal(number_of_folds(764,1714),21))

y = 21 p = 0.7461 0.8369

90   Pass
assert(isequal(number_of_folds(1929,483),20))

y = 20 p = 0.9419 0.9434

91   Pass
assert(isequal(number_of_folds(2359,905),22))

y = 22 p = 0.5759 0.8838

92   Pass
assert(isequal(number_of_folds(1539,2332),23))

y = 23 p = 0.7515 0.5693

93   Pass
assert(isequal(number_of_folds(1008,1162),21))

y = 21 p = 0.9844 0.5674

94   Pass
assert(isequal(number_of_folds(2469,1062),23))

y = 23 p = 0.6028 0.5186

95   Pass
assert(isequal(number_of_folds(15,15),8))

y = 8 p = 0.9375 0.9375

96   Pass
assert(isequal(number_of_folds(3298,3931),24))

y = 24 p = 0.8052 0.9597

97   Pass
assert(isequal(number_of_folds(2921,1376),23))

y = 23 p = 0.7131 0.6719

98   Pass
assert(isequal(number_of_folds(2337,432),21))

y = 21 p = 0.5706 0.8438

99   Pass
assert(isequal(number_of_folds(3626,3519),24))

y = 24 p = 0.8853 0.8591

100   Pass
assert(isequal(number_of_folds(3272,1043),23))

y = 23 p = 0.7988 0.5093

101   Pass
assert(isequal(number_of_folds(3,2),4))

y = 4 p = 0.7500 0.5000

102   Pass
assert(isequal(number_of_folds(2378,91),19))

y = 19 p = 0.5806 0.7109

103   Pass
assert(isequal(number_of_folds(1702,1251),22))

y = 22 p = 0.8311 0.6108

104   Pass
assert(isequal(number_of_folds(646,716),20))

y = 20 p = 0.6309 0.6992

105   Pass
assert(isequal(number_of_folds(1692,377),20))

y = 20 p = 0.8262 0.7363

106   Pass
assert(isequal(number_of_folds(16,15),9))

y = 9 p = 0.5000 0.9375

### Community Treasure Hunt

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

Start Hunting!