Malvina's Vacation
In the wardrobe of the renowned beauty Malvina, there are a dresses, b hats, and c handbags. However, her suitcase can accommodate no more than n items. Malvina wants to pack for her vacation in a way that allows her to make the maximum number of social appearances. For each appearance, she will wear a complete outfit consisting of a dress, a hat, and a handbag. According to etiquette, the outfits for any two social events must differ by at least two items. Your task is to help Malvina determine the maximum number of social appearances she can make by optimally packing her suitcase.
Input
The input consists of a single line containing four integers: a, b, c, and n (0 < a, b, c, n < 10000).
Output
Output a single integer representing the maximum number of outfits that can be assembled, each differing by at least two items, with the optimal packing of the suitcase.