K. Toxic Culinarity
time limit per test
4 seconds
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
3 2 4
1 2
2 3
1 3
1 2
Output
612368387
1071644675
153092098
1071644675