HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Gifts of Santa Claus

Section problems

• Permutations
• Reverse permutation
• Divisors count
• GCD of ones
• Set cover problem
• Subsets
• The N Queens Problem
• Maximum Sum 2
• Gifts of Santa Claus
• Shopping
• Diameter of graph
• Corridor
• Prime numbers
• Rectangles on a plane
• A. Бактерии
• A. Любимые числа
• A. Рекламный щит

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