If minimum candies of three bags are less than number of operations required then the task is not possible
int m = min ( a , min ( b , c ) ) ; if ( m < ( ( a + b + c ) / 4 ) ) return false ; } return true ; }