EnggRoom

Full Version: C programming project
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Language of coding is C only. No other language is allowed for this.

You will be given a file with two lines. First line will contain two integers separated by commas(say X,Y). In the next line there will be Y number of integers again separated by commas. You should be able to output all the possible combinations from the Y integers (an integer can be used infinite number of times) which addition will give the value X.

Example Input

10,4
2,5,3,6

The output will be:
2+2+2+2+2
2+2+3+3
2+2+6
2+3+5
5+5

The order of the output does not matter