fork(2) download
  1. from decimal import *
  2. import math
  3. context = Context(prec=50)
  4. setcontext(context)
  5. t=input()
  6. while t>0:
  7. t-=1
  8. r1,r2,r3=map(Decimal,raw_input().split())
  9. k1=Decimal(1)/Decimal(r1)
  10. k2=Decimal(1)/Decimal(r2)
  11. k3=Decimal(1)/Decimal(r3)
  12. k4=k1+k2+k3+2*(k1*k2+k2*k3+k3*k1).sqrt()
  13. r4=Decimal(1)/Decimal(k4)
  14. print r4
  15.  
Success #stdin #stdout 0.08s 9328KB
stdin
3
1 1 1
10 10 10
23 46 69
stdout
0.15470053837925152901829756100391491129520350254025
1.5470053837925152901829756100391491129520350254025
5.9999999999999999999999999999999999999999999999999