Cody

# Problem 2582. Cut an orange

Solution 722324

Submitted on 25 Aug 2015 by kfncgnhx eprueqxc
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
%% Grid with N=1 doesn't cut the orange, it represents the smallest cube that orange can fit in. There are no juicy cubes, one piece sorrounded by peel. N = 1; y_correct = [0 1]; assert(isequal(cut_orange(N),y_correct))

pieces = 0 1

2   Pass
%% N = 1; y_correct = [0 1]; assert(isequal(cut_orange(N),y_correct))

pieces = 0 1

3   Pass
%% N = 2; y_correct = [0 8]; assert(isequal(cut_orange(N),y_correct))

pieces = 0 8

4   Pass
%% N = 3; y_correct = [1 26]; assert(isequal(cut_orange(N),y_correct))

pieces = 1 26

5   Pass
%% N = 4; y_correct = [8 56]; assert(isequal(cut_orange(N),y_correct))

pieces = 8 56

6   Pass
%% N = 5; y_correct = [19 98]; % was [27 90] assert(isequal(cut_orange(N),y_correct))

pieces = 19 98

7   Pass
%% N = 6; y_correct = [32 152]; % was [56 128]; assert(isequal(cut_orange(N),y_correct))

pieces = 32 152

8   Pass
%% N = 7; y_correct = [81 194]; assert(isequal(cut_orange(N),y_correct))

pieces = 81 194

9   Pass
%% N = 8; y_correct = [136 272]; % was [160 248]; assert(isequal(cut_orange(N),y_correct))

pieces = 136 272

10   Pass
%% N = 9; y_correct = [203 362]; % was [251 314]; assert(isequal(cut_orange(N),y_correct))

pieces = 203 362

11   Pass
%% N = 10; y_correct = [304 416]; % was [312 408]; assert(isequal(cut_orange(N),y_correct))

pieces = 304 416

12   Pass
%% % finally more cubes than peels! N = 13; assert(isequal(-diff(cut_orange(N)),5))

pieces = 751 746

13   Pass
%% N = 19; y_correct = [2769 1658]; assert(isequal(cut_orange(N),y_correct))

pieces = 2769 1658
{"ft_lang_label":"__label__en","ft_lang_prob":0.566959,"math_prob":0.99975556,"size":1784,"snap":"2020-34-2020-40","text_gpt3_token_len":632,"char_repetition_ratio":0.23820224,"word_repetition_ratio":0.060402684,"special_character_ratio":0.4501121,"punctuation_ratio":0.14371258,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9980709,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-05T11:52:25Z\",\"WARC-Record-ID\":\"<urn:uuid:e65b6b82-98e2-48de-8ab3-b734bdd03588>\",\"Content-Length\":\"79566\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:cf1826b6-c4a4-4971-930d-b78b54d5fc9a>\",\"WARC-Concurrent-To\":\"<urn:uuid:a80c9677-5ea7-4bb7-a263-8bf8e2a40858>\",\"WARC-IP-Address\":\"23.221.200.217\",\"WARC-Target-URI\":\"https://la.mathworks.com/matlabcentral/cody/problems/2582-cut-an-orange/solutions/722324\",\"WARC-Payload-Digest\":\"sha1:PUUUZZ252MC3A473L5PRVWNQPOS6UTC6\",\"WARC-Block-Digest\":\"sha1:LRLNIWNT6LRWZLBY7MBHTV3E475ZG2TS\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439735939.26_warc_CC-MAIN-20200805094821-20200805124821-00448.warc.gz\"}"}