CF174A.Problem About Equation

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A group of nn merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the nn mugs must be the same.

Polycarpus has already began the process and he partially emptied the Ber-Cola bottle. Now the first mug has a1a_{1} milliliters of the drink, the second one has a2a_{2} milliliters and so on. The bottle has bb milliliters left and Polycarpus plans to pour them into the mugs so that the main equation was fulfilled.

Write a program that would determine what volume of the drink Polycarpus needs to add into each mug to ensure that the following two conditions were fulfilled simultaneously:

  • there were bb milliliters poured in total. That is, the bottle need to be emptied;
  • after the process is over, the volumes of the drink in the mugs should be equal.

输入格式

The first line contains a pair of integers nn , bb ( 2<=n<=100,1<=b<=1002<=n<=100,1<=b<=100 ), where nn is the total number of friends in the group and bb is the current volume of drink in the bottle. The second line contains a sequence of integers a1,a2,...,ana_{1},a_{2},...,a_{n} ( 0<=ai<=1000<=a_{i}<=100 ), where aia_{i} is the current volume of drink in the ii -th mug.

输出格式

Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print nn float numbers c1,c2,...,cnc_{1},c_{2},...,c_{n} , where cic_{i} is the volume of the drink to add in the ii -th mug. Print the numbers with no less than 6 digits after the decimal point, print each cic_{i} on a single line. Polycarpus proved that if a solution exists then it is unique.

Russian locale is installed by default on the testing computer. Make sure that your solution use the point to separate the integer part of a real number from the decimal, not a comma.

输入输出样例

  • 输入#1

    5 50
    1 2 3 4 5
    

    输出#1

    12.000000
    11.000000
    10.000000
    9.000000
    8.000000
    
  • 输入#2

    2 2
    1 100
    

    输出#2

    -1
    
首页