Hello everyone, I thought of this problem after reading 875D - High Cry and I can't figure out a solution.
Let's call an integer y a subset of an integer x, if x | y == x
.
You have to answer q queries of two types:
- 1 x Add the integer x to the set S. (initially, the set S is empty)
- 2 x Of all the integers currently in S, how many is x a subset of?
1 ≤ x ≤ 109, 1 ≤ q ≤ 105.