CF621D.Rat Kwesh and Cheese

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Wet Shark asked Rat Kwesh to generate three positive real numbers xx , yy and zz , from 0.10.1 to 200.0200.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 xx , yy and zz to Rat Kwesh, and Rat Kwesh will pick one of the these twelve options:

  1. a1=xyza_1=x^{y^z}
  2. a2=xzya_2=x^{z^y}
  3. a3=(xy)za_3=(x^y)^z
  4. a4=(xz)ya_4=(x^z)^y
  5. a5=yxza_5=y^{x^z}
  6. a6=yzxa_6=y^{z^x}
  7. a7=(yx)za_7=(y^x)^z
  8. a8=(yz)xa_8=(y^z)^x
  9. a9=zxya_9=z^{x^y}
  10. a10=zyxa_{10}=z^{y^x}
  11. a11=(zx)ya_{11}=(z^x)^y
  12. a12=(zy)xa_{12}=(z^y)^x

Let mm be the maximum of all the aia_{i} , and cc be the smallest index (from 11 to 1212 ) such that ac=ma_{c}=m . Rat's goal is to find that cc , 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 aca_{c} .

输入格式

The only line of the input contains three space-separated real numbers xx , yy and zz ( 0.1<=x,y,z<=200.00.1<=x,y,z<=200.0 ). Each of xx , yy and zz is given with exactly one digit after the decimal point.

输出格式

Find the maximum value of expression among xyzx^{y^z} , xzyx^{z^y} , (xy)z(x^{y})^{z} , (xz)y(x^{z})^{y} , yxzy^{x^z} , yzxy^{z^x} , (yx)z(y^{x})^{z} , (yz)x(y^{z})^{x} , zxyz^{x^y} , zyxz^{y^x} , (zx)y(z^{x})^{y} , (zy)x(z^{y})^{x} and print the corresponding expression. If there are many maximums, print the one that comes first in the list.

xyzx^{y^z} should be outputted as xyz (without brackets), and (xy)z(x^{y})^{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
    
首页