-
-
Save enzerr/b42db10f5b96a00dc7e27323a588b98b to your computer and use it in GitHub Desktop.
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
#include<bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int s; cin >> s; | |
int aux[3]; cin >> aux[0] >> aux[1] >> aux[2]; | |
sort(aux, aux+3); | |
int ans = 0; | |
if(s>=aux[0]) ans=1; | |
if(s>=aux[0]+aux[1]) ans=2; | |
if(s>=aux[0]+aux[1]+aux[2]) ans=3; | |
cout << ans << '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment