Answered step by step
Verified Expert Solution
Link Copied!

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 N 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 N 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 N notes separated by a space.
Example
10
2432497869
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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Google Analytics 4 The Data Driven Marketing Revolution

Authors: Galen Poll

2024th Edition

B0CRK92F5F, 979-8873956234

Students also viewed these Databases questions

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago