code: func KeyAlgoPriority(certs []*x509.Certificate) int {
  	ret := 0.0
  	for i, cert := range certs {
  		f1 := 1.0 / (float64(i) + 1.0)
  		f2 := 1.0 - f1
  		ret = float64(keyAlgoPriority(cert))*f1 + ret*f2
  	}
  	return int(ret)
  }
docs: // KeyAlgoPriority returns the key algorithm priority of the chain as the average of key algorithm priority of certs in it.