Problem F
Uppröðun
Languages
en
is
One thing the planning committee has to do is decide what team should sit in what classroom. There are $N$ classrooms and $M$ contestants. The classrooms are roughly the same size, so it is best if the teams are assigned to the rooms in as equal numbers as possible. For example if there are $N = 3$ classrooms and $M = 8$ contestants it’s best to put $3$ contestants in one room, $3$ in another and $2$ in the last one.
Input
The input consists of two lines. On the first line is the integer $N$ and on the second is the integer $M$.
Output
The output should consist of $N$ lines, one for each classroom. If there should be $k$ contestants in classroom $i$, then line number $i$ should contain $k$ instances of the symbol *.
Explanation of Sample Inputs
In the first sample there is $N = 1$ classroom and $M = 5$ contestants. As there is only one classroom, all contestants must be there.
The second sample is the same as the one explained above.
The third sample has $N = 5$ classroomes, but has $M = 33$ contestants. In this case it is best to put $6$ contestants into two of the classrooms, but $7$ into the other three. We can see that the order does not matter.
Scoring
The solution will be tested on differently hard input data and the data is divided into groups as shown in the table below. The solution will then be scored according to how many groups are solved.
Group |
Points |
Constraints |
1 |
20 |
$N = 1$, $M \leq 500$ |
2 |
20 |
$N = 2$, $M \leq 500$ |
3 |
30 |
$N \leq 10$, $M \leq 500$, there will be equally many contestants in every classroom |
4 |
30 |
$N \leq 10$, $M \leq 500$ |
Sample Input 1 | Sample Output 1 |
---|---|
1 5 |
***** |
Sample Input 2 | Sample Output 2 |
---|---|
3 8 |
*** *** ** |
Sample Input 3 | Sample Output 3 |
---|---|
5 33 |
******* ******* ****** ******* ****** |
Sample Input 4 | Sample Output 4 |
---|---|
4 8 |
** ** ** ** |