UVA910 TV game

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=851 [PDF](https://uva.onlinejudge.org/external/9/p910.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA910/aadedcb184ab4cafc4f7a4391804c0e5ab6c44b8.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA910/8e5b33746d3b3d64ab6e785328524643c0e81df6.png)