| Winter Cup 6.0 Online Mirror Contest |
|---|
| Finished |
Iceberg Corporation has made many breakthroughs in many areas, such as cryptography and artificial intelligence, where they were able to register many patents.
One of them is a powerful automated personnel identification system that does not suffer from any practical security exploits. It was carefully designed by its prominent engineers: Yessine, Rami, and Oussama. This system identifies each person with his unique disk.
In fact, each disk is composed of $$$n$$$ sectors, where the $$$i^\text{th}$$$ sector is divided into $$$A_i$$$ isometric chunks. Each chunk has its own color from a list of $$$K$$$ available colors.
To have login access, each person will insert his disk into a disk scanner that identifies the person and gives or denies him access. The scanner is smart enough to detect a flipped disk and correctly realign any sector by rotating it.
The security of this system relies heavily on the number of different configurations of disks. Calculate the number of different disk configurations. As the number can be very big, you only have to calculate it modulo $$$M=998244353.$$$
Two configurations are equivalent if you can get one from the other by rotating each sector by any angle and flipping the whole disk around any axis any number of times.
One integer $$$R,$$$ equal to the number of distinct colorings modulo $$$M=998244353$$$
4 33 4 2 1
3834
2 24 2
18
The first test case corresponds to a system designed as follows:
For the second test case, we can enumerate all distinct disks as follows:
| Name |
|---|


