UVA797 Two Way Traffic

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=9&page=show_problem&problem=738 [PDF](https://uva.onlinejudge.org/external/7/p797.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA797/410b522050ea75b7f0b4b1c737d062c44866ad42.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA797/7ccc7b1f63e5db145c103c5f67e595c4268fa274.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA797/34bbd7a679148fa013846af9f88a96d21cf16b1d.png)