import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.Comparator; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) { new Main().run(); } final long MOD=(long)1e8+7; int MAX=(int)3e5+1; long[] fac=new long[MAX]; long[] inv=new long[MAX]; long[] ifac=new long[MAX]; { fac[0]=fac[1]=ifac[0]=ifac[1]=inv[0]=inv[1]=1; for (int i=2;i>i)%2==0) continue; if (prey>P[ord[i]][0]||prex>P[ord[i]][1]) return 0; int dy=P[ord[i]][0]-prey; int dx=P[ord[i]][1]-prex; ans*=binom(dy+dx,dy); ans%=MOD; prey=P[ord[i]][0]; prex=P[ord[i]][1]; } return ans; } void run() { FastScanner sc=new FastScanner(); int H=sc.nextInt(); int W=sc.nextInt(); int K=sc.nextInt(); int[][] P=new int[K+1][3]; int[] ord=new int[K+1]; for (int i=0;i<=K;++i) ord[i]=i; for (int i=0;ia[0]).thenComparing(a->a[1])); for (int i=0;i=0;--s) { if ((s>>i)%2==1) continue; dist[s|1< Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next());} }