First to Solve
The famous Forcedeltas Programming Contest features contestants, problems, and lasts for minutes.
For each contestant and each problem , an integer is known. If , it means that contestant can not solve problem . Otherwise, it means that contestant can solve problem in exactly minutes.
All contestants will follow the same strategy. Specifically, each contestant will form a list of all problems they can solve, shuffle the list uniformly at random, and solve the problems in that order, until the list ends or the contest is over.
For example, if the list for contestant looks like after shuffling, then they will solve problem at minute , problem at minute , and so on. Note that no problem can be solved at minute or later.
We'll say that contestant gets the First to Solve award for problem if no other contestant solves problem strictly earlier. In particular, it means that multiple contestants can get the award for the same problem.
Find the expected number of awards each contestant will get, modulo (see the Output section for details).
Giriş verilənləri
The first line contains three integers , , and — the number of contestants, the number of problems, and the length of the contest in minutes (; ; ).
The -th of the following lines contains integers (). The -th of these integers denotes the number of minutes required for contestant to solve problem , or if contestant can not solve problem .
Çıxış verilənləri
Print integers — the expected number of awards contestants will get, modulo .
Formally, let . It can be shown that the expected number of awards can be expressed as an irreducible fraction , where and are integers and . Print the integer equal to . In other words, print such an integer that and .
Nümunələr
Qeyd
In the example test, contestant will always get the award for problem , contestant will always get the award for problem , the expected number of awards contestant will get is , contestant will never get any awards, and the expected number of awards contestant will get is .