#include<bits/stdc++.h> using namespace std; int m,s,t,T,now,run,ans=99999999,k,maxn; int main(){ int i; scanf("%d%d%d",&m,&s,&t); while(now<s){ run=now+(t-T)*17; if(T>=t)break; if(run<s && run>maxn)maxn=run; if(run>=s){ if((s-now)%17)k=(s-now)/17+1; else k=(s-now)/17; run=T+k; if(run<ans)ans=run; } if(m>=10)m-=10,now+=60,T+=1; else T+=1,m+=4; if(T<=t && now>maxn)maxn=now; } if(T<=t && now>=s && T<ans) ans=T; if(ans==99999999)printf("No\n%d",maxn); else printf("Yes\n%d",ans); return 0; }
时间: 2024-10-11 14:16:49