Skip to content

Instantly share code, notes, and snippets.

@enzerr
Created June 14, 2023 12:48
Show Gist options
  • Save enzerr/36f0ba5c0c4e30e1f156842cea8ae358 to your computer and use it in GitHub Desktop.
Save enzerr/36f0ba5c0c4e30e1f156842cea8ae358 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
int main() {
int v, a, b, c; scanf("%d %d %d %d", &v, &a, &b, &c);
int resp = 0;
if(v >= a || v >= b || v >= c) resp = 1;
if(v >= (a + b) || v >= (a + c) || v >= (b + c)) resp = 2;
if(v >= (a + b + c)) resp = 3;
printf("%d\n", resp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment