Lost in Dristor 2 (dristor2)

31 teams scored 1435 points on this task, for a maximum score of 70, an average score of 46 and a median score of 35.

Highlights

  1. Volta, Milano is the institute with the most points (140).
  2. Lombardia is the region with the most points (385).

Statement

This is the legend of the old, long-lost package in Dristor 2. A long time ago, AAP, MH, MFast and the other package hunters were asked to find a lost package in the Dristor 2 station. There are N package hunters and M secret locations in the Dristor 2 station, each package hunters know how to reach some secret locations. Since none of them know the station well enough, they decided to split up to increase their chances of finding the package. In a search, every package hunter check at most one secret location known. Every hunter must check a different secret location and the number of secret locations checked must be the maximum possible. Count the number of different searches the group can try in order to find the lost package. Since this number can be very large, you should print the remainder of the division by 10^9 + 7. Two searches are considered different if at least one package hunter checks a different location.