P27879 [洛谷] [GESP202309 Level 1] Buying Stationery
普及-
题目描述

Problem Description

It's the start of a new school term, and Xiaoming goes to the stationery store to buy supplies. A pen costs 2 yuan each, and he needs \(X\) pens; a notebook costs 5 yuan each, and he needs \(Y\) notebooks; a ruler costs 3 yuan each, and he needs \(Z\) rulers. Xiaoming has \(Q\) yuan. Please write a program to help Xiaoming determine if he has enough money to buy all the stationery he needs.

Input Format

The first line contains a positive integer, which is the number of pens Xiaoming wants to buy. It is guaranteed that \(1 \le X \le 10\).

The second line contains a positive integer, which is the number of notebooks Xiaoming wants to buy. It is guaranteed that \(1 \le Y \le 10\).

The third line contains a positive integer, which is the number of rulers Xiaoming wants to buy. It is guaranteed that \(1 \le Z \le 10\).

The fourth line contains a positive integer \(Q\), which is the amount of money Xiaoming has (in yuan).

Output Format

Output 2 lines. If Xiaoming has enough money to buy all the stationery he needs, the first line should output Yes, and the second line should output the amount of money Xiaoming will have left (in yuan); otherwise, the first line should output No, and the second line should output the amount of money Xiaoming is short (in yuan).

Sample Input and Output

Sample Input #1

1
1
1
20

Sample Output #1

Yes
10

Sample Input #2

1
1
1
5

Sample Output #2

No
5
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 1 1 20
样例输出
Yes 10