#include #include using namespace std; #define loop(i,a,b) for(int i=(a);i> a >> b >> c >> d; int ans = inf; for(int i=1;i<=30;i++){ loop(j,1,i){ loop(k,1,j){ ans = min(ans,solve(i,j,k,a,b,c,d)); } } } cout << ans << endl; }