作业帮 > 英语 > 作业

英语翻译A group of NP (2 ≤ NP ≤ 10) uniquely named friends has d

来源:学生作业帮 编辑:拍题作业网作业帮 分类:英语作业 时间:2024/04/20 14:22:13
英语翻译
A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money.Each of these friends might or might not give some money to any or all of the other friends.Likewise,each friend might or might not receive money from any or all of the other friends.Your goal in this problem is to deduce how much more money each person gives than they receive.
The rules for gift-giving are potentially different than you might expect.Each person sets aside a certain amount of money to give and divides this money evenly among all those to whom he or she is giving a gift.No fractional money is available,so dividing 3 among 2 friends would be 1 each for the friends with 1 left over -- that 1 left over stays in the giver's "account".
In any group of friends,some people are more giving than others (or at least may have more acquaintances) and some people have more money than others.
Given a group of friends,no one of whom has a name longer than 14 characters,the money each person in the group spends on gifts,and a (sub)list of friends to whom each person gives gifts,determine how much more (or less) each person in the group gives than they receive.
一群姓名独特的朋友(2 ≤ 人数 ≤ 10)决定交换钱作为礼物.每个人可以给或者不给别人钱,也可以只给一个或者都给.也就是说,每个人有可能从任何一个人那里收到钱,也可能收不到钱.你要计算出每个人给出的钱比得到的钱多多少.
赠送礼物的规则可能和你预想的不同.每个人拿出一部分钱用来送给别人,并且把这部分钱平均分给他想要赠送的人.因为钱不能分成分数,所以当两个人分3块钱的时候,只能一人一块,然后剩余一块.这剩余的一块依然算进了这个人“当作礼物给出去”的部分.
在一组朋友中,有的人比别人给出的钱要多(或者认识的人多),有的人比别人拥有的钱多.
给你一组人,他们的名字都不长于14个汉字,每人当作礼物送出的钱,和他送给多少人钱,决定了组中每个人比别人给出或收到的钱多多少,或者少多少.