#7866. [CCC 2026 J1] Concert Tickets

[CCC 2026 J1] Concert Tickets

[CCC 2026 J1] Concert Tickets

题目描述

Besa wants to buy tickets for the upcoming Saylor Twift concert.

Given the total number of tickets for the concert and the number of tickets other people have purchased, your job is to determine whether or not Besa can buy her desired number of tickets.

输入格式

The first line of input contains a positive integer, $B$, representing the number of tickets Besa wants to buy. The second line contains a positive integer, $T$, representing the total number of tickets for the concert. The third line contains a positive integer, $P$, where $P \le T$, representing the number of tickets other people have purchased.

输出格式

If Besa cannot buy $B$ tickets, output $\texttt{N}$. Otherwise, output $\texttt{Y}$, followed by a single space, followed by the number of tickets that would remain after Besa buys $B$ tickets.
5
100
70
Y 25
3
200000
199998
N

提示

#### Explanation of Output for Sample Input 1 There are a total of $100$ tickets for the concert. Besa wants to buy $5$ tickets and other people have purchased $70$ tickets. So, $100-75=25$ tickets would remain after Besa buys $5$ tickets.

Explanation of Output for Sample Input 2

There are a total of 200 000200\,000 tickets for the concert. Besa wants to buy 33 tickets and other people have purchased 199 998199\,998 tickets. So, Besa cannot buy 33 tickets. 标签: P15536|模拟|CCC(加拿大)|2026

来源

P15536|[CCC 2026 J1] Concert Tickets