CF621D.Rat Kwesh and Cheese
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Wet Shark asked Rat Kwesh to generate three positive real numbers x , y and z , from 0.1 to 200.0 , inclusive. Wet Krash wants to impress Wet Shark, so all generated numbers will have exactly one digit after the decimal point.
Wet Shark knows Rat Kwesh will want a lot of cheese. So he will give the Rat an opportunity to earn a lot of cheese. He will hand the three numbers x , y and z to Rat Kwesh, and Rat Kwesh will pick one of the these twelve options:
- a1=xyz;
- a2=xzy;
- a3=(xy)z;
- a4=(xz)y;
- a5=yxz;
- a6=yzx;
- a7=(yx)z;
- a8=(yz)x;
- a9=zxy;
- a10=zyx;
- a11=(zx)y;
- a12=(zy)x。
Let m be the maximum of all the ai , and c be the smallest index (from 1 to 12 ) such that ac=m . Rat's goal is to find that c , and he asks you to help him. Rat Kwesh wants to see how much cheese he gets, so he you will have to print the expression corresponding to that ac .
输入格式
The only line of the input contains three space-separated real numbers x , y and z ( 0.1<=x,y,z<=200.0 ). Each of x , y and z is given with exactly one digit after the decimal point.
输出格式
Find the maximum value of expression among xyz , xzy , (xy)z , (xz)y , yxz , yzx , (yx)z , (yz)x , zxy , zyx , (zx)y , (zy)x and print the corresponding expression. If there are many maximums, print the one that comes first in the list.
xyz should be outputted as xyz (without brackets), and (xy)z should be outputted as (xy)z (quotes for clarity).
输入输出样例
输入#1
1.1 3.4 2.5
输出#1
z^y^x
输入#2
2.0 2.0 2.0
输出#2
x^y^z
输入#3
1.9 1.8 1.7
输出#3
(x^y)^z