Overpreparation VS Underpreparation
Time: 1 s
Memory: 125 MB
Memory: 125 MB
East West University (EWU) is organizing its annual Intra University Programming Contest. In preparation, the organizers have set up a total of \(n\) computers across all the computer labs. However, as experience has shown, not all registered participants actually attend the contest. To accommodate potential no-shows, the organizers always over-register students. This year \(m\) people attended.
You are given \(n\) and \(m\). If there are extra computers available beyond the number of attending students, print "Extra \(x\)" (without quotes), where \(x\) represents the count of available free computers. If some students cannot secure a computer, print "Sad \(y\)" (without quotes), where \(y\) represents the count of those students. Finally, if every attending student has been assigned a computer, and there are no extra computers, print "Perfect!" (without quotes).
You are given \(n\) and \(m\). If there are extra computers available beyond the number of attending students, print "Extra \(x\)" (without quotes), where \(x\) represents the count of available free computers. If some students cannot secure a computer, print "Sad \(y\)" (without quotes), where \(y\) represents the count of those students. Finally, if every attending student has been assigned a computer, and there are no extra computers, print "Perfect!" (without quotes).
Input
The first line contains two integers \(n\) and \(m\) \((1 \leq n,m \leq 300)\) — the number of computers and the number of attended students.
Output
Print the desired output.
Examples
| Input | Output |
|---|---|
|
100 100
|
Perfect!
|
| Input | Output |
|---|---|
|
220 300
|
Sad 80
|
| Input | Output |
|---|---|
|
300 100
|
Extra 200
|
Notes
In the second example, \(300\) students showed up and only \(220\) computers were available.In the third example, \(100\) students showed up and \(300\) computers were available.
Problem Info
| Problem ID | 269 |
| Time Limit | 1000 ms |
| Memory Limit | 128000 KB |
| Moderators | amirhozaifa , fahimcp495 |
Statistics
Submit
You need to Login or Registration for submit your solution