https://codeforces.com/problemset/problem/1352/B
Input Format
Check Link
Output Format
Check Link
Constraints
Check Link
Example
Input
8 10 3 100 4 8 7 97 2 8 8 3 10 5 3 1000000000 9
Output
YES 4 2 4 YES 55 5 5 35 NO NO YES 1 1 1 1 1 1 1 1 NO YES 3 1 1 YES 111111110 111111110 111111110 111111110 111111110 111111110 111111110 111111110 111111120