Equal Numbers
Time limit3sMemory limit512 MB
For each k from 0 to n, find the fewest distinct values possible after multiplying k list elements by positive integers.
- Level
Medium7 of 10
- Topics
- Number theory, Greedy, Sorting, Math
- Solved
- No attempts yet
Problem
You are given a list of integers . In one operation you choose one element of the list and multiply it by any positive integer. The multiplier can be .
For every with , compute the minimum number of different integers the list can contain after operations.
Input
The first line contains one integer ().
The second line contains integers (), separated by spaces.
Output
Print integers on one line, separated by spaces. The -th integer is the minimum number of different integers the list can contain after operations.