UVA10842 Traffic Flow

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=20&page=show_problem&problem=1783 [PDF](https://uva.onlinejudge.org/external/108/p10842.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10842/f70104c28f72da2be240fbc9a9712f2251514431.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10842/76f7bcde300ea66c79f4fb7ad557b21fd94b6838.png)

Output Format

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