#C2248. On-Time Cookie Baking

    ID: 45543 Type: Default 1000ms 256MiB

On-Time Cookie Baking

John, a passionate baker, has a busy schedule with an upcoming event. He needs to bake a number of cookies and wants to finish baking strictly before the event starts. In each batch, John can bake up to 8 cookies in 45 minutes. Given the time available until the event (in minutes) and the number of cookies he must bake, determine whether John can finish baking all of them in time.

For each test case, you are provided with two integers:

  • L: the available time (in minutes) before the event starts.
  • N: the number of cookies to bake.

Calculate the minimum number of baking batches required by using the formula \(\lceil \frac{N}{8} \rceil\), where each batch takes 45 minutes. If the total baking time is strictly less than \(L\), output YES; otherwise, output NO.

Note: All formulas are given in \(\LaTeX\) format.

inputFormat

The input is read from standard input (stdin). The first line contains an integer (T) denoting the number of test cases. Each of the following (T) lines contains two space-separated integers: (L) (the available time in minutes) and (N) (the number of cookies to bake).

outputFormat

For each test case, print a single line to standard output (stdout) containing either YES if John can finish baking strictly before the event starts, or NO otherwise.## sample

3
90 16
180 9
45 8
NO

YES NO

</p>