Thanks_up有一条长为n的爱情线,但是ACM不需要爱情,所以他决定把它剪掉,但是Thanks_up有强迫症,
Thanks_up设置了两个规定,1、必须将爱情线剪成长度a,b,c长度的,2、剪完后线必须最多
Thanks_up剪完爱情线后,痛哭流涕不想算,所以他请你们算一下,剪完后爱情线的数量是多少
Thanks_up说了如果你们不能在1s内回答出来,他也把你们的爱情线剪掉
The first line contains four space-separated integers n, a, b and c (1 ≤ n, a, b, c ≤ 4000) — the length of the original ribbon and the acceptable lengths of the ribbon pieces after the cutting, correspondingly. The numbers a, b and c can coincide.
第一行包含四个空格分隔的整数n,a,b和c(1≤n,a,b,c≤4000) - 相应地,Thanks_up爱情线的长度和剪后爱情线碎片的可接受长度。 数字a,b和c可以重合。
Print a single number — the maximum possible number of ribbon pieces. It is guaranteed that at least one correct ribbon cutting exists.
打印一个数字 - 爱情线可能的最大条数。 保证至少存在一个正确的爱情线切割。
5 5 3 2
2
7 5 5 2
2
NoteIn 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.