NoDemand:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and V<ref(V,1) and V<ref(V,2) and C>ref(C,+1) and H>=ref(H,+1),1,0);
NoSupply:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and V<ref(V,1) and V<ref(V,2) and C<ref(C,+1) and L<=ref(L,+1),1,0);
NoDemand2:=If(H>ref(H,1) and L>=ref(L,1) and (HL)>ref((HL),1) and C=O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2),1,0);
NoSupply2:=If(L<ref(L,1) and H<=ref(H,1) and (HL)>ref((HL),1) and C=O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2),1,0);
NoDemand3:=If(H>ref(H,1) and L>=ref(L,1) and (HL)>ref((HL),1) and C=H and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand2=0,1,0);
NoSupply3:=If(L<ref(L,1) and H<=ref(H,1) and (HL)>ref((HL),1) and C=L and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply2=0,1,0);
NoDemand4:=If(H>ref(H,1) and L>=ref(L,1) and (HL)>ref((HL),1) and C=((HL)*0.5)+L and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand2=0,1,0);
NoSupply4:=If(L<ref(L,1) and H<=ref(H,1) and (HL)>ref((HL),1) and C=((HL)*0.5)+L and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply2=0,1,0);
NoDemand5:=If(H>ref(H,1) and L>=ref(L,1) and (HL)>ref((HL),1) and C=L and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand2=0,1,0);
NoSupply5:=If(L<ref(L,1) and H<=ref(H,1) and (HL)>ref((HL),1) and C=H and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply2=0,1,0);
NoDemand6:=If(C>ref(C,1) and (HL)<ref((HL),1) and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply6:=If(C<ref(C,1) and (HL)<ref((HL),1) and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand7:=If(C>ref(C,1) and (HL)=ref((HL),1) and C=O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply7:=If(C<ref(C,1) and (HL)=ref((HL),1) and C=O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand8:=If(C>ref(C,1) and (HL)=ref((HL),1) and C=H and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply8:=If(C<ref(C,1) and (HL)=ref((HL),1) and C=L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand9:=If(C>ref(C,1) and (HL)=ref((HL),1) and C=((HL)*0.5)+L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply9:=If(C<ref(C,1) and (HL)=ref((HL),1) and C=((HL)*0.5)+L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand10:=If(C>ref(C,1) and (HL)=ref((HL),1) and C=L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply10:=If(C<ref(C,1) and (HL)=ref((HL),1) and C=H and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand11:=If(C=ref(C,1) and (HL)<ref((HL),1) and C=O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply11:=If(C=ref(C,1) and (HL)<ref((HL),1) and C=O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand12:=If(C=ref(C,1) and (HL)<ref((HL),1) and C=H and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply12:=If(C=ref(C,1) and (HL)<ref((HL),1) and C=L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand13:=If(C=ref(C,1) and (HL)<ref((HL),1) and C=((HL)*0.5)+L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply13:=If(C=ref(C,1) and (HL)<ref((HL),1) and C=((HL)*0.5)+L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand14:=If(C=ref(C,1) and (HL)<ref((HL),1) and C=L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V<ref(V,2) and NoDemand=0,1,0);
NoSupply14:=If(C=ref(C,1) and (HL)<ref((HL),1) and C=H and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V<ref(V,2) and NoSupply=0,1,0);
NoDemand15:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C>=ref(C,1) and C=O and C=ref(C,+1) and C>ref(C,+2) and H>=ref(H,+1) and H>=ref(H,+2) and V<ref(V,1) and V<ref(V,2),1,0);
NoSupply15:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C<=ref(C,1) and C=O and C=ref(C,+1) and C<ref(C,+2) and L<=ref(L,+1) and L<=ref(L,+2) and V<ref(V,1) and V<ref(V,2),1,0);
NoDemand16:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C>=ref(C,1) and C=H and C<>O and C=ref(C,+1) and C>ref(C,+2) and H>=ref(H,+1) and H>=ref(H,+2) and V<ref(V,1) and V<ref(V,2),1,0);
NoSupply16:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C<=ref(C,1) and C=L and C<>O and C=ref(C,+1) and C<ref(C,+2) and L<=ref(L,+1) and L<=ref(L,+2) and V<ref(V,1) and V<ref(V,2),1,0);
NoDemand17:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C>=ref(C,1) and C=((HL)*0.5)+L and C<>O and C=ref(C,+1) and C>ref(C,+2) and H>=ref(H,+1) and H>=ref(H,+2) and V<ref(V,1) and V<ref(V,2),1,0);
NoSupply17:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C<=ref(C,1) and C=((HL)*0.5)+L and C<>O and C=ref(C,+1) and C<ref(C,+2) and L<=ref(L,+1) and L<=ref(L,+2) and V<ref(V,1) and V<ref(V,2),1,0);
NoDemand18:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C>=ref(C,1) and C=L and C<>O and C=ref(C,+1) and C>ref(C,+2) and H>=ref(H,+1) and H>=ref(H,+2) and V<ref(V,1) and V<ref(V,2),1,0);
NoSupply18:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C<=ref(C,1) and C=H and C<>O and C=ref(C,+1) and C<ref(C,+2) and L<=ref(L,+1) and L<=ref(L,+2) and V<ref(V,1) and V<ref(V,2),1,0);
NoDemand19:=If(H>ref(H,1) and L>=ref(L,1) and C=O and C>ref(C,+1) and H>=ref(H,+1) and V=ref(V,1) and V<ref(V,2),1,0);
NoSupply19:=If(L<ref(L,1) and H<=ref(H,1) and C=O and C<ref(C,+1) and L<=ref(L,+1) and V=ref(V,1) and V<ref(V,2),1,0);
NoDemand20:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=H and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V=ref(V,1) and V<ref(V,2),1,0);
NoSupply20:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V=ref(V,1) and V<ref(V,2),1,0);
NoDemand21:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=((HL)*0.5)+L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V=ref(V,1) and V<ref(V,2),1,0);
NoSupply21:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=((HL)*0.5)+L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V=ref(V,1) and V<ref(V,2),1,0);
NoDemand22:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V=ref(V,1) and V<ref(V,2),1,0);
NoSupply22:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=H and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V=ref(V,1) and V<ref(V,2),1,0);
NoDemand23:=If(H>ref(H,1) and L>=ref(L,1) and C=O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V=ref(V,2),1,0);
NoSupply23:=If(L<ref(L,1) and H<=ref(H,1) and C=O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V=ref(V,2),1,0);
NoDemand24:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=H and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V=ref(V,2),1,0);
NoSupply24:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V=ref(V,2),1,0);
NoDemand25:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=((HL)*0.5)+L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V=ref(V,2),1,0);
NoSupply25:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=((HL)*0.5)+L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V=ref(V,2),1,0);
NoDemand26:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V<ref(V,1) and V=ref(V,2),1,0);
NoSupply26:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=H and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V<ref(V,1) and V=ref(V,2),1,0);
NoDemand27:=If(H>ref(H,1) and L>=ref(L,1) and C=O and C>ref(C,+1) and H>=ref(H,+1) and V=ref(V,1) and V=ref(V,2),1,0);
NoSupply27:=If(L<ref(L,1) and H<=ref(H,1) and C=O and C<ref(C,+1) and L<=ref(L,+1) and V=ref(V,1) and V=ref(V,2),1,0);
NoDemand28:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=H and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V=ref(V,1) and V=ref(V,2),1,0);
NoSupply28:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V=ref(V,1) and V=ref(V,2),1,0);
NoDemand29:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=((HL)*0.5)+L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V=ref(V,1) and V=ref(V,2),1,0);
NoSupply29:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=((HL)*0.5)+L and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V=ref(V,1) and V=ref(V,2),1,0);
NoDemand30:=If(H>ref(H,1) and L>=ref(L,1) and (HL)<=ref((HL),1) and C=L and C<>O and C>ref(C,+1) and H>=ref(H,+1) and V=ref(V,1) and V=ref(V,2),1,0);
NoSupply30:=If(L<ref(L,1) and H<=ref(H,1) and (HL)<=ref((HL),1) and C=H and C<>O and C<ref(C,+1) and L<=ref(L,+1) and V=ref(V,1) and V=ref(V,2),1,0);
