# bzoj2729

1.两个老师站在同一处，即两个男生之间站了两个老师

2.两个老师已经被男生隔开了

 1 var a,b:array[0..30010] of longint;
2     i,la,lb,n,m:longint;
3
4 procedure mul(y:longint);
5   var i,j,x,t:longint;
6   begin
7     t:=0;
8     for i:=1 to la do
9     begin
10       x:=a[i]*y+t;
11       a[i]:=x mod 10;
12       t:=x div 10;
13     end;
14     while t>0 do
15     begin
16       inc(la);
17       a[la]:=t mod 10;
18       t:=t div 10;
19     end;
20   end;
21
23   var i,x,t:longint;
24   begin
25     if lb>la then la:=lb;
26     t:=0;
27     for i:=1 to la do
28     begin
29       x:=a[i]+b[i]+t;
30       a[i]:=x mod 10;
31       t:=x div 10;
32     end;
33     while t<>0 do
34     begin
35       inc(la);
36       a[la]:=t mod 10;
37       t:=t div 10;
38     end;
39   end;
40
41 begin
43   la:=1;
44   a[1]:=1;
45   for i:=1 to m do
46     mul(n+4-i);
47   mul(n+1);
48   mul(n);
49   lb:=la;
50   b:=a;
51   la:=1;
52   fillchar(a,sizeof(a),0);
53   a[1]:=2;
54   mul(n+1);
55   mul(m);
56   for i:=1 to m-1 do
57     mul(n+3-i);
66