-
-
Save ArthurLoboLobo/9884a36c79ce6a35fe8dd8fc56eaed8c 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 d,g; | |
cin >> d >> g; | |
int ans = 0; | |
for(int x = -100; x <= 100; x++) { | |
int dl = d+x; | |
int gl = g-4*x; | |
ans = max(ans,min(dl/6,gl)); | |
} | |
cout << ans << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment