function [out] = queries_n3t1(f)

n = 3;

E0 = eimat(n,0);
E1 = eimat(n,1);
E2 = eimat(n,2);
E3 = eimat(n,3);

cvx_begin %quiet

  cvx_precision best;

  % variables m_ij : 0 <= i <= n, 0 <= j <= t-1
  
  variable m00(2^n,2^n) symmetric;
  variable m10(2^n,2^n) symmetric;
  variable m20(2^n,2^n) symmetric;
  variable m30(2^n,2^n) symmetric;
    
  variable g0(2^n,2^n) symmetric;
  variable g1(2^n,2^n) symmetric;
  
  variable epss;
  
  minimise( epss );
  
  subject to
  
    % Input condition.
  
    m00 + m10 + m20 + m30 == ones(2^n,2^n);
    
    % Running conditions (between 1 and t-1).
        
    % Output matches last but one query.
    
    g0 + g1 == E0 .* m00 + E1 .* m10 + E2 .* m20 + E3 .* m30;
    
    % Output constraints.
    
    diag(g0) >= (1-epss)*(1-f);
    diag(g1) >= (1-epss)*f;
    
    % Semidefinite constraints.

    m00 == semidefinite(2^n);
    m10 == semidefinite(2^n);
    m20 == semidefinite(2^n);
    m30 == semidefinite(2^n);
            
    g0 == semidefinite(2^n);
    g1 == semidefinite(2^n);
    
%cvx_problem

cvx_end

out = epss;