- 守望者的逃离
- @ 2016-08-21 20:48:48
var
  m,s,t,x,y:longint;
begin
  readln(m,s,t);
  y:=t;
  x:=s;
  while t>0 do begin
    if m>=10 then begin
      m:=m-10;
      s:=s-60;
      t:=t-1;
    end;
    if m<10 then begin
      if (m=9) or (m=8) or (m=7) or (m=6) then begin
        if (t-2>=0) then begin
          s:=s-60;
          t:=t-2;
          m:=0;
        end;
        if (t-2<0) then begin
          s:=s-17*(2-t);
          t:=0;
        end;
      end;
      if (m=5) or (m=4) or (m=3) or (m=2) then begin
        if (t-3>=0) then begin
          s:=s-60;
          t:=t-3;
          m:=0;
        end;
        if (t-3<0) then begin
          s:=s-17*(3-t);
          t:=0;
        end;
      end;
      if (m=0) or (m=1) then begin
        if (t-1>=0) then begin
          s:=s-17;
          t:=t-1;
        end;
      end;
    end;
  end;
  if s>0 then begin
    writeln('No');
    writeln(x-s);
  end;
  if s<=0 then begin
    writeln('Yes');
    s:=abs(s);
    s:=s div 17;
    writeln(abs(y-s));
  end;
end.