UVA931 The Probable n-Ascendants

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=872 [PDF](https://uva.onlinejudge.org/external/9/p931.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA931/e129230907a7d6f11201cca30e413f6412379e76.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA931/85057c9db11b4c1df206d13e9d92153b0cc7c31b.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA931/023ff925f810b62cc86330958b9f8d6e054d1c54.png)