Problem
Input format
The first line contains `n` and `y`, separated by a space. The next `n` lines each contain the title, author, and year, separated by spaces. - `1 <= n <= 500` - `1 <= y <= 3000` - book years are natural numbers between `1` and `3000` - the title and author have at most 50 characters and contain no spaces
Output format
The first line of output contains the number of books published before `y`. The following lines contain the selected books, in reading order, one per line, in the format `titlu autor an`.
Example
4 2000 Rascoala Rebreanu 1932 Ion Rebreanu 1920 Enigma Stanescu 2015 Baltagul Sadoveanu 1930
3 Rascoala Rebreanu 1932 Ion Rebreanu 1920 Baltagul Sadoveanu 1930
Stuck?
Use the Get Hint button in the action bar to reveal a guided hint.
💬 Discussion
Loading...No comments yet. Be the first to start the discussion!
Sample cases (from the problem)
Sample Case 1
4 2000 Rascoala Rebreanu 1932 Ion Rebreanu 1920 Enigma Stanescu 2015 Baltagul Sadoveanu 1930
3 Rascoala Rebreanu 1932 Ion Rebreanu 1920 Baltagul Sadoveanu 1930
Solve it your way first
Community solutions unlock after you submit a passing solution. Don't peek.
Ready to solve this challenge?
Create a free account to write code, submit solutions, and track your progress.