式</h4><div class="ui bottom attached segment font-content"><div style="position: relative; overflow: hidden;"><div class=content><p>第一行两个整数N,M。<br />
接下来一行N个数，第i个数表示Ai,1<br />
接下来M-1行，每行两个整数，第i行表示ki,bi</p></div></div></div></div></div><div class="row"><div class="column"><h4 class="ui top attached block header">输出格式</h4><div class="ui bottom attached segment font-content"><div style="position: relative; overflow: hidden;">