## Angles

Time Limit: 2 sec
Memory Limit: 256 MB
Attempts: 150
Accuracy: 6.67%
Author: savish bedi

You are given an angle **θ**.

You to find number of occurrences of angle **(A**_{i},A_{j},A_{k}) = θ (treat A_{i}, A_{j}, A_{k} to be similar to A_{k}, A_{j}, A_{i}) in a regular **n**-gon (regular polygon with **n** vertices) with vertices marked as **A**_{1},A_{2},.....A_{n}.

Input Format:

The first line of the input contains a single integer **T** denoting the number of test cases.

Each of the next **T** lines contains two integers **n** and **θ**.

Output Format:

Print one integer — the number of occurence of angle **θ**.

Constraints:

1 ≤ **T** ≤ 10000

3 ≤ **n** ≤ 10^{4}

1 ≤ **θ** ≤ 180

Sample Input:

3

4 90

6 50

6 60

Sample Output:

4

0

18

ID

SUBMITTED AT

STATUS

LANGUAGE

TIME

MEMORY USED

USER

TIME

STATUS

LANGUAGE

TIME

MEMORY USED