Article DESIGN OF OPTIMAL ALGORITHMS FOR DIAGNOSTICS UNDER RESTRICTIONS USING THE DYNAMIC PROGRAMMING METHOD