HBB - EDITORIAL

PRACTICE

CONTEST

Author- Hiral Saini

Tester- Akanksha Bigasia

Editorialist- Hiral Saini

PROBLEM

In question BIRTHDAY BASH, our job was to find that weather the sugarcane ordered by the elephant for his birthday party can be divided among the people present at the party as a integral multiple of their ages or not.

To check this we have to find the sum of ages of all the guest came to the party (given as input) plus the age of the elephant and then the length of the sugarcane should be divided by the total age. If on division we get an integer then the output will be YES (as we get the integral multiple);otherwise NO.

EXAMPLE:

(i) for input:

4 10 2

2 2 3 1

HERE : No of guests=4

   Length of sugarcane=10

Age of elephant=2

 Age of guests are=2,2,3 and 1

Total age=2+2+2+3+1=10

Now, 10/10=1
which is an integer so output is YES. We can divide the sugarcane of 10 unit as 2 unit,2 unit, 3 unit, 1 unit among guests and the elephant will get 2 units.
similarly,

(ii) for input:

5 12 3

6 5 7 3

HERE : No of guests=4

        Length of sugarcane=12

        Age of elephant=3

        Age of guests are=6,5,7 and 3

       Total age 6+5+7+3+3=24

        Now, 12/24=0.5

which is not an integer so output is NO.

//