UVA13009 Fence the vegetables fail

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=866&page=show_problem&problem=4897 [PDF](https://uva.onlinejudge.org/external/130/p13009.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13009/69c56d861bf66e6ff171d661283dc49ecfc950df.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13009/5cdbf52fff0046ec9c5f149c059f3f4d039586f7.png)