Problem8773--[CSES Problem Set] Bit Problem

8773: [CSES Problem Set] Bit Problem

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 512 MiB

Description

Given a list of $n$ integers, your task is to calculate for each element $x$:
  1. the number of elements y such that x∣y=x
  2. the number of elements y such that x&y=x
  3. the number of elements y such that x&y≠0

Input

The first input line has an integer $n$: the size of the list.
The next line has $n$ integers $x_1,x_2,…,x_n$: the elements of the list.

Output

Print $n$ lines: for each element the required values.

Constraints

$1≤n≤2⋅10^5$
$1≤x_i≤10^6$

Sample 1 Input

5
3 7 2 9 2

Sample 1 Output

3 2 5
4 1 5
2 4 4
1 1 3
2 4 4

HINT

相同题目:CSES 1654

Source/Category