QOJ.ac

QOJ

Time Limit: 1 s - 2 s Memory Limit: 1024 MB Total points: 20

#5858. FreeCell Statistics

Statistics

Problem

I played D (D > 0) games of FreeCell today. Each game of FreeCell ends in one of two ways -- I either win, or I lose. I've been playing for many years, and have so far played G games in total (obviously, GD).

At the end of the day, I look at the game statistics to see how well I have played. It turns out that I have won exactly PD percent of the D games today, and exactly PG percent of G total games I had ever played. Miraculously, there is no rounding necessary -- both percentages are exact! Unfortunately, I don't remember the exact number of games that I have played today (D), or the exact number of games that I have played in total (G). I do know that I could not have played more than N games today (DN).

Are the percentages displayed possible, or is the game statistics calculator broken?

Input

The first line of the input gives the number of test cases, T. T lines follow. Each line contains 3 integers -- N, PD and PG.

Output

For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is either "Possible" or "Broken".

Limits

0 ≤ PD ≤ 100;

0 ≤ PG ≤ 100.

Memory limit: 1GB.

Small dataset (Test set 1 - Visible; 6 Points)

1 ≤ T ≤ 100;

1 ≤ N ≤ 10.

Time limit: 30 1 second(s).

Large dataset (Test set 2 - Hidden; 14 Points)

1 ≤ T ≤ 2000;

1 ≤ N ≤ 1015.

Time limit: 60 2 seconds.

Sample

3
1 100 50
10 10 100
9 80 56
Case #1: Possible
Case #2: Broken
Case #3: Possible

In Case #3, I could have played 5 games today (D = 5) and 25 games in total (G = 25), and won 4 games today (80% of 5) and 14 games in total (56% of 25).

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.