問題一覧 > 通常問題

No.780 Offline Meetup

レベル : / AI推定難易度 : 101 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 527
作問者 : sifue / テスター : 高槻やよい
お気に入りにしたユーザー ProblemId : 2681 / 自分の提出
問題文最終更新日: 2023-02-22 16:38:36
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 204 (順位表) の他の問題:

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$

$1 \leqq A \leqq 10000$
$1 \leqq B \leqq 10000$

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もしくは右上の雲マークをクリックしてアカウントを作成してください。