PR003001 - Anubis wants to know how many

no tags 

Anubis is always playing with numbers. Recently he wanted to know how many numbers there are in the range [1, N] that are even and multiples of p. What about helping him? Write a program that automates this task.

Input

The first line of input contains T (1 <= T <= 100), the number of test cases. T lines follow. Each test case is fully contained in a single line. A test case is represented by two space-separated integers N (1 <= N <= 1024) and p (1 <= p <= N). 

Output

For each test case, output its answer in a single line. 

Example

Input:
1
10 5

Output:
1


Added by:kojak_
Date:2013-11-25
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:PUCMM Round #003 (Div. 2)