No.780 Offline Meetup
Problem Statement
Yasuo, a high school boy, wanted to hang out with girls. So he came up with a plan to hold an offline meetup where participants draw lots to form boy-girl pairs and play a game called Tekumon GO.
You are given the number of boys $A$ attending the meetup, excluding Yasuo, and the number of girls $B$. Yasuo is kind-hearted, so he lets the other boys draw lots to pair up with girls first.
Print YES if Yasuo can pair up with a girl and play, and NO otherwise. Then, after a newline, print the number of people who could not form a pair.
Input
$A\ B$
Output
First print YES or NO followed by a newline, then print the number of people who could not form a pair, and finally print a newline.
Sample
Sample 1
Input
3 4
Output
YES 0
After all the boys have formed pairs, Yasuo can pair up with the remaining girl.
Sample 2
Input
10 2
Output
NO 9
After all the girls have formed pairs, 9 boys are left over, including Yasuo.
Sample 3
Input
1 1
Output
NO 1
Only one boy-girl pair can be formed, and Yasuo is left over.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
sifue