UVA12859 Fence the vegetables

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=861&page=show_problem&problem=4724 [PDF](https://uva.onlinejudge.org/external/128/p12859.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12859/c49c162d1cebb8a76ab8084b802cbed45219b1f4.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12859/a9c26af9116d21ce854c9fb813a164890c9a6c47.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12859/02f0b9da000b43e257695c5550c97633de3e8746.png)