1759: 【CSP分支】预算够吗█

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:11 Solved:8

Description

一个工厂的总支出预算是 lns="http://www.w3.org/1998/Math/MathML">n 万元,实际原材料需要用 lns="http://www.w3.org/1998/Math/MathML">a 万元,发工资和福利需要用 lns="http://www.w3.org/1998/Math/MathML">b 万元,其他情况需要用 lns="http://www.w3.org/1998/Math/MathML">c 万元。

编程求这个工厂的预算够用吗?如果预算够,请输出还能剩余多少万元,以及输出 lns="http://www.w3.org/1998/Math/MathML">YES 。

比如:输入 lns="http://www.w3.org/1998/Math/MathML">100 lns="http://www.w3.org/1998/Math/MathML">23 lns="http://www.w3.org/1998/Math/MathML">53 lns="http://www.w3.org/1998/Math/MathML">21 ,表示总支出预算有 lns="http://www.w3.org/1998/Math/MathML">100 万元,实际需要支出的各项总和 lns="http://www.w3.org/1998/Math/MathML">=a+b+c=23+53+21=97 (万元),由于 lns="http://www.w3.org/1998/Math/MathML">10097 ,因此预算是够的,还能剩余 lns="http://www.w3.org/1998/Math/MathML">3万元,因此输出为: lns="http://www.w3.org/1998/Math/MathML">3 YES

如果预算不够,请输出还需要多少万元才够,再输出 lns="http://www.w3.org/1998/Math/MathML">NO 。

再比如:输入 lns="http://www.w3.org/1998/Math/MathML">10 2 8 5,表示总支出预算有 lns="http://www.w3.org/1998/Math/MathML">10 万元,实际需要支出的各项总和 lns="http://www.w3.org/1998/Math/MathML">=2+8+5=15 (万元),由于 lns="http://www.w3.org/1998/Math/MathML">10<15 ,显然预算不够,还需要 lns="http://www.w3.org/1998/Math/MathML">5万元,因此输出为: lns="http://www.w3.org/1998/Math/MathML">5 NO 。

Input

一行,输入 lns="http://www.w3.org/1998/Math/MathML">4 个整数 lns="http://www.w3.org/1998/Math/MathML">n,a,b,c 

Output

一行,先输出预算差额 lns="http://www.w3.org/1998/Math/MathML">s ,如果够再输出 YES ,不够输出 NO ,中间用空格隔开。

Sample Input Copy

10 2 5 7

Sample Output Copy

4 NO