UVA1003 Can't Cut Down the Forest for the Trees

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=245&page=show_problem&problem=3444 [PDF](https://uva.onlinejudge.org/external/10/p1003.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA1003/2969914848dca983d7880965d76797f4ace1d16d.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA1003/09e8b8eab07101bffc265ddc9531a3e212ab90b4.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA1003/1174b74b6552fece451df7ebdd1c37ce5283dc66.png)