修改天平 Equilibrium Mobile

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=243&page=show_problem&problem=3318 [PDF](https://uva.onlinejudge.org/external/121/p12166.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12166/83186a3dd84e4e69ea19eb52b35d0c79b5489b61.png)

输入输出格式

输入格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12166/6dbf6b5c60829f3c29586e667ccb557d4fa36eec.png)

输出格式


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

输入输出样例

输入样例 #1

3
[[3,7],6]
40
[[2,3],[4,5]]

输出样例 #1

1
0
3