- محدودیت زمان: ۱ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
There is company producing random sized triangular shaped biscuits. Since the technique of making such biscuits is very complicated, the minimum size of produced biscuits is out of control. The owners know that it’s annoying for the customers to find lots of tiny pieces in their biscuit packs, so, they want to add a filtering module in their production line. In the filtering module, there is a rolling belt which all the biscuits are put there and scanned by a camera before being redirected to the filtering grid. In this stage, the camera detects the number of triangles and dimension of each. The filtering grid has an adjustment system which can change the size of the squares of the grid filter.
For more accuracy in filtering, the grid has a harsh vibrating motion causing the biscuits being popped up and rotate in all possible directions. This will happen long enough and you can be sure the triangles will fall on the grid in almost all possible orientations.
The owners want you to write a program in order to adjust the grid size in such a way that for a threshold percentage of $P$ and acceptable error of $E$, only $P±E$ percent of the biscuit pieces remain on the grid to be packed and the others fall through the grid holes to be recycled.
ورودی
First line of input begins what in integer $T$ indicating number of test cases to follow.
$$1 \leq T \leq 20$$
Each test case begins with three space separated integers $N, P$ and $E$ representing number of biscuits, threshold, and acceptable error respectively.
$$1 \leq N \leq 10^5$$ $$0 \lt P, E \lt 100, \quad \quad 100 \gt P ± E \gt 0$$
Following $N$ lines each contain $3$ space separated real numbers $a, b$ and $c$ indicating dimensions of each triangle.
$$0 \lt a, b, c \lt 10^9$$.
خروجی
For each test case, print out the minimum size of square edges to be set in such a way that $P±E$ percent of the biscuits remain on the filter rounded in $2$ digits after floating point. Note that if a range of size satisfies the condition, print the minimum and assume that a biscuit having an exact match dimensions with the squares will fall. If the condition can’t be satisfied print IMPOSSIBLE
.
مثالها
ورودی نمونه ۱
2
5 70 10
1.5 2 2.5
2 2 2
7.5 8 10
5 6 7
3 3 3
3 50 20
5.5 5.5 5.5
5.5 5.5 5.5
5.5 5.5 5.5
خروجی نمونه ۱
1.22
IMPOSSIBLE
ارسال پاسخ برای این سؤال