UVA12003 Array Transformer

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=242&page=show_problem&problem=3154 [PDF](https://uva.onlinejudge.org/external/120/p12003.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12003/50f071c57d8ce0e0ecfd82014a1327d7ceae7ed2.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12003/26bb239ed11d0b47045182bf090b6eb09f4ca774.png)

Explanation/Hint

Explanation: There is only one instruction: $L = 2, R = 8, v = 6, p = 10$. There are $4$ numbers $(2,3,4,5)$ less than $6$, so $k = 4$. The new number in $A[10]$ is $11 ∗ 4/(8 − 2 + 1) = 44/7 = 6$.