function [A,f] = TD(cc,n,a)
if cc==1 
    A=diag(11-(1:21))+diag(ones(20,1),1)+diag(ones(20,1),-1);
    f(1)=11; f(2:20)=13-(2:20);f(21)=-9; f=f';
end
if cc==2
        A=diag(1/(1:n))+diag(ones(n-1,1),1)+diag(ones(n-1,1),-1);
        f(1)=2; f(2:n)=2+1/(2:n-1); f(n)=1+1/n; f=f';
end
if cc==3
        A=zeros(100,100);
        for i=1:50
            A(i,i)=50-i+1+2*a;
            A(i+50,i+50)=-i+2*a;
            A(i+50,i+49)= i-1*a;
            A(i,i+1) = -1*a-51+i;
        end
        for i= 1:49
            A(i+1,i)=-a;
            A(i+50,i+51) = -a;
        end
        f=zeros(100,1); f(1)=a;f(100)=a;
end

        