DSA problems in java

Joined
Aug 15, 2022
Messages
3
Reaction score
0
There is a charity which has N people. Penny wants to donate some of her clothes to the charity in such a way that all people receive equal clothes and each individual receives more than 1. If she has M clothes with her what is the maximum number of clothes one individual can get?
 
Joined
Mar 28, 2022
Messages
82
Reaction score
11
clothing % people, where clothing ≥ 2 × people
for example, 27 clothing % 12 people = 3 clothing/person
 
Last edited:
Joined
Mar 28, 2022
Messages
82
Reaction score
11
Correction: That should be integer division, "\" not the remainder after integer division (modulo) "%"
27 clothing \ 12 people = 2 clothing/person, with 27 % 12 = 3 clothing left over
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top