Description

Thanks to little bailey. Now bailey also has some table tennis balls. But his boxes may be not enough to hold them all. So he decides to put the maximum balls into his boxes in order. That means you can't put ball u into box p, ball v into box q when u > v and p< q. You may notice that, The balls can be put into a single box,as long as the total volume of them is no bigger than the volume of the box . Bailey is not good at programming, so he asks you for help.

Input

The first line is an integer c which shows the number of cases. For each case there are 2 lines of positive integer as following: n m V v1 v2 v3 ... vn n is the number of ball, m is the number of box, V is the volume of each box, and vi is the volume of ball i (i=1,2,...,n).(1<=n,m,V<=500, 1<=vi<=V)

Output

For each case print the maximum number of balls bailey can save.

Sample Input

3 2 1 3 3 2 4 2 4 1 4 3 2 5 2 4 1 4 4 1 2

Sample Output

1 3 3

Source

HIT