ABSURD - Absurd prices

题意翻译

Absurd 数 (absurd.*) 【问题描述】 一个正整数的 absurd 值定义如下: 1.去除开头、结尾的 0,记此操作之后的数为 x; 2.记 x 的位数为 p,最后一位为 m; 3.若 m=5 则 absurd 值为 p*2-1,否则为 p*2; 对于一个正整数 c,若在闭区间[0.95c,1.05c]内存在一个整数 e,使得 e 的 absurd 值小于 c 的 absurd 值,则称 c 为 absurd 数,否则称为 not absurd 数。 现在询问 c 是否为 absurd 数。 【输入】 第一行一个整数 T,为询问组数; 下面 T 行,每行一个整数 c,代表询问。 【输出】 对于每一个询问,输出一行字符串,若 c 为 absurd 数,则输出“absurd”, 否则输出“not absurd”。 注意:输出不包含引号,字符串严格匹配! 【输入样例】 4 99 49998 90000 970000000 【输出样例】 absurd absurd not absurd absurd 【数据规模】 对于 30%的数据满足:T <= 500,c <= 1000 对于 100%的数据满足:T <= 100000,c <= 10^9 翻译提供者:ycbest

题目描述

Surely you know that supermarkets, shopping centres, and indeed all kind of vendors seem to have fallen in love with the digit _9_, for that digit occurs most often in the price of a product, preferably at the least significant positions. Your favourite chocolate bar might cost _99_ cents, just right to be able to advertise that it costs less than _1_ euro. Your new bicycle might cost _499.98_ euros, which, of course, is less than _500_ euros. While such comparisons are mathematically sound, they seem to impose a certain amount of stupidity on the customer. Moreover, who wants to carry home those annoying small coins you get back as change? Fortunately, the FIFA has not adopted this weird pricing scheme: a ticket for the final in the first category for example costs _900_ dollar, in the second category _600_ dollar and in the third category _400_ dollar. These prices may only be regarded weird for other reasons. We want to distinguish between **absurd** prices like _99_ cents, _499.98_ euros, etc. and normal prices. To measure the absurdity of a positive integer, do the following: - Eliminate all trailing zeros, i.e., those in the least significant positions, from the number. You now have a positive integer, say _x_, with a non-zero digit _d_ at its end. - Count the number of digits, say _a_, of the number _x_. - if _d=5_ the absurdity of the number is _2 \* a - 1_ - otherwise, the absurdity of the number is _2 \* a_ For example, the absurdity of _350_ is _3_ and the absurdity of _900900_ is _8_. Using the measure of absurdity, we can define what we call an absurd price: A price _c_ is absurd if and only if the closed interval \[_0.95 \* c,1.05 \* c_\] contains an integer _e_ such that the absurdity of _e_ is less than the absurdity of _c_. Given a price in cents, go ahead and tell whether it is absurd!

输入输出格式

输入格式


The first line of the input consists of the number _t_ of test cases to follow. Each test case is specified by one line containing an integer _c_. You may assume that _1 ._

输出格式


For each test case output if _c_ is absurd or not. Adhere to the format shown in the sample output.

输入输出样例

输入样例 #1

4
99
49998
90000
970000000

输出样例 #1

absurd
absurd
not absurd
absurd