PageRenderTime 21ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/42A.py

https://bitbucket.org/alculquicondor/codeforces
Python | 12 lines | 12 code | 0 blank | 0 comment | 4 complexity | 11417c3f1bf7513b8799dc19e33af99e MD5 | raw file
  1. s=raw_input().split()
  2. n=int(s[0])
  3. V=float(s[1])
  4. A=[int(x) for x in raw_input().split()]
  5. B=[int(x) for x in raw_input().split()]
  6. x=1e300
  7. for i in range(n):
  8. x=min(float(B[i])/A[i],x)
  9. r=0
  10. for i in range(n):
  11. r+=A[i]*x
  12. print min(r,V)