Get Minimum

1

1 votes
Basic Programming
Problem

You are given an array Arr of size N and two integers S and KArr is having a feature that its each element absolute value do not exceed K. You want to make the sum of all elements of Arr equals to S. To achieve this you can add any number of integers to Arr without violating its feature. Your task is to find minimum numbers of integers that you can add to Arr so that sum of all elements is S.

Input Format:
First line contains T, denoting the number of test cases.
First line of each test case contains 3 space separated integers denoting N, S and K.
Second line of each test case contains N space separed integers denoting the intial values of Arr

Output Format:
For each test case print a single integer denoting minimum numbers of integers that you can add to Arr so that sum of all elements is S in a new line.

Constraints:
1T103
1N,K105
KArray ElementsK
106S106

 

Note - Use Fast Input/Output Methods for Big Test Cases.

Sample Input
1
3 10 3
3 3 -1
Sample Output
2
Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

You can add two more elements 2 and 3 to the given Array to make the sum of all elements in Array 10

Editor Image

?