作业帮 > 英语 > 作业

英语翻译A number of students are members of a club that travels

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:英语作业 时间:2024/06/25 00:55:31
英语翻译
A number of students are members of a club that travels annually to exotic locations.
The group agrees in advance to share expenses equally,but it is not practical to have them share every expense as it occurs.So individuals in the group pay for particular things,like meals,hotels,taxi rides,plane tickets,etc.After the trip,each student's expenses are tallied and money is exchanged so that the net cost to each is the same,to within one cent.In the past,this money exchange has been tedious and time consuming.Your job is to compute,from a list of expenses,the minimum amount of money that must change hands in order to equalize (within a cent) all the students' costs.
The Input
Standard input will contain the information for several trips.The information for each trip consists of a line containing a positive integer,N,the number of students on the trip,followed by N lines of input,each containing the amount,in dollars and cents,spent by a student.There are no more than 1000 students and no student spent more than $10,000.00.A single line containing 0 follows the information for the last trip.
The Output
For each trip,output a line stating the total amount of money,in dollars and cents,that must be exchanged to equalize the students' costs.
英语翻译A number of students are members of a club that travels
一家每年都要举行异国旅游的旅行社,其成员中有很多是学生!
团队事先约定,总花销将被平均分摊到每位成员,但是成员可不必分摊每一次的消费!所以团队中的每个成员均为自己特定的消费,如吃饭、住宿、乘坐出租车、飞机票等付款!旅游结束后,每位成员的花费和余款均被记录下来(精确到分),这样每位学员的净花销是一致的!先前货币兑换繁琐并且费时,你需要从费用列表中计算出最小数额来调平 (精确到分)所有学生的费用.
输入:
输入将包含若干组旅行的数据.每一组数据的第一行为一个正整数N,代表这次旅行中学生人数.接下来的N行每一行包含了一个学生的支出,精确到美分.学生人数不超过1000,并且每个学生的支出不超过$100000.在最后一组数据结尾还有单独的一行,包含一个0.
输入:
对于每一组数据,只输出一行,即让每个学生平摊支出所需的最小总“交易”金额,精确到分.