var
f:array [0..1002,0..1002] of longint;
i,j,a,b,k,l,n,m,ans,s:longint;
function check(a,b,x,y:integer):boolean;
var
o:longint;
t,t1,t2:int64;
begin
t1:=f[x,y];
t2:=f[a,b];
t:=(t1*t2) mod 1000000007;
o:=f[n+1,m+1]-t;
if o<0 then o:=o+1000000007;
if o=k then exit(true) else exit(false);
end;
begin
read(n,m,k);
f[0,1]:=1;
for i:=1 to n+1 do
for j:=1 to m+1 do
f[i,j]:=(f[i-1,j]+f[i,j-1]) mod 1000000007;
ans:=0;
for i:=1 to n do
for j:=1 to m+1 do
if check(i,j,n+1-i,m-j+2) then inc(ans);
for i:=1 to n+1 do
for j:=1 to m do
if check(i,j,n-i+2,m-j+1) then inc(ans);
s:=(n+1)*m+(m+1)*n;
a:=s; b:=ans;
while b>0 do begin
l:=a mod b;
a:=b;
b:=l;
end;
if s=a then writeln(ans div a) else writeln((ans div a),'/',(s div a));
end.
rqnoj.zip_动态密码
版权申诉
22 浏览量
2022-09-23
13:36:09
上传
评论
收藏 536B ZIP 举报
JonSco
- 粉丝: 67
- 资源: 1万+
评论0