Patterns
Petro is inspired by the Ulam spiral, which highlights the mysterious patterns of prime numbers, and decides to create his own version.
He uses a square grid with a size of n x n, where n is the number of his choice. The grid is filled with integers from 1 to n^2. The top row contains the numbers from 1 to n, and the sequence continues with each subsequent row.
Petro is interested in the number of divisors each number has. Specifically, he focuses on numbers that have a certain number of divisors, which is at most k. He highlights these numbers by coloring them.
For example, if n = 7 and k = 3, the grid looks like this:
Help Petro by creating this grid. Represent the highlighted cells with an asterisk «*» and the unhighlighted ones with a dot «.».
Input
The input consists of two integers, n and k, where 1 ≤ n ≤ 40 and 1 ≤ k ≤ n^2.
Output
Print n rows, each containing n characters. Each character represents a cell in the grid. Use «*» for the highlighted cells and «.» for the unhighlighted ones.