Created
October 12, 2015 12:12
-
-
Save jo32/0509bff5ada8db52bb37 to your computer and use it in GitHub Desktop.
CODEFORCE 189A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[n, a, b, c] = [int(i) for i in raw_input().split(' ')] | |
dp = [0] * (n + 1) | |
dp[0] = 0 | |
for i in range(1, n + 1): | |
dp[i] = max( | |
dp[i - a] if i - a >= 0 else -4001, | |
dp[i - b] if i - b >= 0 else -4001, | |
dp[i - c] if i - c >= 0 else -4001 | |
) + 1 | |
print dp[n] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment