Function to check if it is possible to distribute R red and B blue beans in packets such that the difference between the beans in each packet is atmost D
void checkDistribution ( int R , int B , int D ) {