Apple sharing python programming : N students take K apples and distribute them among each other evenly. The remaining (the undivisible) part remains in the basket. How many apples will each single student get? How many apples will remain in the basket?
CODING QUESTION
N students take K apples and distribute them among each other evenly. The remaining (the undivisible) part remains in the basket. How many apples will each single student get? How many apples will remain in the basket?
Note : The program reads the numbers N and K. It should print the two answers for the questions above.
SOLUTION
no_students = int(input())
no_apple = int(input())
print( no_apple // no_students )
print( no_apple % no_students )
Input:
6
50
Output
8
2