4074 - Counting Integers

Created by Reynaldo Gil Pons
Added by ymondelo20 (2018-09-05)
Limits
Total Time: 20000 MS | Test Time: 2500 MS |Memory: 512 MB | Output: 64 MB | Size: 16 KB
Enabled languages
Available in

Description

Given a sequence of integers a1, a2, ..., an, find how many of the first m positive integers can be expressed in the form
where x is a real number.
Dada una secuencia de enteros a1, a2, ..., an, calcula cuántos de los primeros m enteros positivos se pueden expresar en la forma
donde x es un número real.
Given a sequence of integers a1, a2, ..., an, find how many of the first m positive integers can be expressed in the form
where x is a real number.

Input specification

The first line of input contains the number of test cases T (T 100). For each test case there will be two lines. In the first line there is n and m (1 n 105, 0 m 109). The second line consists of n integer numbers a1, a2, ..., an, where 1 ai 104 for each i.
La primera línea de la entrada contiene el número de casos de prueba T (T 100). Para cada caso hay dos líneas. En la primera línea están n and m (1 n 105, 0 m 109). La segunda línea consiste de n números enteros a1, a2, ..., an, donde 1 ai 104 para cada i.
The first line of input contains the number of test cases T (T 100). For each test case there will be two lines. In the first line there is n and m (1 n 105, 0 m 109). The second line consists of n integer numbers a1, a2, ..., an, where 1 ai 104 for each i.

Output specification

For each one of the test cases, print a line containing the number of integers that satisfy the above description.
Para cada caso de prueba, imprima una línea con el número de enteros que satisface la descripción anterior.
The first line of input contains the number of test cases T (T 100). For each test case there will be two lines. In the first line there is n and m (1 n 105, 0 m 109). The second line consists of n integer numbers a1, a2, ..., an, where 1 ai 104 for each i.

Sample input

2
4 1000
2 4 6 8
3 8
8 5 2

Sample output

600
7

Hint(s)

If a test file contains a test case with n > 100, then that will be the only case in that file (T = 1).
Si un caso de prueba contiene un valor n > 100, entonces este será el único caso (T = 1).
If a test file contains a test case with n > 100, then that will be the only case in that file (T = 1).