The Gateway to Computer Science Excellence
+1 vote
95 views
  1. Assume you have a chocolate bar containing a number of small identical squares arranged in a rectangular pattern. Our job is to split the bar into small squares by breaking along the lines between the squares. We obviously want to do it with the minimum number of breakings. How many breakings will it take?
  2. Consider that the chocolate bar has n breaking lines along the length and m breaking lines along the breadth. Write a C function that will take n, m as inputs and print the line numbers along the length and the breadth according to your strategy of breaking the chocolate.
in Algorithms by Veteran (105k points) | 95 views

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,352 answers
198,472 comments
105,244 users