"The fish who dried the sea went onto land before they did this. They move from one dark forest to another dark forest."
You are now in a
KKK-dimensional universe, which could be seen as an
n1×n2×...×nKn_1\times n_2 \times ... \times n_Kn1×n2×...×nK hyperrectangle. To be specific, let's divide the universe into
n1×n2×...×nKn_1\times n_2 \times ... \times n_Kn1×n2×...×nK hypercubes sized
1×1×...×11 \times 1 \times ... \times 11×1×...×1 to describe different regions. The position of each region can be denoted by a
KKK-dimensional integer coordinate
(a1,a2,...,aK)(a_1, a_2, ..., a_K)(a1,a2,...,aK) where
0≤ai<ni0 \le a_i < n_i0≤ai<ni. Each region owns a
Dimensional Value\textit{Dimensional Value}Dimensional Value and the initial value is
KKK. However, due to the space war and the abuse of dimensionality weapons, the
Dimensional Values\textit{Dimensional Values}Dimensional Values of some regions in the universe has decayed to less than
KKK.
Your spaceship is an
m1×m2×...×mKm_1\times m_2 \times ... \times m_Km1×m2×...×mK hyperrectangle which can also be viewed as
m1×m2×...×mKm_1\times m_2 \times ... \times m_Km1×m2×...×mK parts of hypercubes sized
1×1×...×11\times 1\times ...\times 11×1×...×1. The position of each part can also be denoted by a
KKK-dimensional integer coordinate
(b1,b2,...,bK)(b_1, b_2, ..., b_K)(b1,b2,...,bK) where
0≤bi<mi0 \le b_i < m_i0≤bi<mi. Each part of your spaceship also owns a
Dimensional Value\textit{Dimensional Value}Dimensional Value which is initially
KKK. Thanks to advanced technology, some parts of your spaceship are reformed and their
Dimensional Values\textit{Dimensional Values}Dimensional Values become less than
KKK, which can make them enter the regions with lower
Dimensional Values\textit{Dimensional Values}Dimensional Values.
We define the spaceship to be in a valid position if the following conditions are met:
-
Each part of the spaceship is located exactly in one region.
-
Each part of the spaceship cannot have a Dimensional Value\textit{Dimensional Value}Dimensional Value strictly higher than the Dimensional Value\textit{Dimensional Value}Dimensional Value of the region.
Please calculate the number of different valid positions for your spaceship. Please note that you can't rotate the spaceship.