func main() var t: int :: cui@inputInt() for(1, t) var p: float :: cui@inputFloat() var k: int :: cui@inputInt() var ans: float :: 0.0 var pn: float :: 1.0 for i(1, k) if(i = k) do ans :+ i $ float * pn else do ans :+ i $ float * pn * p do pn :* (1.0 - p) end if end for do cui@print("\{ans}\n") end for end func