ORAC
Learn
Problems
Competitions
Leaderboards
...
Log In
Register
Cookies
Statement
Submissions
Hall of Fame
Report Issue
In 2025, this problem was updated to use a simpler way of handling input and output, called standard input and output. You can read more about this change by
clicking here
.
Time Limit
Memory Limit
1 second
256 MiB
Log in
to submit!
If the statement isn't loading correctly, you can
open it in a new tab
.
Attachments
sample-1-out.txt
sample-2-out.txt
sample-3-out.txt
sample-2-in.txt
sample-3-in.txt
sample-1-in.txt
Problem info
Subtask 1 (15 points) has 1 case.
Subtask 2 (15 points) has 1 case.
Subtask 3 (15 points) has 4 cases.
Subtask 4 (25 points) has 14 cases.
Subtask 5 (30 points) has 49 cases.