package main import . "fmt" func main() { var p float64 Scan(&p) var e,q float64 q=1 for i:=0; i<1e6; i++ { e += q*(1-p)*float64(i) q *= p } Printf("%.8f\n", e) }