|
||||||||||
PBDTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1609 Accepted Submission(s): 658 Problem Description PrisonBreak is a popular TV programme in HDU. ACboy likes it very much, and he join a PrisonBreak discussing team called "PBD".Every Tuesday night, a lot of PBDers will contact with each other to discuss the newest plot of PrisonBreak season2. Generally speaking, every PBDer has distinct ideas about the play, so everyone want to know all the others' ideas. For example, when ACboy contract with Sam, ACboy will tell all the ideas he konws to Sam, and Sam will also tell all the ideas he konws to ACboy, and the call costs 5 yuan. If there are N people in the "PBD" team, what is the minimum cost to let everyone knows all the others' ideas? Input The input contains multiple test cases. Each test case contains a number N, means there are N people in the "PBD" team.N = 0 ends the input.(A call cost 5 yuan). Output for each case, output a integer represent the minimum cost to let everyone knows all the others' ideas. Sample Input
Sample Output
Hint If there are 2 people, for example, named A, B. Then A calls B, then A and B will know each other's ideas, so it only needs one call, so the minimum cost is 1*5 = 5 yuan. Source | ||||||||||
|