Mr. Russo is in his 60s and he loves traveling. He recently visited a country
famous for its pens. He wants to gift a few pens as souvenirs to his
grandchildren. Mr. Russo has N grandchildren so he visited a pen shop to
purchase pens for them. The shopkeeper showed him A varieties (types) of
pens, each variety (type) consisting of B number of pens.
He has to select only C varieties (types) of pens in a set in such a way that
when he distributes these pens among his grandchildren, each of them get
the same number of pens. If there are more than one such sets or
combinations possible, then the set contributing to minimum number of per
per grandchild should be selected and the number of pens that every
grandchild gets should be retumed.
Your task is to help Mr. Russo in finding the minimum number of pens eac
grandchild can get
Wote: If no solution is possible, return -1 as your output
put Specification:
innt. An intonar valve A donntinn the variety of none that the chan
metil
Pruthvi | Sup
Answers
Answered by
0
Answer:
So he can do this thingss. We Can be able to give any.
Explanation:
yes
Answered by
0
Input and output of the following question
Programs bear data to be input. This data is used( reused) by the program, and data( or information) is affair as a result.
Data input
Programs are written to break problems. To break a problem, a program needs data input and data, or information, affair.
Data can be input in different ways
- Written directly into the program. This is called hard coding.
- By the stoner when the program is running.
- From a train or other source when the program is running.
Inputs
input 1: Value of ‘ X ’
input 2: Value of ‘ c ’
input 3 : Value of ‘ a ’
input 4 : Values in the array ‘ b ’
Output:
Return the minimal number of pens each grandchild should get. Return-1 if no result possible
illustration
Inputs
input 1 :5
input 2: 3
input 3 :5
input 4:{1,2,3,4,5}
#SPJ2
Similar questions