Anuj has a mango farm. He sells the mangoes and earns money from them. He fills the mangoes in a basket. To make the calculation much simpler, he fills the basket either with an odd number of mangoes or with an even number of mangoes. If the number of mangoes is a combination of both an even and an odd number of mangoes, then he needs to rearrange the basket. Note: Number of baskets cannot exceed 10 and cannot be zero or less, If so print “Invalid number of baskets”. A negative number of mangoes cannot exit, if so print "Invalid Input". Sample Input 1: Number of baskets 5 Number of mangoes in each basket 2 4 6 8 10 Sample Output 1: Even Sample Input 2: Number of baskets 4 Number of mangoes in each basket 13 29 45 5 Sample Output 2: Odd Sample Input 3: Number of baskets 3 Number of mangoes in each basket 12 13 14 Sample Output 3: Rearrange the mangoes Sample Input 4: Number of baskets 0 Sample Output 4: Invalid number of baskets Sample Input 5: Number of baskets 2 Number of ma...
Comments
Post a Comment