# -*- coding:utf-8 -*- while True: n,sumtime = raw_input().split(" ") n = int(n) sumtime = int(sumtime) minls = [] maxls = [] while n: imin,imax = raw_input().split(" ") minls.append( int(imin) ) maxls.append(int(imax)) n-=1 if sum(maxls)< sumtime: print "No" elif sum(minls)>sumtime: print "No" else: print "Yes" leve = sumtime-sum(minls) for i in range(len(minls)): if leve ==0: break if leve>= (maxls[i]-minls[i]): leve -= maxls[i]-minls[i] minls[i] =maxls[i] else: minls[i] += leve leve = 0 result = "" for h in minls: result = result+str(h)+" " print result
点赞 2

相关推荐

10-06 12:46
门头沟学院 Java
跨考小白:定时任务启动
点赞 评论 收藏
分享
废铁汽车人:秋招真是牛鬼蛇神齐聚一堂
点赞 评论 收藏
分享
牛客网
牛客企业服务