Hide

Problem B
Cheater Detection

/problems/cheaterdetection/file/statement/en/img-0001.png
The old classic computer game, Twisted Forest 2, has recently become really popular to speedrun. Fans of the game have made an unofficial leaderboard for who can beat the game the fastest. The times are given in seconds, with 2 digits of precision, as reported by the in-game timer. You suspect that there are cheated times on the leaderboard. In order to prove this, you’ve decompiled the game and taken a close look at the source code for the in-game timer:
time = 0.0
for each tick:
  displayed_time = floor(100 * time)/100
  display(displayed_time)
  time += 0.015

You’ve realized that the displayed time can skip over some numbers. For example it is impossible for the timer to output $5.39$ since the closest possible times are $5.385$ (displayed as $5.38$) and $5.400$ (displayed as $5.40$). Maybe you can use this insight to catch some cheaters!

Warning: Floating point numbers are imprecise and can give unexpected results. However, you can assume that no floating point errors occur in the in-game timer.

Input

The first line contains $N$, the number of times to check ($1 \leq N \leq 10^5$).

The following $N$ lines each contain a real number $t_i$ ($0 \leq t_i \leq 10^6$). These numbers will always have exactly two digits after the decimal point.

Output

For each number $t_i$ in the input, print “VALID” if it can be achieved in the game, or “IMPOSSIBLE” if it cannot be achieved.

Scoring

Your solution will be tested on a set of test groups, each worth a number of points. Each test group contains a set of test cases. To get the points for a test group you need to solve all test cases in the test group.

Group

Points

Constraints

$1$

$50$

$N \leq 100$, $t_i \leq 10$

$2$

$50$

No additional constraints.

Sample Input 1 Sample Output 1
5
0.00
0.02
1.13
1.14
9.99
VALID
IMPOSSIBLE
IMPOSSIBLE
VALID
VALID

Please log in to submit a solution to this problem

Log in