UVA12781 Alternation Formulae

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=823&page=show_problem&problem=4646 [PDF](https://uva.onlinejudge.org/external/127/p12781.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12781/a69176a4e732e10000309f1953aa9fd364f70f5b.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12781/355293d95dd9402e882d81aa9c6936e18377f04a.png)

Output Format

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