Starman
Time limit1sMemory limit128 MB
Given up to 100 year ranges, print the Bowie albums released within each range, in release order, with a count first.
- Level
Easy2 of 10
- Topics
- Array, Implementation
- Solved
- No attempts yet
Problem
In January 2016 the rock star David Bowie died. Jaehyun wanted to honor him, so he designed a program called RDBMS (Rockstar David Bowie Memorial System). RDBMS runs on a very small query language named SQL (Starman Query Language).
An SQL query is a pair of integers and . It asks for every David Bowie album released on or after January 1 of year and on or before December 31 of year , listed in release order.
The table below is the complete album list used for judging. It is sorted by release order, and albums released in the same year keep the order shown in the table.
Help Jaehyun and write a program that answers SQL queries.
Input
The first line contains the number of queries ().
Each of the next lines contains one query: two integers and separated by a space ().
Output
For each query print the following.
- On the first line print , the number of albums that satisfy the query.
- On each of the next lines print one of those albums in release order. Each line has the form "release year album name", with the year and the name separated by a single space.
Album names must match the table exactly, including capitalization. Do not print a blank line between queries.