#C5645. Organizing Books in a Library
Organizing Books in a Library
Organizing Books in a Library
The city librarian is facing the challenge of organizing a large collection of books that are divided into various genres. Each genre is allocated a fixed number of shelves, and every shelf can hold up to 100 books. For each genre, you are given two numbers: the number of shelves (s_i) and the total number of books (b_i). The books can be organized on the shelves if and only if (b_i \leq s_i \times 100) for every genre in that test case. Your task is to determine, for each test case, whether it is possible to arrange all the books without exceeding the shelf capacity for any genre.
inputFormat
The input begins with an integer (T) denoting the number of test cases. Each test case starts with an integer (G) representing the number of genres. Following that, there are (G) lines, each containing two space-separated integers: (s) (the number of shelves allocated to the genre) and (b) (the number of books in that genre). All input is provided via standard input (stdin).
outputFormat
For each test case, output a single line containing either "YES" or "NO". Output "YES" if every genre in the test case satisfies (b_i \leq s_i \times 100); otherwise, output "NO". All output should be sent to standard output (stdout).## sample
3
2
10 800
5 450
1
7 700
3
15 1500
20 1700
5 400
YES
YES
YES
</p>