2535: 一元二次方程

Memory Limit:512 MB Time Limit:1.000 S
Judge Style:Normal Judger Creator:
Submit:4 Solved:0

Description

Input

输入的第一行包含两个正整数T,M,分别表示方程数和系数绝对值的上界;

接下来T行,每行包含三个整数a,b,c。

Output

输出T行,每行包含一个字符串,表示对应询问的答案,格式如题面所述。

Sample Input Copy

9 1000
1 ‐1 0
‐1 ‐1 ‐1
1 ‐2 1
1 5 4
4 4 1
1 0 ‐432
1 ‐3 1
2 ‐4 1
1 7 1

Sample Output Copy

1
NO
1
-1
-1/2
12*sqrt(3)
3/2+sqrt(5)/2
1+sqrt(2)/2
-7/2+3*sqrt(5)/2

Source/Category