Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pocket money Problem Statement: Adam is having three kids Brian, Martin, and Peter. It's christmas and the kids are expecting pocket money from their father.
Pocket money
Problem Statement:
Adam is having three kids Brian, Martin, and Peter. It's christmas and the kids are expecting pocket money from their father. All the kids want the same amount and if it is less or more for anyone then they don't want it Now the problem is Adam is having number pf Dollar Notes with different values. He wants to distribute those notes in such a way that everyone gets an equal amount.
Now you have to find out, what is the amount he has distributed amongst the kids?
Input Format:
First line: A positive integer which represents the number of notes
Second line: Values of N notes separated by a space.Now you have to find out, what is the amount he has distributed amongst the kids?
Input Format:
First line: A positive integer N which represents the number of notes
Second line: Values of notes separated by a space.
Example
Output Format:
First Line: Print "YES" if the amount can be distributed equally else print NO
Second Line: If "YES" print the number of notes that each child gets in ascending order separated by space.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started