UVA592 Island of Logic

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=533 [PDF](https://uva.onlinejudge.org/external/5/p592.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA592/5b44438259f5811b3068fd7f7c61972b98c76441.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA592/153065863d1625ace890166a8de35a29b6ff4225.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA592/0a8f8cec02b40f79221fe414db52c2d32026e0ed.png)