F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Boolean 3-Array

Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 31    Accepted Submission(s): 14


Problem Description
In this problem, we are going to deal with a special structure called Boolean 3-array.

A $\textit{Boolean 3-array}$ of size $m \times n \times p$ is a three-dimensional array denoted as $A$, where $A[i][j][k] \in \{0, 1\}$ $(1 \leq i \leq m, 1 \leq j \leq n, 1 \leq k \leq p)$. We define any one of these as an $\textit{operation}$ on a Boolean 3-array $A$ of size $m \times n \times p$:

- Choose some fixed $a$ $(1 \leq a \leq m)$, then flip $A[a][j][k]$ for all $1 \leq j \leq n$, $1 \leq k \leq p$;
- Choose some fixed $b$ $(1 \leq b \leq n)$, then flip $A[i][b][k]$ for all $1 \leq i \leq m$, $1 \leq k \leq p$;
- Choose some fixed $c$ $(1 \leq c \leq p)$, then flip $A[i][j][c]$ for all $1 \leq i \leq m$, $1 \leq j \leq n$;
- Choose some fixed $a_1, a_2$ $(1 \leq a_1, a_2 \leq m)$, then swap $A[a_1][j][k]$ and $A[a_2][j][k]$ for all $1 \leq j \leq n$, $1 \leq k \leq p$;
- Choose some fixed $b_1, b_2$ $(1 \leq b_1, b_2 \leq n)$, then swap $A[i][b_1][k]$ and $A[i][b_2][k]$ for all $1 \leq i \leq m$, $1 \leq k \leq p$;
- Choose some fixed $c_1, c_2$ $(1 \leq c_1, c_2 \leq p)$, then swap $A[i][j][c_1]$ and $A[i][j][c_2]$ for all $1 \leq i \leq m$, $1 \leq j \leq n$.
Here "filp" means change the value of the element, i.e., replace 0 with 1 and replace 1 with 0.

We say two Boolean 3-arrays $A, B$ are $\textit{essentially identical}$, if and only if any one of them can be transformed to the other, by applying operations finitely many times; otherwise, we say $A$ and $B$ are $\textit{essentially different}$.

Now, given the size of the Boolean 3-array, can you determine the maximum number of Boolean 3-arrays of given size you may choose, such that any two of them are essentially different?
 

Input
The first line of input is a single integer $T$ $(1 \leq T \leq 300)$, the number of test cases.

Each test case is a single line of three integers $n, m, p$ $(1 \leq m, n, p \leq 13)$, the size of the Boolean 3-array.
 

Output
For each test case, display an integer in a single line: the answer modulo $998244353$.
 

Sample Input
3 1 1 1 2 2 2 2 3 4
 

Sample Output
1 9 723
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-25 12:50:22, Gzip enabled