Given a list of coins of distinct denominations and total amount of money. Output the minimum number of coins required to make up that amount. Output** -1** if that money cannot be made up using given coins.

You may assume that there are infinite numbers of coins of each type.

**Input:**

The first line contains 'T' denoting the number of testcases. Then follows description of testcases.

Each cases begins with the two space separated integers **'n' **and **'amount' **denoting the total number of distinct coins and total amount of money respectively.

The second line contains **n** space-separated integers A_{1}, A_{2}, ..., A_{n} denoting the values of coins.

**Output:**

For each testcase, in a new line, print the minimum number of coins required to make up that amount,** **print **-1 **if it is impossible to make that amount using given coins.

**Constraints:**

1<=T<=100

1<=n<=100

1<=A_{i}<=1000

1<=amount<=100000

**Example:**

**Input :**

2

3 11

1 2 5

2 7

2 6

**Output :**

3

-1

Shahbazuddin Zaidi | 109 |

SunkyuHwang | 108 |

bhatabhi554 | 104 |

sanu123 | 98 |

cass1 | 91 |

blackshadows | 872 |

SunkyuHwang | 612 |

codechaser | 561 |

Shaurya Khanna | 409 |

JojiJoseph | 396 |

akhayrutdinov | 5041 |

Ibrahim Nash | 4919 |

blackshadows | 4572 |

Quandray | 4346 |

sanjay05 | 3668 |

Login to report an issue on this page.