|All-time Popular Problems|
|Find duplicates in an array|
|Triplet Sum in Array|
|Sorting Elements of an Array by Frequency|
|Search an Element in an array|
|Diameter of Binary Tree|
|Maximum of all subarrays of size k|
|Leaders in an array|
|Find median in a stream|
|Reverse a Linked List in groups of given size.|
Given a number N, find the total numbers, less than or equal to N which have at-least one common factor with N other than 1.
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case consist of an integer N.
For each test case output an integer denoting the count of numbers, less than or equal to N having at-least one common factor between the number and N except 1.
For N=1, there are no numbers satisfying the condition.
For N=6, the 4 numbers having a common factor between them and 6 are : 2, 3, 4 & 6
For N=15, the 7 numbers having a common factor between them and 15 are : 3, 5, 6, 9, 10, 12, 15