CF189A Cut Ribbon

题目描述

给一长度为n的缎带,要求将其剪成若干长度为a,b,c的缎带,且缎带数量尽可能多。

输入格式

输入仅一行,四个正整数n,a,b,c(n,a,b,c≤4000)。

输出格式

输出仅一行,即缎带数量的最大值。

说明/提示

In the first example Polycarpus can cut the ribbon in such way: the first piece has length 2, the second piece has length 3. In the second example Polycarpus can cut the ribbon in such way: the first piece has length 5, the second piece has length 2.