GCD-Based Cache Key Distribution
You have n cache keys (numbered 1 to n) and k servers (numbered 1 to k). Each key must be assigned to exactly one server based on the greatest common divisor (GCD).
For each key i, assign it to server j where gcd(i, j) is maximum. If multiple servers have the same maximum GCD with key i, choose the server with the smallest ID.
Input
The first line contains two integers n and k (1 ≤ n ≤ 10^5, 1 ≤ k ≤ 10^5).
Output
Print n integers, where the i-th integer is the server ID (1-indexed) to which key i is assigned.
Constraints
- 1 ≤ n, k ≤ 10^5