Prize Money Distribution
All submissions for this problem are available.Shubham participated in [Technovation2k18](http://technovation2k18.org). He won $N-1$ contests in a team with Surya and one individually. For $N-1$ he need to share prize money with Surya and he can keep $Kth$(0 based indexing) contest's prize for himself(does not need to share with Surya). Since Shubham is not good at maths, so he did not distributed the money correctly. Help him to distribute the money correctly. If prizes were fairly distributed print "fair", otherwise print the difference. ###Input: - The first line contains two space-separated integers denoting the respective values of $N$ (the number of contests won a team) and $K$ (the contest won by Surya only). - The second line contains $N$ space-separated integers where each integer $i$ denotes the prize money ,$p[i]$ , of contest $i$ (where $0 \leq i \leq N$). - The third line contains an integer, $S$ , denoting the amount of money that Surya gave to Shubham after Technovation2k18. ###Output: If prizes was fairly distributed paint "fair"(i.e. $S_shared - S_actual = 0$), otherwise print the difference($S_shared - S_actual$) ###Constraints - $2 \leq N \leq 10^5$ - $0 \leq K \le N$ - $0 \leq p[i] \leΣc[i]$ ###Sample Input: 4 1 3 10 2 9 12 ###Sample Output: 5
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.