Subspace
Time limit1sMemory limit512 MB
Count the k-dimensional subspaces of the n-dimensional vector space over F_q, printing the answer modulo a prime p.
- Level
Medium7 of 10
- Topics
- Combinatorics, Number theory, Math
- Solved
- No attempts yet
Problem
bobo is a big fan of linear algebra! He plans to count the number of -dimension subspaces in modulo .
For those who are not familiar with linear algebra:
- is the set , with addition and multiplication modulo defined on;
- is the -dimension vector space ;
- A subset is a subspace, if and only if for all , ;
- The dimension of subspace is the cardinality of the maximal independent subset;
- A subset is called independent if and only if the equation has only the solution .
Input
Four integers are given (, , ). It is guaranteed that and are prime numbers.
Output
Print a single integer, the number of subspaces.