Bill Division another beginner problem available in hackerrank this is how i solved it using python, Share with me if you got any better way of solving this in python

Problem Description

Two friends Anna and Brian, are deciding how to split the bill at a dinner. Each will only pay for the items they consume. Brian gets the check and calculates Anna's portion. You must determine if his calculation is correct.

For more details about the problem visit Bill Division

Sample Input

4 1
3 10 2 9

Sample Output


I hope solution to Bill Division using python may help you.