Distribute the white and black objects into maximum groups under certain constraints | Function to check if it is possible to distribute W and B into maximum groups possible ; If W is greater than B , swap them ; Distribution is not possible ; Distribution is possible ; Input ; Function call
function isPossible ( W , B , D ) { if ( W > B ) { let temp = W ; W = B ; B = temp ; } if ( B > W * ( D + 1 ) ) document . write ( " " ) ; else document . write ( " " ) ; } let W = 2 ; let B = 5 ; let D = 2 ; isPossible ( W , B , D ) ;