Ramesh is working in an engineering college hostel as a Mess supervisor. There are different messes are available based on the years. Every day students count is varying in all the hostels due to continuous holidays.
Since ramesh is in charge of the cooking team. He had trouble with calculating the quantity of food that needs to be prepared because of the varying student count.
Even if a small quantity of food is prepared by the cooking team, it should be divided equally among the number of Mess.Ramesh needs an automated software to identify the amount of food available (in number of packets ) and Mess count.
Can you help him to divide the food equally and also calculating the remaining quantity of food that will be available after sharing the food equally ?
Input:
Only line of input has two integer representing the available number of food packets and the available number of messes.
Output:
In the only line of output print two values separated by a space representing the number of food packets are shared and the remaining number of food packets available.
#include <stdio.h> int main() { int alvqntoffood,messcnt,dividedqnt,remfood; scanf("%d",&alvqntoffood); scanf("%d",&messcnt); dividedqnt=alvqntoffood/messcnt; remfood=alvqntoffood%messcnt; printf("%d",dividedqnt); printf(" "); printf("%d",remfood); return 0; }
Input_1:
25575 5
Output:
5115 0
Input_2:
7567 11
Output:
687 10
Input_3:
6550 3
Output:
2183 1
Input_4:
7000 10
Output:
700 0
Input_5:
1000 7
Output:
142 6
Morae Q!
- Convert seconds to hours – HMS format.
- Find out the tax amount of the bill with tip for the meal.
- Find the area of the pyramid.
- Find the area of triangle using heron’s formula.
- Find the interest and amount resided in the bank.
- Convert the travel days to years and months.
- Find the first three powers of N number.
- Compute the height from feet and inches to centimetres.
- Calculate the amount of interest earned in the bank.
- Find the ways they can choose the sequence of dummy statues.
- Find the Lapindrome strings.
- Classify the salary of a person.
- Find the day on providing the week number.
- Find the least number of marble stones needed to pave the square mall.
- Find the number of steps on chessboard performed to satisfy a condition.
- Find the time, hours and minutes the train was delayed.
- Find the quantity of food packets shared and available.
- Compute all Arithmetic Operations.
- Find the amount to pay for the electricity bill.
- Find the sum of numbers with three values after decimal point.