HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Gifts of Santa Claus

Section problems

• Istanbul
• Buying hay
• Sum until 0
• Sum less than N
• Sum of N numbers
• The N Queens Problem
• Subsets
• Maximum Sum 2
• Gifts of Santa Claus
• Rectangles on a plane
• Permutations
• Reverse permutation
• Nameplates
• Adjacency matrix to edges list
• Edges list to Adjacency matrix
• Cities and roads
• Cycle detection

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 500/500/500/500 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

A candy weighs X grams, an orange Y grams and an apple Z grams. The Santa Claus has a bag which can hold exactly W grams. Write a program that will determine number of different options of packing a full bag of presents.

Input

There are 4 integers X, Y, Z, W in a single line of input (1 ≤ X, Y, Z ≤ 100, 1 ≤ W ≤ 1000).

Output

Write number of diferent options for the Santa Claus.

Example

stdin stdout
10 25 15 40

3

*4 candies, 1 orange and 1 apple, 1 candy and 2 apples

Для отправки решений необходимо выполнить вход.

www.contester.ru