Skip to content

Instantly share code, notes, and snippets.

@i-van
Created August 29, 2016 14:01
Show Gist options
  • Save i-van/d79ec8035d8c4966aa29228023741d89 to your computer and use it in GitHub Desktop.
Save i-van/d79ec8035d8c4966aa29228023741d89 to your computer and use it in GitHub Desktop.
Candy weighs X grams, tangerine - Y grams and apple - Z grams.
Need to write a program that will determine how many different versions of gifts weighing exactly W grams can make Santa Claus.
Input data
Function should receive four integers X, Y, Z and W.
Output data
Function should return a single integer - the number of gift options.
Example:
X = 10
Y = 25
Z = 15
W = 40
Result: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment