J1. Concert Tickets
의견: 0
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.
\(P \leq T\)
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 \leq T\), representing the number of
tickets other people have purchased.
If Besa cannot buy \(B\) tickets,
output N. Otherwise, output Y, followed by a
single space, followed by the number of tickets that would remain after
Besa buys \(B\) tickets.
5
100
70Y 25There 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.
3
200000
199998NThere are a total of (200\,000)
tickets for the concert. Besa wants to buy (3) tickets and other people have purchased
(199\,998) tickets. So, Besa cannot
buy (3) tickets.
평가 및 의견
J1. Concert Tickets
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
J1. Concert Tickets